diff --git a/.travis.yml b/.travis.yml index d28239cd..624cd37d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ dist: focal language: node_js node_js: - - 18.19.0 + - 18.19.1 before_install: - npm install -g codecov after_success: diff --git a/INSTALL.md b/INSTALL.md index 9b8c696b..ed803ca7 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,44 +1,45 @@ # Install Guide ## All Platforms -Sensemaker requires Node, MySQL, and Redis to run. +Sensemaker requires Node, MySQL, Redis, and Ollama to run. Install scripts are included in the `scripts/` directory, including `install.sh` to automate installation on a compatible system. -### Key Management -``` -export FABRIC_SEED="some 24-word seed" -``` +**Windows Users:** there is a known issue installing the TensorFlow dependency: https://github.com/tensorflow/tfjs/issues/7341 ### Database Setup -``` +MySQL is used as a reliable database for Sensemaker. + +Open shell: +```bash sudo mysql ``` In the MySQL shell: -``` +```sql CREATE DATABASE db_sensemaker; CREATE USER 'db_user_sensemaker'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON db_sensemaker.* TO 'db_user_sensemaker'@'localhost'; EXIT; ``` +Be sure to set a password in the commands above. -Install Knex, Seed Database -``` +#### Knex +Knex is used to manage database schemas. + +Install `knex`: +```bash npm i -g knex # schema management tool knex migrate:latest # create tables -knex seed:run # insert data +knex seed:run # initial data ``` ### Ollama Ollama is a convenient API provider for LLM interactions. -``` +Run the install scripts: +```bash ./scripts/install-ollama.sh ./scripts/install-models.sh ``` - -Run dependencies with docker-compose (optional) -``` -docker-compose up -d -``` +Other models can be installed using `ollama pull ` and configured in `settings/local.js` in the `ollama` property. ## Debian/Ubuntu ``` diff --git a/actions/accountActions.js b/actions/accountActions.js index 06b262c3..14ffb30e 100644 --- a/actions/accountActions.js +++ b/actions/accountActions.js @@ -2,7 +2,12 @@ const { fetchFromAPI } = require('./apiActions'); -async function fetchUsersFromAPI(token) { +async function fetchAccountsFromAPI (token) { + // TODO: pagination + return fetchFromAPI('/accounts', null, token); +} + +async function fetchUsersFromAPI (token) { // TODO: pagination return fetchFromAPI('/users', null, token); } @@ -93,7 +98,6 @@ const askPasswordReset = (email) => { }; } - module.exports = { fetchUser, fetchUsers, @@ -106,5 +110,5 @@ module.exports = { FETCH_ACCOUNTS_FAILURE, PASSWORD_RESET_REQUEST, PASSWORD_RESET_SUCCESS, - PASSWORD_RESET_FAILURE, + PASSWORD_RESET_FAILURE }; diff --git a/actions/chatActions.js b/actions/chatActions.js index 77523826..c2939a9d 100644 --- a/actions/chatActions.js +++ b/actions/chatActions.js @@ -44,17 +44,13 @@ const resetChat = (message) => { }; } -const submitMessage = (message, collection_id = null, file_fabric_id = null) => { +const submitMessage = (message, collection_id = null) => { return async (dispatch, getState) => { dispatch(messageRequest()); const token = getState().auth.token; try { let requestBody = { ...message }; - if (file_fabric_id !== null) { - requestBody.file_fabric_id = file_fabric_id; - } - const response = await fetch('/messages', { method: 'POST', headers: { @@ -106,7 +102,7 @@ const fetchResponse = (message) => { }; }; -const regenAnswer = (message, collection_id = null, file_fabric_id = null) => { +const regenAnswer = (message, collection_id = null) => { return async (dispatch, getState) => { dispatch(messageRequest()); const token = getState().auth.token; @@ -116,10 +112,6 @@ const regenAnswer = (message, collection_id = null, file_fabric_id = null) => { // Start with the original message let requestBody = { ...message }; - // If file_id is not null, add it to the requestBody - if (file_fabric_id !== null) { - requestBody.file_fabric_id = file_fabric_id; - } try { const response = await fetch(`/messages/${message.id}`, { @@ -152,6 +144,7 @@ const getMessages = (params = {}) => { const state = getState(); const token = state.auth.token; + // TODO: re-evaluate this... is this safe? if (!params.conversation_id) params.conversation_id = state.chat.message.conversation; try { diff --git a/actions/groupActions.js b/actions/groupActions.js new file mode 100644 index 00000000..00dfd624 --- /dev/null +++ b/actions/groupActions.js @@ -0,0 +1,97 @@ +'use strict'; + +const fetch = require('cross-fetch'); +const { fetchFromAPI } = require('./apiActions'); + +async function fetchGroupsFromAPI (token) { + // TODO: pagination + return fetchFromAPI('/groups', null, token); +} + +// Action types +const CREATE_GROUP_REQUEST = 'CREATE_GROUP_REQUEST'; +const CREATE_GROUP_SUCCESS = 'CREATE_GROUP_SUCCESS'; +const CREATE_GROUP_FAILURE = 'CREATE_GROUP_FAILURE'; + +const FETCH_GROUPS_REQUEST = 'FETCH_GROUPS_REQUEST'; +const FETCH_GROUPS_SUCCESS = 'FETCH_GROUPS_SUCCESS'; +const FETCH_GROUPS_FAILURE = 'FETCH_GROUPS_FAILURE'; + +const FETCH_GROUP_REQUEST = 'FETCH_GROUP_REQUEST'; +const FETCH_GROUP_SUCCESS = 'FETCH_GROUP_SUCCESS'; +const FETCH_GROUP_FAILURE = 'FETCH_GROUP_FAILURE'; + +// Action creators +const createGroupRequest = () => ({ type: CREATE_GROUP_REQUEST, loading: true }); +const createGroupSuccess = (groups) => ({ type: CREATE_GROUP_SUCCESS, payload: groups, loading: false }); +const createGroupFailure = (error) => ({ type: CREATE_GROUP_FAILURE, payload: error, loading: false }); + +const fetchGroupsRequest = () => ({ type: FETCH_GROUPS_REQUEST, loading: true }); +const fetchGroupsSuccess = (groups) => ({ type: FETCH_GROUPS_SUCCESS, payload: groups, loading: false }); +const fetchGroupsFailure = (error) => ({ type: FETCH_GROUPS_FAILURE, payload: error, loading: false }); + +const fetchGroupRequest = () => ({ type: FETCH_GROUP_REQUEST, loading: true }); +const fetchGroupSuccess = (instance) => ({ type: FETCH_GROUP_SUCCESS, payload: instance, loading: false }); +const fetchGroupFailure = (error) => ({ type: FETCH_GROUP_FAILURE, payload: error, loading: false }); + +// Thunk action creator +const fetchGroups = () => { + return async (dispatch, getState) => { + dispatch(fetchGroupsRequest()); + const { token } = getState().auth; + try { + const groups = await fetchGroupsFromAPI(token); + dispatch(fetchGroupsSuccess(groups)); + } catch (error) { + dispatch(fetchGroupsFailure(error)); + } + }; +}; + +const fetchGroup = (id) => { + return async (dispatch, getState) => { + dispatch(fetchGroupRequest()); + const { token } = getState().auth; + try { + const instance = await fetchFromAPI(`/groups/${id}`, null, token); + dispatch(fetchGroupSuccess(instance)); + } catch (error) { + dispatch(fetchGroupFailure(error)); + } + }; +}; + +const createGroup = (group) => { + return async (dispatch, getState) => { + dispatch(createGroupRequest()); + const { token } = getState().auth; + try { + const newGroup = await fetch('/groups', { + method: 'POST', + headers: { + 'Authorization': `Bearer ${token}`, + 'Content-Type': 'application/json', + }, + body: JSON.stringify(group) + }); + dispatch(createGroupSuccess(newGroup)); + } catch (error) { + dispatch(createGroupFailure(error)); + } + }; +} + +module.exports = { + fetchGroup, + fetchGroups, + createGroup, + CREATE_GROUP_REQUEST, + CREATE_GROUP_SUCCESS, + CREATE_GROUP_FAILURE, + FETCH_GROUP_REQUEST, + FETCH_GROUP_SUCCESS, + FETCH_GROUP_FAILURE, + FETCH_GROUPS_REQUEST, + FETCH_GROUPS_SUCCESS, + FETCH_GROUPS_FAILURE +}; diff --git a/actions/index.js b/actions/index.js index 24fe6486..6cf27601 100644 --- a/actions/index.js +++ b/actions/index.js @@ -106,6 +106,24 @@ const { fetchUserFiles, } = require('../actions/fileActions'); +const { + fetchGroup, + fetchGroups, + createGroup +} = require('../actions/groupActions'); + +const { + fetchPeer, + fetchPeers, + createPeer +} = require('../actions/peerActions'); + +const { + fetchSource, + fetchSources, + createSource +} = require('../actions/sourceActions'); + // ## Upload Actions const { fetchUploads, @@ -179,6 +197,11 @@ module.exports = { fetchFiles: fetchFiles, fetchFile: fetchFile, uploadFile: uploadFile, + fetchGroup: fetchGroup, + fetchGroups: fetchGroups, + createGroup: createGroup, + createPeer: createPeer, + createSource: createSource, fetchUserFiles: fetchUserFiles, fetchInquiry: fetchInquiry, fetchInquiries: fetchInquiries, @@ -193,9 +216,13 @@ module.exports = { acceptInvitation: acceptInvitation, declineInvitation: declineInvitation, deleteInvitation: deleteInvitation, + fetchPeer: fetchPeer, + fetchPeers: fetchPeers, fetchPeople: fetchPeople, fetchPerson: fetchPerson, fetchResponse: fetchResponse, + fetchSource: fetchSource, + fetchSources: fetchSources, fetchTask: fetchTask, fetchTasks: fetchTasks, fetchUploads, diff --git a/actions/peerActions.js b/actions/peerActions.js new file mode 100644 index 00000000..db08076c --- /dev/null +++ b/actions/peerActions.js @@ -0,0 +1,109 @@ +'use strict'; + +const fetch = require('cross-fetch'); +const { fetchFromAPI } = require('./apiActions'); + +async function fetchPeersFromAPI (token) { + // TODO: pagination + return fetchFromAPI('/peers', null, token); +} + +// Action types +const FETCH_PEERS_REQUEST = 'FETCH_PEERS_REQUEST'; +const FETCH_PEERS_SUCCESS = 'FETCH_PEERS_SUCCESS'; +const FETCH_PEERS_FAILURE = 'FETCH_PEERS_FAILURE'; + +const FETCH_PEER_REQUEST = 'FETCH_PEER_REQUEST'; +const FETCH_PEER_SUCCESS = 'FETCH_PEER_SUCCESS'; +const FETCH_PEER_FAILURE = 'FETCH_PEER_FAILURE'; + +const CREATE_PEER_REQUEST = 'CREATE_PEER_REQUEST'; +const CREATE_PEER_SUCCESS = 'CREATE_PEER_SUCCESS'; +const CREATE_PEER_FAILURE = 'CREATE_PEER_FAILURE'; + +// Action creators +const fetchPeersRequest = () => ({ type: FETCH_PEERS_REQUEST, loading: true }); +const fetchPeersSuccess = (peers) => ({ type: FETCH_PEERS_SUCCESS, payload: peers, loading: false }); +const fetchPeersFailure = (error) => ({ type: FETCH_PEERS_FAILURE, payload: error, loading: false }); + +const fetchPeerRequest = () => ({ type: FETCH_PEER_REQUEST, loading: true }); +const fetchPeerSuccess = (instance) => ({ type: FETCH_PEER_SUCCESS, payload: instance, loading: false }); +const fetchPeerFailure = (error) => ({ type: FETCH_PEER_FAILURE, payload: error, loading: false }); + +const createPeerRequest = (email) => ({ type: CREATE_PEER_REQUEST, payload: email }); +const createPeerSuccess = () => ({ type: CREATE_PEER_SUCCESS }); +const createPeerFailure = (error) => ({ type: CREATE_PEER_FAILURE, payload: error }); + +// Thunk action creator +const fetchPeers = () => { + return async (dispatch, getState) => { + dispatch(fetchPeersRequest()); + const { token } = getState().auth; + try { + const peers = await fetchPeersFromAPI(token); + dispatch(fetchPeersSuccess(peers)); + } catch (error) { + dispatch(fetchPeersFailure(error)); + } + }; +}; + +const fetchPeer = (id) => { + return async (dispatch, getState) => { + dispatch(fetchPeerRequest()); + const { token } = getState().auth; + try { + const instance = await fetchFromAPI(`/peers/${id}`, null, token); + dispatch(fetchPeerSuccess(instance)); + } catch (error) { + dispatch(fetchPeerFailure(error)); + } + }; +}; + +const createPeer = (peer) => { + return async (dispatch, getState) => { + dispatch(createPeerRequest(peer)); + const { token } = getState().auth; + try { + // call for the fetch that generates the token for password reset + const fetchPromise = fetch('/peers', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(peer), + }); + + const timeoutPromise = new Promise((_, reject) => { + setTimeout(() => { + reject(new Error('Could not create peer. Please try again.')); + }, 60000); + }); + + const response = await Promise.race([timeoutPromise, fetchPromise]); + if (!response.ok) { + const error = await response.json(); + throw new Error(error.message); + } + dispatch(createPeerSuccess()); + } catch (error) { + dispatch(createPeerFailure(error)); + } + }; +} + +module.exports = { + fetchPeer, + fetchPeers, + createPeer, + FETCH_PEER_REQUEST, + FETCH_PEER_SUCCESS, + FETCH_PEER_FAILURE, + FETCH_PEERS_REQUEST, + FETCH_PEERS_SUCCESS, + FETCH_PEERS_FAILURE, + CREATE_PEER_REQUEST, + CREATE_PEER_SUCCESS, + CREATE_PEER_FAILURE, +}; diff --git a/actions/sourceActions.js b/actions/sourceActions.js index f2487236..8435f328 100644 --- a/actions/sourceActions.js +++ b/actions/sourceActions.js @@ -1,10 +1,11 @@ 'use strict'; +const fetch = require('cross-fetch'); const { fetchFromAPI } = require('./apiActions'); async function fetchSourcesFromAPI (token) { // TODO: pagination - return fetchFromAPI('/tasks', null, token); + return fetchFromAPI('/sources', null, token); } // Action types @@ -22,16 +23,16 @@ const CREATE_SOURCE_FAILURE = 'CREATE_SOURCE_FAILURE'; // Action creators const fetchSourcesRequest = () => ({ type: FETCH_SOURCES_REQUEST, loading: true }); -const fetchSourcesSuccess = (users) => ({ type: FETCH_SOURCES_SUCCESS, payload: users, loading: false }); +const fetchSourcesSuccess = (sources) => ({ type: FETCH_SOURCES_SUCCESS, payload: sources, loading: false }); const fetchSourcesFailure = (error) => ({ type: FETCH_SOURCES_FAILURE, payload: error, loading: false }); -const fetchTaskRequest = () => ({ type: FETCH_SOURCE_REQUEST, loading: true }); -const fetchTaskSuccess = (instance) => ({ type: FETCH_SOURCE_SUCCESS, payload: instance, loading: false }); -const fetchTaskFailure = (error) => ({ type: FETCH_SOURCE_FAILURE, payload: error, loading: false }); +const fetchSourceRequest = () => ({ type: FETCH_SOURCE_REQUEST, loading: true }); +const fetchSourceSuccess = (instance) => ({ type: FETCH_SOURCE_SUCCESS, payload: instance, loading: false }); +const fetchSourceFailure = (error) => ({ type: FETCH_SOURCE_FAILURE, payload: error, loading: false }); -const createTaskRequest = (email) => ({ type: CREATE_SOURCE_REQUEST, payload: email }); -const createTaskSuccess = () => ({ type: CREATE_SOURCE_SUCCESS }); -const createTaskFailure = (error) => ({ type: CREATE_SOURCE_FAILURE, payload: error }); +const createSourceRequest = (email) => ({ type: CREATE_SOURCE_REQUEST, payload: email }); +const createSourceSuccess = () => ({ type: CREATE_SOURCE_SUCCESS }); +const createSourceFailure = (error) => ({ type: CREATE_SOURCE_FAILURE, payload: error }); // Thunk action creator const fetchSources = () => { @@ -39,44 +40,44 @@ const fetchSources = () => { dispatch(fetchSourcesRequest()); const { token } = getState().auth; try { - const users = await fetchSourcesFromAPI(token); - dispatch(fetchSourcesSuccess(users)); + const sources = await fetchSourcesFromAPI(token); + dispatch(fetchSourcesSuccess(sources)); } catch (error) { dispatch(fetchSourcesFailure(error)); } }; }; -const fetchTask = (id) => { +const fetchSource = (id) => { return async (dispatch, getState) => { - dispatch(fetchTaskRequest()); + dispatch(fetchSourceRequest()); const { token } = getState().auth; try { - const instance = await fetchFromAPI(`/tasks/${id}`, null, token); - dispatch(fetchTaskSuccess(instance)); + const instance = await fetchFromAPI(`/sources/${id}`, null, token); + dispatch(fetchSourceSuccess(instance)); } catch (error) { - dispatch(fetchTaskFailure(error)); + dispatch(fetchSourceFailure(error)); } }; }; -const createTask = (task) => { +const createSource = (source) => { return async (dispatch, getState) => { - dispatch(createTaskRequest(task)); + dispatch(createSourceRequest(source)); const { token } = getState().auth; try { // call for the fetch that generates the token for password reset - const fetchPromise = fetch('/tasks', { + const fetchPromise = fetch('/sources', { method: 'POST', headers: { 'Content-Type': 'application/json', }, - body: JSON.stringify({ task }), + body: JSON.stringify(source), }); const timeoutPromise = new Promise((_, reject) => { setTimeout(() => { - reject(new Error('Could not create task. Please try again.')); + reject(new Error('Could not create source. Please try again.')); }, 60000); }); @@ -85,18 +86,17 @@ const createTask = (task) => { const error = await response.json(); throw new Error(error.message); } - //task with reset token sent - dispatch(createTaskSuccess()); + dispatch(createSourceSuccess()); } catch (error) { - dispatch(createTaskFailure(error)); + dispatch(createSourceFailure(error)); } }; } module.exports = { - fetchTask, + fetchSource, fetchSources, - createTask, + createSource, FETCH_SOURCE_REQUEST, FETCH_SOURCE_SUCCESS, FETCH_SOURCE_FAILURE, diff --git a/assets/bundles/browser.min.js b/assets/bundles/browser.min.js index b91a49cb..ba359d9f 100644 --- a/assets/bundles/browser.min.js +++ b/assets/bundles/browser.min.js @@ -1,2 +1,2 @@ /*! For license information please see browser.min.js.LICENSE.txt */ -(()=>{var e,t,n={8901:e=>{"use strict";e.exports={PEER_PORT:7777,MAX_PEERS:32,PRECISION:100,BITCOIN_NETWORK:"mainnet",BITCOIN_GENESIS:"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",BITCOIN_GENESIS_ROOT:"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",FABRIC_KEY_DERIVATION_PATH:"m/44'/7777'/0'/0/0",FABRIC_USER_AGENT:"Fabric Core 0.1.0 (@fabric/core#v0.1.0-RC1)",FIXTURE_SEED:"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",FIXTURE_XPUB:"xpub661MyMwAqRbcF6GygV6Q6XAg8dqhPvDuhYHGniequi6HMbYhNNH5XC13Np3qRANHVD2mmnNGtMGBfDT69s2ovpHLr7q8syoAuyWqtRGEsYQ",FIXTURE_XPRV:"xprv9s21ZrQH143K2cCWaTZPjPDwac1CzTW4LKMfzLFEMNZJUoDYppxpyPgZXY7CZkjefGJTrTyqKnMrM4RG6nGn7Q9cwjHggCtn3CdFGJahaWY",HEADER_SIZE:176,GENERIC_MESSAGE_TYPE:15103,LOG_MESSAGE_TYPE:3235156080,GENERIC_LIST_TYPE:3235170158,LARGE_COLLECTION_SIZE:10,BLOCK_CANDIDATE:3,CHAT_MESSAGE:103,INPUT_HINT:'Press the "i" key to begin typing.',ZERO_LENGTH_PLAINTEXT:"",FABRIC_PLAYNET_ADDRESS:"",FABRIC_PLAYNET_ORIGIN:"",LIGHTNING_TEST_HEADER:"D0520C6E",LIGHTNING_PROTOCOL_H_INIT:"Noise_XK_secp256k1_ChaChaPoly_SHA256",LIGHTNING_PROTOCOL_PROLOGUE:"lightning",LIGHTNING_BMM_HEADER:"D0520C6E",LIGHTNING_SIDECHAIN_NUM:255,LIGHTNING_SIDEBLOCK_HASH:0,LIGHTNING_PARENT_SIDEBLOCK_HASH:1,HTTP_HEADER_CONTENT_TYPE:"application/json",MAGIC_BYTES:3235115837,MAX_FRAME_SIZE:32,MAX_MEMORY_ALLOC:1024,MAX_MESSAGE_SIZE:3920,MAX_STACK_HEIGHT:32,MAX_CHANNEL_VALUE:1e8,MAX_CHAT_MESSAGE_LENGTH:2048,MAX_TX_PER_BLOCK:4,MACHINE_MAX_MEMORY:4014080,OP_CYCLE:"00",OP_DONE:"ff",OP_0:"00",OP_36:"24",OP_CHECKSIG:"ac",OP_DUP:"76",OP_EQUAL:"87",OP_SHA256:"a8",OP_HASH160:"a9",OP_PUSHDATA1:"4c",OP_RETURN:"6a",OP_EQUALVERIFY:"88",OP_SEPARATOR:"ab",P2P_GENERIC:128,P2P_IDENT_REQUEST:1,P2P_IDENT_RESPONSE:17,P2P_CHAIN_SYNC_REQUEST:85,P2P_ROOT:0,P2P_PING:18,P2P_PONG:19,P2P_PORT:7777,P2P_START_CHAIN:33,P2P_INSTRUCTION:32,P2P_BASE_MESSAGE:49,P2P_STATE_ROOT:48,P2P_STATE_COMMITTMENT:50,P2P_STATE_CHANGE:51,P2P_STATE_REQUEST:41,P2P_TRANSACTION:57,P2P_CALL:66,P2P_SESSION_ACK:16896,P2P_MUSIG_START:16928,P2P_MUSIG_ACCEPT:16929,P2P_MUSIG_RECEIVE_COUNTER:16930,P2P_MUSIG_SEND_PROPOSAL:16931,P2P_MUSIG_REPLY_TO_PROPOSAL:16932,P2P_MUSIG_ACCEPT_PROPOSAL:16933,PEER_CANDIDATE:9,DOCUMENT_PUBLISH_TYPE:998,DOCUMENT_REQUEST_TYPE:999,SESSION_START:2,VERSION_NUMBER:1}},7435:e=>{e.exports=function(e={}){return Object.keys(e).sort().reduce(((t,n)=>(t[n]=e[n],t)),{})}},8217:e=>{"use strict";e.exports=function(e,t){return Array(Math.max(t-String(e).length+1,0)).join(0)+e}},195:(e,t,n)=>{"use strict";var r=n(8287).Buffer;const o=n(7007),i=n(4949),a=n(1095),s=n(8543),u=n(7435);class l extends o{constructor(e={}){super(e),this.settings={type:"Actor",status:"PAUSED"},this._state={type:this.settings.type,status:this.settings.status,content:this._readObject(e)},this.history=[];try{this.observer=i.observe(this._state.content,this._handleMonitorChanges.bind(this))}catch(e){console.error("UNABLE TO WATCH:",e)}return Object.defineProperty(this,"_events",{enumerable:!1}),Object.defineProperty(this,"_eventsCount",{enumerable:!1}),Object.defineProperty(this,"_maxListeners",{enumerable:!1}),Object.defineProperty(this,"_state",{enumerable:!1}),Object.defineProperty(this,"observer",{enumerable:!1}),this}static chunk(e,t=32){const n=[];for(var r=0;r{"use strict";var r=n(8287).Buffer;const{sha256:o}=n(2623);class i{constructor(e={}){"string"==typeof e&&(e={input:e}),e.input||("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues?e.input=window.crypto.getRandomValues(new Uint8Array(32)).join(""):e.input=n(1565).randomBytes(32).toString("hex"));const t=r.from(e.input,"utf8");return this.settings=Object.assign({hash:i.digest(t)},e),this}static compute(e){"string"==typeof e&&(e=r.from(e,"utf8"));const t=o(e);return r.from(t).toString("hex")}static digest(e){if("string"!=typeof e&&!(e instanceof r))throw new Error('Input to process must be of type "String" or "Buffer" to digest.');return i.compute(e)}get hash(){return this.value}get value(){return i.digest(this.settings.input)}static reverse(e=""){return r.from(e,"hex").reverse().toString("hex")}static async hash(e){const t=(new TextEncoder).encode(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map((e=>e.toString(16).padStart(2,"0"))).join("")}reverse(e=this.value){return i.reverse(e)}}e.exports=i},5673:(e,t,n)=>{"use strict";var r=n(8287).Buffer;const{MAGIC_BYTES:o,VERSION_NUMBER:i,HEADER_SIZE:a,MAX_MESSAGE_SIZE:s,OP_CYCLE:u,GENERIC_MESSAGE_TYPE:l,LOG_MESSAGE_TYPE:c,GENERIC_LIST_TYPE:f,P2P_GENERIC:h,P2P_IDENT_REQUEST:d,P2P_IDENT_RESPONSE:p,P2P_ROOT:m,P2P_PING:y,P2P_PONG:v,P2P_START_CHAIN:g,P2P_INSTRUCTION:b,P2P_BASE_MESSAGE:w,P2P_CHAIN_SYNC_REQUEST:E,P2P_STATE_ROOT:S,P2P_STATE_COMMITTMENT:_,P2P_STATE_CHANGE:x,P2P_STATE_REQUEST:k,P2P_TRANSACTION:M,P2P_CALL:C,CHAT_MESSAGE:O,DOCUMENT_PUBLISH_TYPE:T,DOCUMENT_REQUEST_TYPE:A,BLOCK_CANDIDATE:P,PEER_CANDIDATE:L,SESSION_START:D}=n(8901),j=n(4888),N=n(195),I=n(8543),R=n(8217);class F extends N{constructor(e={}){super(e),this.raw={magic:r.alloc(4),version:r.alloc(4),parent:r.alloc(32),author:r.alloc(32),type:r.alloc(4),size:r.alloc(4),hash:r.alloc(32),signature:r.alloc(64),data:null},this.raw.magic.write(o.toString(16),"hex"),this.raw.version.write(R(i.toString(16),8),"hex"),e.signer?this.signer=e.signer:this.signer=null,e.data&&e.type&&(this.type=e.type,"string"!=typeof e.data?this.data=JSON.stringify(e.data):this.data=e.data);for(let e of["@input","@entity","_state","config","settings","signer","stack","observer"])Object.defineProperty(this,e,{enumerable:!1});return this}get body(){return this.raw.data.toString("utf8")}get byte(){return r.from(`0x${R("0",8)}`,"hex")}get tu16(){return parseInt(0)}get tu32(){return parseInt(0)}get tu64(){return parseInt(0)}get Uint256(){return r.from(this.raw&&this.raw.hash?`0x${R(this.raw.hash,8)}`:N.randomBytes(32))}set signature(e){e instanceof r&&(e=e.toString("hex")),this.raw.signature.write(e,"hex")}toBuffer(){return this.asRaw()}asRaw(){return r.concat([this.header,this.raw.data])}toRaw(){return this.asRaw()}asTypedArray(){return new Uint8Array(this.asRaw())}asBlob(){return this.asRaw().map((e=>parseInt(e,16)))}toObject(){return{headers:{magic:parseInt(`${this.raw.magic.toString("hex")}`,16),version:parseInt(`${this.raw.version.toString("hex")}`,16),parent:this.raw.parent.toString("hex"),author:this.raw.author.toString("hex"),type:parseInt(`${this.raw.type.toString("hex")}`,16),size:parseInt(`${this.raw.size.toString("hex")}`,16),hash:this.raw.hash.toString("hex"),signature:this.raw.signature.toString("hex")},type:this.type,data:this.data}}fromObject(e){return new F(e)}sign(){if(!this.header)throw new Error("No header property.");if(!this.raw)throw new Error("No raw property.");const e=I.digest(this.raw.data),t=this.signer.sign(r.from(e,"hex"));return this.raw.author.write(this.signer.pubkey.toString("hex"),"hex"),this.raw.signature.write(t.toString("hex"),"hex"),Object.freeze(this),this}verify(){if(!this.header)throw new Error("No header property.");if(!this.raw)throw new Error("No raw property.");const e=I.digest(this.raw.data);if(this.raw.hash.toString("hex")!==e.toString("hex"))return!1;const t=this.raw.signature;if(!this.signer.verify(this.raw.author,e,t))throw new Error("Did not verify.");return!0}_setSigner(e){return this.signer=e,this}static parseBuffer(e){const t=j().charsnt("magic",4,"hex").charsnt("version",4,"hex").charsnt("parent",32,"hex").charsnt("type",4,"hex").charsnt("size",4,"hex").charsnt("hash",32,"hex").charsnt("signature",64,"hex").charsnt("data",e.length-a);return t.allocate(),t._setBuff(e),t}static parseRawMessage(e){const t={magic:e.slice(0,4),version:e.slice(4,8),parent:e.slice(8,40),author:e.slice(40,72),type:e.slice(72,76),size:e.slice(76,80),hash:e.slice(80,112),signature:e.slice(112,a)};return e.length>=a&&(t.data=e.slice(a,e.length)),t}static fromBuffer(e){return F.fromRaw(e)}static fromRaw(e){if(!e)return null;if(!(e instanceof r))throw new Error("Input must be a buffer.");const t=new F;return t.raw={magic:e.slice(0,4),version:e.slice(4,8),parent:e.slice(8,40),author:e.slice(40,72),type:e.slice(72,76),size:e.slice(76,80),hash:e.slice(80,112),signature:e.slice(112,a)},t.data=e.slice(a),t}static fromVector(e=["LogMessage","No vector provided."]){let t=null;try{t=new F({type:e[0],data:e[1]})}catch(e){console.error("[FABRIC:MESSAGE]","Could not construct Message:",e)}return t}get id(){return I.digest(this.asRaw())}get types(){return{GenericMessage:l,GenericLogMessage:c,GenericList:f,GenericQueue:f,FabricLogMessage:c,FabricServiceLogMessage:c,GenericTransferQueue:f,Generic:h,Cycle:u,IdentityRequest:d,IdentityResponse:p,ChainSyncRequest:E,Ping:y,Pong:v,DocumentRequest:A,DocumentPublish:T,BlockCandidate:P,PeerCandidate:L,PeerInstruction:b,PeerMessage:w,StartSession:D,ChatMessage:O,StartChain:g,StateRoot:S,StateCommitment:_,StateChange:x,StateRequest:k,Transaction:M,Call:C,LogMessage:c}}get codes(){return Object.entries(this.types).reduce(((e,t)=>{const[n,r]=t;return e[r]=n,e}),{})}get magic(){return this.raw.magic}get signature(){return parseInt(r.from(this.raw.signature,"hex"))}get size(){return parseInt(r.from(this.raw.size,"hex"))}get version(){return parseInt(r.from(this.raw.version))}get header(){const e=[r.from(this.raw.magic,"hex"),r.from(this.raw.version,"hex"),r.from(this.raw.parent,"hex"),r.from(this.raw.author,"hex"),r.from(this.raw.type,"hex"),r.from(this.raw.size,"hex"),r.from(this.raw.hash,"hex"),r.from(this.raw.signature,"hex")];return r.concat(e)}}Object.defineProperty(F.prototype,"type",{get(){switch(parseInt(this.raw.type.toString("hex"),16)){case l:return"GenericMessage";case c:return"GenericLogMessage";case f:return"GenericList";case T:return"DocumentPublish";case A:return"DocumentRequest";case P:return"BlockCandidate";case u:return"Cycle";case y:return"Ping";case v:return"Pong";case h:return"Generic";case E:return"ChainSyncRequest";case d:return"IdentityRequest";case p:return"IdentityResponse";case w:return"PeerMessage";case S:return"StateRoot";case x:return"StateChange";case k:return"StateRequest";case M:return"Transaction";case C:return"Call";case L:return"PeerCandidate";case D:return"StartSession";case O:return"ChatMessage";case g:return"StartChain";default:return"GenericMessage"}},set(e){let t=this.types[e];t||(this.emit("warning",`Unknown message type: ${e}`),t=this.types.GenericMessage);const n=R(t.toString(16),8);this["@type"]=e,this.raw.type.write(n,"hex")}}),Object.defineProperty(F.prototype,"data",{get(){return this.raw.data?this.raw.data.toString("utf8"):""},set(e){e||(e=""),this.raw.hash=I.digest(e.toString("utf8")),this.raw.data=r.from(e),this.raw.size.write(R(this.raw.data.byteLength.toString(16),8),"hex")}}),e.exports=F},2019:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,p=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),m=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope");function y(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case f:case i:case s:case a:case d:return e;default:switch(e=e&&e.$$typeof){case l:case h:case m:case p:case u:return e;default:return t}}case o:return t}}}t.isForwardRef=function(e){return y(e)===h}},9607:(e,t,n)=>{"use strict";e.exports=n(2019)},7557:(e,t)=>{"use strict";function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function r(e,...t){if(!((n=e)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name))throw new Error("Uint8Array expected");var n;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)}function i(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function a(e,t){r(e);const n=t.outputLen;if(e.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HashMD=t.Maj=t.Chi=void 0;const r=n(7557),o=n(9175);t.Chi=(e,t,n)=>e&t^~e&n,t.Maj=(e,t,n)=>e&t^e&n^t&n;class i extends o.Hash{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,o.createView)(this.buffer)}update(e){(0,r.aexists)(this);const{view:t,buffer:n,blockLen:i}=this,a=(e=(0,o.toBytes)(e)).length;for(let r=0;ri-s&&(this.process(n,0),s=0);for(let e=s;e>o&i),s=Number(n&i),u=r?4:0,l=r?0:4;e.setUint32(t+u,a,r),e.setUint32(t+l,s,r)}(n,i-8,BigInt(8*this.length),a),this.process(n,0);const u=(0,o.createView)(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=l/4,f=this.get();if(c>f.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},2623:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=t.SHA256=void 0;const r=n(7202),o=n(9175),i=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint32Array(64);class u extends r.HashMD{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:i,G:a,H:s}=this;return[e,t,n,r,o,i,a,s]}set(e,t,n,r,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)s[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=s[e-15],n=s[e-2],r=(0,o.rotr)(t,7)^(0,o.rotr)(t,18)^t>>>3,i=(0,o.rotr)(n,17)^(0,o.rotr)(n,19)^n>>>10;s[e]=i+s[e-7]+r+s[e-16]|0}let{A:n,B:a,C:u,D:l,E:c,F:f,G:h,H:d}=this;for(let e=0;e<64;e++){const t=d+((0,o.rotr)(c,6)^(0,o.rotr)(c,11)^(0,o.rotr)(c,25))+(0,r.Chi)(c,f,h)+i[e]+s[e]|0,p=((0,o.rotr)(n,2)^(0,o.rotr)(n,13)^(0,o.rotr)(n,22))+(0,r.Maj)(n,a,u)|0;d=h,h=f,f=c,c=l+t|0,l=u,u=a,a=n,n=t+p|0}n=n+this.A|0,a=a+this.B|0,u=u+this.C|0,l=l+this.D|0,c=c+this.E|0,f=f+this.F|0,h=h+this.G|0,d=d+this.H|0,this.set(n,a,u,l,c,f,h,d)}roundClean(){s.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.SHA256=u;class l extends u{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,o.wrapConstructor)((()=>new u)),t.sha224=(0,o.wrapConstructor)((()=>new l))},9175:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=void 0,t.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},t.byteSwap32=function(e){for(let n=0;n=0&&ee().update(l(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(l(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(l(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(r.crypto&&"function"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(e));if(r.crypto&&"function"==typeof r.crypto.randomBytes)return r.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const r=n(5145),o=n(7557);t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.rotl=(e,t)=>e<>>32-t>>>0,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,t.byteSwapIfBE=t.isLE?e=>e:e=>(0,t.byteSwap)(e);const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0"))),a={_0:48,_9:57,A:65,F:70,a:97,f:102};function s(e){return e>=a._0&&e<=a._9?e-a._0:e>=a.A&&e<=a.F?e-(a.A-10):e>=a.a&&e<=a.f?e-(a.a-10):void 0}function u(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function l(e){return"string"==typeof e&&(e=u(e)),(0,o.abytes)(e),e}t.nextTick=async()=>{},t.Hash=class{clone(){return this._cloneInto()}}},2027:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(411);n(5556);var o=n(6540);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n=0;r-=1)this.handlers[r].called||(this.handlers[r].called=!0,this.handlers[r](e));for(var o=n;o>=0;o-=1)this.handlers[o].called=!1}else(0,this.handlers[n])(e)}},{key:"hasHandlers",value:function(){return this.handlers.length>0}},{key:"removeHandlers",value:function(t){for(var n=[],r=this.handlers.length,o=0;o0;var t=this.handlerSets.get(e);return!!t&&t.hasHandlers()}},{key:"removeHandlers",value:function(t,n){var r=d(this.handlerSets);if(!r.has(t))return new e(this.poolName,r);var o=r.get(t).removeHandlers(n);return o.hasHandlers()?r.set(t,o):r.delete(t),new e(this.poolName,r)}}]),e}();l(y,"createByType",(function(e,t,n){var r=new Map;return r.set(t,new h(n)),new y(e,r)}));var v=function(){function e(t){var n=this;a(this,e),l(this,"handlers",new Map),l(this,"pools",new Map),l(this,"target",void 0),l(this,"createEmitter",(function(e){return function(t){n.pools.forEach((function(n){n.dispatchEvent(e,t)}))}})),this.target=t}return u(e,[{key:"addHandlers",value:function(e,t,n){if(this.pools.has(e)){var r=this.pools.get(e);this.pools.set(e,r.addHandlers(t,n))}else this.pools.set(e,y.createByType(e,t,n));this.handlers.has(t)||this.addTargetHandler(t)}},{key:"hasHandlers",value:function(){return this.handlers.size>0}},{key:"removeHandlers",value:function(e,t,n){if(this.pools.has(e)){var r=this.pools.get(e).removeHandlers(t,n);r.hasHandlers()?this.pools.set(e,r):this.pools.delete(e);var o=!1;this.pools.forEach((function(e){return o=o||e.hasHandlers(t)})),o||this.removeTargetHandler(t)}}},{key:"addTargetHandler",value:function(e){var t=this.createEmitter(e);this.handlers.set(e,t),this.target.addEventListener(e,t,!0)}},{key:"removeTargetHandler",value:function(e){this.handlers.has(e)&&(this.target.removeEventListener(e,this.handlers.get(e),!0),this.handlers.delete(e))}}]),e}(),g=new(function(){function e(){var t=this;a(this,e),l(this,"targets",new Map),l(this,"getTarget",(function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=m(e);if(t.targets.has(r))return t.targets.get(r);if(!n)return null;var o=new v(r);return t.targets.set(r,o),o})),l(this,"removeTarget",(function(e){t.targets.delete(m(e))}))}return u(e,[{key:"sub",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(r.canUseDOM){var o=n.target,i=void 0===o?document:o,a=n.pool,s=void 0===a?"default":a;this.getTarget(i).addHandlers(s,e,p(t))}}},{key:"unsub",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(r.canUseDOM){var o=n.target,i=void 0===o?document:o,a=n.pool,s=void 0===a?"default":a,u=this.getTarget(i,!1);u&&(u.removeHandlers(s,e,p(t)),u.hasHandlers()||this.removeTarget(i))}}}]),e}()),b=function(){function e(){return a(this,e),function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,c(e).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(e,o.PureComponent),u(e,[{key:"componentDidMount",value:function(){this.subscribe(this.props)}},{key:"componentDidUpdate",value:function(e){this.unsubscribe(e),this.subscribe(this.props)}},{key:"componentWillUnmount",value:function(){this.unsubscribe(this.props)}},{key:"subscribe",value:function(e){var t=e.name,n=e.on,r=e.pool,o=e.target;g.sub(t,n,{pool:r,target:o})}},{key:"unsubscribe",value:function(e){var t=e.name,n=e.on,r=e.pool,o=e.target;g.unsub(t,n,{pool:r,target:o})}},{key:"render",value:function(){return null}}]),e}();l(b,"defaultProps",{pool:"default",target:"document"}),b.propTypes={},t.instance=g,t.default=b},8796:(e,t,n)=>{"use strict";var r;r=n(2027),e.exports=r.default,e.exports.instance=r.instance},7568:(e,t,n)=>{var r=t;r.bignum=n(2344),r.define=n(7363).define,r.base=n(9673),r.constants=n(2153),r.decoders=n(2853),r.encoders=n(4669)},7363:(e,t,n)=>{var r=n(7568),o=n(6698);function i(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new i(e,t)},i.prototype._createNamed=function(e){var t;try{t=Object(function(){var e=new Error("Cannot find module 'vm'");throw e.code="MODULE_NOT_FOUND",e}())("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return o(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},i.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(r.decoders[e])),this.decoders[e]},i.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)},i.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(r.encoders[e])),this.encoders[e]},i.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}},7227:(e,t,n)=>{var r=n(6698),o=n(9673).Reporter,i=n(8287).Buffer;function a(e,t){o.call(this,t),i.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function s(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return e instanceof s||(e=new s(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=i.byteLength(e);else{if(!i.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}r(a,o),t.t=a,a.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},a.prototype.restore=function(e){var t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,o.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var n=new a(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.d=s,s.prototype.join=function(e,t){return e||(e=new i(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(n){n.join(e,t),t+=n.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):i.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},9673:(e,t,n)=>{var r=t;r.Reporter=n(9220).a,r.DecoderBuffer=n(7227).t,r.EncoderBuffer=n(7227).d,r.Node=n(993)},993:(e,t,n)=>{var r=n(9673).Reporter,o=n(9673).EncoderBuffer,i=n(9673).DecoderBuffer,a=n(3349),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function l(e,t){var n={};this._baseState=n,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=l;var c=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){var e=this._baseState,t={};c.forEach((function(n){t[n]=e[n]}));var n=new this.constructor(t.parent);return n._baseState=t,n},l.prototype._wrap=function(){var e=this._baseState;u.forEach((function(t){this[t]=function(){var n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}}),this)},l.prototype._init=function(e){var t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),a.equal(t.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(e){var t=this._baseState,n=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==n.length&&(a(null===t.children),t.children=n,n.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach((function(n){n==(0|n)&&(n|=0);var r=e[n];t[r]=n})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){l.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),s.forEach((function(e){l.prototype[e]=function(){var t=this._baseState,n=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(n),this}})),l.prototype.use=function(e){a(e);var t=this._baseState;return a(null===t.use),t.use=e,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(e){var t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},l.prototype.explicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},l.prototype.implicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},l.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},l.prototype.key=function(e){var t=this._baseState;return a(null===t.key),t.key=e,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(e){var t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},l.prototype.contains=function(e){var t=this._baseState;return a(null===t.use),t.contains=e,this},l.prototype._decode=function(e,t){var n=this._baseState;if(null===n.parent)return e.wrapResult(n.children[0]._decode(e,t));var r,o=n.default,a=!0,s=null;if(null!==n.key&&(s=e.enterKey(n.key)),n.optional){var u=null;if(null!==n.explicit?u=n.explicit:null!==n.implicit?u=n.implicit:null!==n.tag&&(u=n.tag),null!==u||n.any){if(a=this._peekTag(e,u,n.any),e.isError(a))return a}else{var l=e.save();try{null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),a=!0}catch(e){a=!1}e.restore(l)}}if(n.obj&&a&&(r=e.enterObject()),a){if(null!==n.explicit){var c=this._decodeTag(e,n.explicit);if(e.isError(c))return c;e=c}var f=e.offset;if(null===n.use&&null===n.choice){n.any&&(l=e.save());var h=this._decodeTag(e,null!==n.implicit?n.implicit:n.tag,n.any);if(e.isError(h))return h;n.any?o=e.raw(l):e=h}if(t&&t.track&&null!==n.tag&&t.track(e.path(),f,e.length,"tagged"),t&&t.track&&null!==n.tag&&t.track(e.path(),e.offset,e.length,"content"),n.any||(o=null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t)),e.isError(o))return o;if(n.any||null!==n.choice||null===n.children||n.children.forEach((function(n){n._decode(e,t)})),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){var d=new i(o);o=this._getUse(n.contains,e._reporterState.obj)._decode(d,t)}}return n.obj&&a&&(o=e.leaveObject(r)),null===n.key||null===o&&!0!==a?null!==s&&e.exitKey(s):e.leaveKey(s,n.key,o),o},l.prototype._decodeGeneric=function(e,t,n){var r=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):"objid"===e&&r.args?this._decodeObjid(t,r.args[0],r.args[1],n):"objid"===e?this._decodeObjid(t,null,null,n):"gentime"===e||"utctime"===e?this._decodeTime(t,e,n):"null_"===e?this._decodeNull(t,n):"bool"===e?this._decodeBool(t,n):"objDesc"===e?this._decodeStr(t,e,n):"int"===e||"enum"===e?this._decodeInt(t,r.args&&r.args[0],n):null!==r.use?this._getUse(r.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)},l.prototype._getUse=function(e,t){var n=this._baseState;return n.useDecoder=this._use(e,t),a(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},l.prototype._decodeChoice=function(e,t){var n=this._baseState,r=null,o=!1;return Object.keys(n.choice).some((function(i){var a=e.save(),s=n.choice[i];try{var u=s._decode(e,t);if(e.isError(u))return!1;r={type:i,value:u},o=!0}catch(t){return e.restore(a),!1}return!0}),this),o?r:e.error("Choice not matched")},l.prototype._createEncoderBuffer=function(e){return new o(e,this.reporter)},l.prototype._encode=function(e,t,n){var r=this._baseState;if(null===r.default||r.default!==e){var o=this._encodeValue(e,t,n);if(void 0!==o&&!this._skipDefault(o,t,n))return o}},l.prototype._encodeValue=function(e,t,n){var o=this._baseState;if(null===o.parent)return o.children[0]._encode(e,t||new r);var i=null;if(this.reporter=t,o.optional&&void 0===e){if(null===o.default)return;e=o.default}var a=null,s=!1;if(o.any)i=this._createEncoderBuffer(e);else if(o.choice)i=this._encodeChoice(e,t);else if(o.contains)a=this._getUse(o.contains,n)._encode(e,t),s=!0;else if(o.children)a=o.children.map((function(n){if("null_"===n._baseState.tag)return n._encode(null,t,e);if(null===n._baseState.key)return t.error("Child should have a key");var r=t.enterKey(n._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");var o=n._encode(e[n._baseState.key],t,e);return t.leaveKey(r),o}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===o.tag||"setof"===o.tag){if(!o.args||1!==o.args.length)return t.error("Too many args for : "+o.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(n){var r=this._baseState;return this._getUse(r.args[0],e)._encode(n,t)}),u))}else null!==o.use?i=this._getUse(o.use,n)._encode(e,t):(a=this._encodePrimitive(o.tag,e),s=!0);if(!o.any&&null===o.choice){var l=null!==o.implicit?o.implicit:o.tag,c=null===o.implicit?"universal":"context";null===l?null===o.use&&t.error("Tag could be omitted only for .use()"):null===o.use&&(i=this._encodeComposite(l,s,c,a))}return null!==o.explicit&&(i=this._encodeComposite(o.explicit,!1,"context",i)),i},l.prototype._encodeChoice=function(e,t){var n=this._baseState,r=n.choice[e.type];return r||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)},l.prototype._encodePrimitive=function(e,t){var n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},l.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},l.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},9220:(e,t,n)=>{var r=n(6698);function o(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function i(e,t){this.path=e,this.rethrow(t)}t.a=o,o.prototype.isError=function(e){return e instanceof i},o.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},o.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},o.prototype.enterKey=function(e){return this._reporterState.path.push(e)},o.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},o.prototype.leaveKey=function(e,t,n){var r=this._reporterState;this.exitKey(e),null!==r.obj&&(r.obj[t]=n)},o.prototype.path=function(){return this._reporterState.path.join("/")},o.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},o.prototype.leaveObject=function(e){var t=this._reporterState,n=t.obj;return t.obj=e,n},o.prototype.error=function(e){var t,n=this._reporterState,r=e instanceof i;if(t=r?e:new i(n.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!n.options.partial)throw t;return r||n.errors.push(t),t},o.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},r(i,Error),i.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,i),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},4598:(e,t,n)=>{var r=n(2153);t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=r._reverse(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=r._reverse(t.tag)},2153:(e,t,n)=>{var r=t;r._reverse=function(e){var t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);var r=e[n];t[r]=n})),t},r.der=n(4598)},2010:(e,t,n)=>{var r=n(6698),o=n(7568),i=o.base,a=o.bignum,s=o.constants.der;function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){i.Node.call(this,"der",e)}function c(e,t){var n=e.readUInt8(t);if(e.isError(n))return n;var r=s.tagClass[n>>6],o=!(32&n);if(31&~n)n&=31;else{var i=n;for(n=0;!(128&~i);){if(i=e.readUInt8(t),e.isError(i))return i;n<<=7,n|=127&i}}return{cls:r,primitive:o,tag:n,tagStr:s.tag[n]}}function f(e,t,n){var r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&128===r)return null;if(!(128&r))return r;var o=127&r;if(o>4)return e.error("length octect is too long");r=0;for(var i=0;i{var r=t;r.der=n(2010),r.pem=n(8903)},8903:(e,t,n)=>{var r=n(6698),o=n(8287).Buffer,i=n(2010);function a(e){i.call(this,e),this.enc="pem"}r(a,i),e.exports=a,a.prototype.decode=function(e,t){for(var n=e.toString().split(/[\r\n]+/g),r=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,u=-1,l=0;l{var r=n(6698),o=n(8287).Buffer,i=n(7568),a=i.base,s=i.constants.der;function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){a.Node.call(this,"der",e)}function c(e){return e<10?"0"+e:e}e.exports=u,u.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},r(l,a.Node),l.prototype._encodeComposite=function(e,t,n,r){var i,a=function(e,t,n,r){var o;if("seqof"===e?e="seq":"setof"===e&&(e="set"),s.tagByName.hasOwnProperty(e))o=s.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return r.error("Unknown tag: "+e);o=e}return o>=31?r.error("Multi-octet tag encoding unsupported"):(t||(o|=32),o|=s.tagClassByName[n||"universal"]<<6)}(e,t,n,this.reporter);if(r.length<128)return(i=new o(2))[0]=a,i[1]=r.length,this._createEncoderBuffer([i,r]);for(var u=1,l=r.length;l>=256;l>>=8)u++;(i=new o(2+u))[0]=a,i[1]=128|u,l=1+u;for(var c=r.length;c>0;l--,c>>=8)i[l]=255&c;return this._createEncoderBuffer([i,r])},l.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var n=new o(2*e.length),r=0;r=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var i=0;for(r=0;r=128;a>>=7)i++}var s=new o(i),u=s.length-1;for(r=e.length-1;r>=0;r--)for(a=e[r],s[u--]=127&a;(a>>=7)>0;)s[u--]=128|127&a;return this._createEncoderBuffer(s)},l.prototype._encodeTime=function(e,t){var n,r=new Date(e);return"gentime"===t?n=[c(r.getFullYear()),c(r.getUTCMonth()+1),c(r.getUTCDate()),c(r.getUTCHours()),c(r.getUTCMinutes()),c(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[c(r.getFullYear()%100),c(r.getUTCMonth()+1),c(r.getUTCDate()),c(r.getUTCHours()),c(r.getUTCMinutes()),c(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},l.prototype._encodeNull=function(){return this._createEncoderBuffer("")},l.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!o.isBuffer(e)){var n=e.toArray();!e.sign&&128&n[0]&&n.unshift(0),e=new o(n)}if(o.isBuffer(e)){var r=e.length;0===e.length&&r++;var i=new o(r);return e.copy(i),0===e.length&&(i[0]=0),this._createEncoderBuffer(i)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);r=1;for(var a=e;a>=256;a>>=8)r++;for(a=(i=new Array(r)).length-1;a>=0;a--)i[a]=255&e,e>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(new o(i))},l.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},l.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},l.prototype._skipDefault=function(e,t,n){var r,o=this._baseState;if(null===o.default)return!1;var i=e.join();if(void 0===o.defaultBuffer&&(o.defaultBuffer=this._encodeValue(o.default,t,n).join()),i.length!==o.defaultBuffer.length)return!1;for(r=0;r{var r=t;r.der=n(82),r.pem=n(735)},735:(e,t,n)=>{var r=n(6698),o=n(82);function i(e){o.call(this,e),this.enc="pem"}r(i,o),e.exports=i,i.prototype.encode=function(e,t){for(var n=o.prototype.encode.call(this,e).toString("base64"),r=["-----BEGIN "+t.label+"-----"],i=0;i=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,n,r){for(var o=0,i=Math.min(e.length,n),a=t;a=49?s-49+10:s>=17?s-17+10:s}return o}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=u(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,u=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var l=1;l>>26,f=67108863&u,h=Math.min(l,t.length-1),d=Math.max(0,l-e.length+1);d<=h;d++){var p=l-d|0;c+=(a=(o=0|e.words[p])*(i=0|t.words[d])+f)/67108864|0,f=67108863&a}n.words[l]=0|f,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),n=0!==i||a!==this.length-1?c[6-u.length]+u+n:u+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],d=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?m+n:c[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,l=new e(i),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),l[s]=a;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 8191&t||(n+=13,t>>>=13),127&t||(n+=7,t>>>=7),15&t||(n+=4,t>>>=4),3&t||(n+=2,t>>>=2),1&t||n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,y=0|a[2],v=8191&y,g=y>>>13,b=0|a[3],w=8191&b,E=b>>>13,S=0|a[4],_=8191&S,x=S>>>13,k=0|a[5],M=8191&k,C=k>>>13,O=0|a[6],T=8191&O,A=O>>>13,P=0|a[7],L=8191&P,D=P>>>13,j=0|a[8],N=8191&j,I=j>>>13,R=0|a[9],F=8191&R,U=R>>>13,B=0|s[0],H=8191&B,z=B>>>13,q=0|s[1],G=8191&q,V=q>>>13,W=0|s[2],K=8191&W,$=W>>>13,Q=0|s[3],Y=8191&Q,Z=Q>>>13,J=0|s[4],X=8191&J,ee=J>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],fe=8191&ce,he=ce>>>13,de=0|s[9],pe=8191&de,me=de>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(l+(r=Math.imul(f,H))|0)+((8191&(o=(o=Math.imul(f,z))+Math.imul(h,H)|0))<<13)|0;l=((i=Math.imul(h,z))+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(p,H),o=(o=Math.imul(p,z))+Math.imul(m,H)|0,i=Math.imul(m,z);var ve=(l+(r=r+Math.imul(f,G)|0)|0)+((8191&(o=(o=o+Math.imul(f,V)|0)+Math.imul(h,G)|0))<<13)|0;l=((i=i+Math.imul(h,V)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,H),o=(o=Math.imul(v,z))+Math.imul(g,H)|0,i=Math.imul(g,z),r=r+Math.imul(p,G)|0,o=(o=o+Math.imul(p,V)|0)+Math.imul(m,G)|0,i=i+Math.imul(m,V)|0;var ge=(l+(r=r+Math.imul(f,K)|0)|0)+((8191&(o=(o=o+Math.imul(f,$)|0)+Math.imul(h,K)|0))<<13)|0;l=((i=i+Math.imul(h,$)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(w,H),o=(o=Math.imul(w,z))+Math.imul(E,H)|0,i=Math.imul(E,z),r=r+Math.imul(v,G)|0,o=(o=o+Math.imul(v,V)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,V)|0,r=r+Math.imul(p,K)|0,o=(o=o+Math.imul(p,$)|0)+Math.imul(m,K)|0,i=i+Math.imul(m,$)|0;var be=(l+(r=r+Math.imul(f,Y)|0)|0)+((8191&(o=(o=o+Math.imul(f,Z)|0)+Math.imul(h,Y)|0))<<13)|0;l=((i=i+Math.imul(h,Z)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(_,H),o=(o=Math.imul(_,z))+Math.imul(x,H)|0,i=Math.imul(x,z),r=r+Math.imul(w,G)|0,o=(o=o+Math.imul(w,V)|0)+Math.imul(E,G)|0,i=i+Math.imul(E,V)|0,r=r+Math.imul(v,K)|0,o=(o=o+Math.imul(v,$)|0)+Math.imul(g,K)|0,i=i+Math.imul(g,$)|0,r=r+Math.imul(p,Y)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(m,Y)|0,i=i+Math.imul(m,Z)|0;var we=(l+(r=r+Math.imul(f,X)|0)|0)+((8191&(o=(o=o+Math.imul(f,ee)|0)+Math.imul(h,X)|0))<<13)|0;l=((i=i+Math.imul(h,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(M,H),o=(o=Math.imul(M,z))+Math.imul(C,H)|0,i=Math.imul(C,z),r=r+Math.imul(_,G)|0,o=(o=o+Math.imul(_,V)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,V)|0,r=r+Math.imul(w,K)|0,o=(o=o+Math.imul(w,$)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,$)|0,r=r+Math.imul(v,Y)|0,o=(o=o+Math.imul(v,Z)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(p,X)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,ee)|0;var Ee=(l+(r=r+Math.imul(f,ne)|0)|0)+((8191&(o=(o=o+Math.imul(f,re)|0)+Math.imul(h,ne)|0))<<13)|0;l=((i=i+Math.imul(h,re)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(T,H),o=(o=Math.imul(T,z))+Math.imul(A,H)|0,i=Math.imul(A,z),r=r+Math.imul(M,G)|0,o=(o=o+Math.imul(M,V)|0)+Math.imul(C,G)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(_,K)|0,o=(o=o+Math.imul(_,$)|0)+Math.imul(x,K)|0,i=i+Math.imul(x,$)|0,r=r+Math.imul(w,Y)|0,o=(o=o+Math.imul(w,Z)|0)+Math.imul(E,Y)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(v,X)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(g,X)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(m,ne)|0,i=i+Math.imul(m,re)|0;var Se=(l+(r=r+Math.imul(f,ie)|0)|0)+((8191&(o=(o=o+Math.imul(f,ae)|0)+Math.imul(h,ie)|0))<<13)|0;l=((i=i+Math.imul(h,ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,H),o=(o=Math.imul(L,z))+Math.imul(D,H)|0,i=Math.imul(D,z),r=r+Math.imul(T,G)|0,o=(o=o+Math.imul(T,V)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,V)|0,r=r+Math.imul(M,K)|0,o=(o=o+Math.imul(M,$)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,$)|0,r=r+Math.imul(_,Y)|0,o=(o=o+Math.imul(_,Z)|0)+Math.imul(x,Y)|0,i=i+Math.imul(x,Z)|0,r=r+Math.imul(w,X)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(E,X)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(v,ne)|0,o=(o=o+Math.imul(v,re)|0)+Math.imul(g,ne)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0;var _e=(l+(r=r+Math.imul(f,ue)|0)|0)+((8191&(o=(o=o+Math.imul(f,le)|0)+Math.imul(h,ue)|0))<<13)|0;l=((i=i+Math.imul(h,le)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,H),o=(o=Math.imul(N,z))+Math.imul(I,H)|0,i=Math.imul(I,z),r=r+Math.imul(L,G)|0,o=(o=o+Math.imul(L,V)|0)+Math.imul(D,G)|0,i=i+Math.imul(D,V)|0,r=r+Math.imul(T,K)|0,o=(o=o+Math.imul(T,$)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,$)|0,r=r+Math.imul(M,Y)|0,o=(o=o+Math.imul(M,Z)|0)+Math.imul(C,Y)|0,i=i+Math.imul(C,Z)|0,r=r+Math.imul(_,X)|0,o=(o=o+Math.imul(_,ee)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,ee)|0,r=r+Math.imul(w,ne)|0,o=(o=o+Math.imul(w,re)|0)+Math.imul(E,ne)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(v,ie)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,ae)|0,r=r+Math.imul(p,ue)|0,o=(o=o+Math.imul(p,le)|0)+Math.imul(m,ue)|0,i=i+Math.imul(m,le)|0;var xe=(l+(r=r+Math.imul(f,fe)|0)|0)+((8191&(o=(o=o+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;l=((i=i+Math.imul(h,he)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(F,H),o=(o=Math.imul(F,z))+Math.imul(U,H)|0,i=Math.imul(U,z),r=r+Math.imul(N,G)|0,o=(o=o+Math.imul(N,V)|0)+Math.imul(I,G)|0,i=i+Math.imul(I,V)|0,r=r+Math.imul(L,K)|0,o=(o=o+Math.imul(L,$)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,$)|0,r=r+Math.imul(T,Y)|0,o=(o=o+Math.imul(T,Z)|0)+Math.imul(A,Y)|0,i=i+Math.imul(A,Z)|0,r=r+Math.imul(M,X)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,ee)|0,r=r+Math.imul(_,ne)|0,o=(o=o+Math.imul(_,re)|0)+Math.imul(x,ne)|0,i=i+Math.imul(x,re)|0,r=r+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,ae)|0,r=r+Math.imul(v,ue)|0,o=(o=o+Math.imul(v,le)|0)+Math.imul(g,ue)|0,i=i+Math.imul(g,le)|0,r=r+Math.imul(p,fe)|0,o=(o=o+Math.imul(p,he)|0)+Math.imul(m,fe)|0,i=i+Math.imul(m,he)|0;var ke=(l+(r=r+Math.imul(f,pe)|0)|0)+((8191&(o=(o=o+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;l=((i=i+Math.imul(h,me)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(F,G),o=(o=Math.imul(F,V))+Math.imul(U,G)|0,i=Math.imul(U,V),r=r+Math.imul(N,K)|0,o=(o=o+Math.imul(N,$)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,$)|0,r=r+Math.imul(L,Y)|0,o=(o=o+Math.imul(L,Z)|0)+Math.imul(D,Y)|0,i=i+Math.imul(D,Z)|0,r=r+Math.imul(T,X)|0,o=(o=o+Math.imul(T,ee)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,ee)|0,r=r+Math.imul(M,ne)|0,o=(o=o+Math.imul(M,re)|0)+Math.imul(C,ne)|0,i=i+Math.imul(C,re)|0,r=r+Math.imul(_,ie)|0,o=(o=o+Math.imul(_,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,r=r+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,le)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,le)|0,r=r+Math.imul(v,fe)|0,o=(o=o+Math.imul(v,he)|0)+Math.imul(g,fe)|0,i=i+Math.imul(g,he)|0;var Me=(l+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(F,K),o=(o=Math.imul(F,$))+Math.imul(U,K)|0,i=Math.imul(U,$),r=r+Math.imul(N,Y)|0,o=(o=o+Math.imul(N,Z)|0)+Math.imul(I,Y)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(L,X)|0,o=(o=o+Math.imul(L,ee)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(T,ne)|0,o=(o=o+Math.imul(T,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0,r=r+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,ae)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,ae)|0,r=r+Math.imul(_,ue)|0,o=(o=o+Math.imul(_,le)|0)+Math.imul(x,ue)|0,i=i+Math.imul(x,le)|0,r=r+Math.imul(w,fe)|0,o=(o=o+Math.imul(w,he)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,he)|0;var Ce=(l+(r=r+Math.imul(v,pe)|0)|0)+((8191&(o=(o=o+Math.imul(v,me)|0)+Math.imul(g,pe)|0))<<13)|0;l=((i=i+Math.imul(g,me)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(F,Y),o=(o=Math.imul(F,Z))+Math.imul(U,Y)|0,i=Math.imul(U,Z),r=r+Math.imul(N,X)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(L,ne)|0,o=(o=o+Math.imul(L,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(T,ie)|0,o=(o=o+Math.imul(T,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,r=r+Math.imul(M,ue)|0,o=(o=o+Math.imul(M,le)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,le)|0,r=r+Math.imul(_,fe)|0,o=(o=o+Math.imul(_,he)|0)+Math.imul(x,fe)|0,i=i+Math.imul(x,he)|0;var Oe=(l+(r=r+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(E,pe)|0))<<13)|0;l=((i=i+Math.imul(E,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(F,X),o=(o=Math.imul(F,ee))+Math.imul(U,X)|0,i=Math.imul(U,ee),r=r+Math.imul(N,ne)|0,o=(o=o+Math.imul(N,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(L,ie)|0,o=(o=o+Math.imul(L,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(T,ue)|0,o=(o=o+Math.imul(T,le)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,le)|0,r=r+Math.imul(M,fe)|0,o=(o=o+Math.imul(M,he)|0)+Math.imul(C,fe)|0,i=i+Math.imul(C,he)|0;var Te=(l+(r=r+Math.imul(_,pe)|0)|0)+((8191&(o=(o=o+Math.imul(_,me)|0)+Math.imul(x,pe)|0))<<13)|0;l=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(F,ne),o=(o=Math.imul(F,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(N,ie)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(L,ue)|0,o=(o=o+Math.imul(L,le)|0)+Math.imul(D,ue)|0,i=i+Math.imul(D,le)|0,r=r+Math.imul(T,fe)|0,o=(o=o+Math.imul(T,he)|0)+Math.imul(A,fe)|0,i=i+Math.imul(A,he)|0;var Ae=(l+(r=r+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,me)|0)+Math.imul(C,pe)|0))<<13)|0;l=((i=i+Math.imul(C,me)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(F,ie),o=(o=Math.imul(F,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(N,ue)|0,o=(o=o+Math.imul(N,le)|0)+Math.imul(I,ue)|0,i=i+Math.imul(I,le)|0,r=r+Math.imul(L,fe)|0,o=(o=o+Math.imul(L,he)|0)+Math.imul(D,fe)|0,i=i+Math.imul(D,he)|0;var Pe=(l+(r=r+Math.imul(T,pe)|0)|0)+((8191&(o=(o=o+Math.imul(T,me)|0)+Math.imul(A,pe)|0))<<13)|0;l=((i=i+Math.imul(A,me)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(F,ue),o=(o=Math.imul(F,le))+Math.imul(U,ue)|0,i=Math.imul(U,le),r=r+Math.imul(N,fe)|0,o=(o=o+Math.imul(N,he)|0)+Math.imul(I,fe)|0,i=i+Math.imul(I,he)|0;var Le=(l+(r=r+Math.imul(L,pe)|0)|0)+((8191&(o=(o=o+Math.imul(L,me)|0)+Math.imul(D,pe)|0))<<13)|0;l=((i=i+Math.imul(D,me)|0)+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(F,fe),o=(o=Math.imul(F,he))+Math.imul(U,fe)|0,i=Math.imul(U,he);var De=(l+(r=r+Math.imul(N,pe)|0)|0)+((8191&(o=(o=o+Math.imul(N,me)|0)+Math.imul(I,pe)|0))<<13)|0;l=((i=i+Math.imul(I,me)|0)+(o>>>13)|0)+(De>>>26)|0,De&=67108863;var je=(l+(r=Math.imul(F,pe))|0)+((8191&(o=(o=Math.imul(F,me))+Math.imul(U,pe)|0))<<13)|0;return l=((i=Math.imul(U,me))+(o>>>13)|0)+(je>>>26)|0,je&=67108863,u[0]=ye,u[1]=ve,u[2]=ge,u[3]=be,u[4]=we,u[5]=Ee,u[6]=Se,u[7]=_e,u[8]=xe,u[9]=ke,u[10]=Me,u[11]=Ce,u[12]=Oe,u[13]=Te,u[14]=Ae,u[15]=Pe,u[16]=Le,u[17]=De,u[18]=je,0!==l&&(u[19]=l,n.length++),n};function m(e,t,n){return(new y).mulp(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(p=d),i.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):m(this,e,t),n},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=o/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,l=0;l=0&&(0!==c||l>=o);l--){var f=0|this.words[l];this.words[l]=c<<26-i|f>>>i,c=f&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[o+n]=67108863&i}for(;o>26,this.words[o+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l=0;f--){var h=67108864*(0|r.words[o.length+f])+(0|r.words[o.length+f-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,f);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):this.negative&e.negative?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(t*n+(0|this.words[o]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*t;this.words[n]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var c=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;!(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(c),a.isub(f)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;!(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(u)):(n.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:n.iushln(l)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,c=1;!(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;!(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new _(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(b,g),b.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),o=0;o>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new w;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},_.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},_.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,o),h=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=a;0!==d.cmp(s);){for(var m=d,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var l=t.words[r],c=u-1;c>=0;c--){var f=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==f||0!==a?(a<<=1,a|=f,(4==++s||0===r&&0===c)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},o(x,_),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},49:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(2412).fetchFromAPI;function u(e){return l.apply(this,arguments)}function l(){return(l=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s("/users",null,t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var c="FETCH_ACCOUNTS_REQUEST",f="FETCH_ACCOUNTS_SUCCESS",h="FETCH_ACCOUNTS_FAILURE",d="FETCH_ACCOUNT_REQUEST",p="FETCH_ACCOUNT_SUCCESS",m="FETCH_ACCOUNT_FAILURE",y="PASSWORD_RESET_REQUEST",v="PASSWORD_RESET_SUCCESS",g="PASSWORD_RESET_FAILURE",b=function(e){return{type:f,payload:e,loading:!1}},w=function(e){return{type:h,payload:e,loading:!1}},E=function(e){return{type:p,payload:e,loading:!1}},S=function(e){return{type:m,payload:e,loading:!1}},_=function(e){return{type:y,payload:e}},x=function(e){return{type:g,payload:e}};e.exports={fetchUser:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:d,loading:!0}),i=r().auth.token,t.prev=2,t.next=5,s("/users/".concat(e),null,i);case 5:a=t.sent,n(E(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(S(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},fetchUsers:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:c,loading:!0}),r=n().auth.token,e.prev=2,e.next=5,u(r);case 5:i=e.sent,t(b(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(w(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},askPasswordReset:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a,s,u;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n(_(e)),r().auth.token,t.prev=2,i=fetch("/passwordReset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})}),a=new Promise((function(e,t){setTimeout((function(){t(new Error("Email could not be sent. Please check your internet connection."))}),6e4)})),t.next=7,Promise.race([a,i]);case 7:if((s=t.sent).ok){t.next=13;break}return t.next=11,s.json();case 11:throw u=t.sent,new Error(u.message);case 13:n({type:v}),t.next=19;break;case 16:t.prev=16,t.t0=t.catch(2),n(x(t.t0));case 19:case"end":return t.stop()}}),t,null,[[2,16]])})));return function(e,n){return t.apply(this,arguments)}}()},FETCH_ACCOUNT_REQUEST:d,FETCH_ACCOUNT_SUCCESS:p,FETCH_ACCOUNT_FAILURE:m,FETCH_ACCOUNTS_REQUEST:c,FETCH_ACCOUNTS_SUCCESS:f,FETCH_ACCOUNTS_FAILURE:h,PASSWORD_RESET_REQUEST:y,PASSWORD_RESET_SUCCESS:v,PASSWORD_RESET_FAILURE:g}},9993:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(2412).fetchFromAPI,u=n(4641);function l(e){return c.apply(this,arguments)}function c(){return(c=a(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/statistics/admin",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}});case 2:return n=e.sent,e.next=5,n.json();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(e){return h.apply(this,arguments)}function h(){return(h=a(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/statistics/sync",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}});case 2:return n=e.sent,e.next=5,n.json();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function d(e,t){return p.apply(this,arguments)}function p(){return(p=a(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/invitations",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify(t)});case 2:return r=e.sent,e.next=5,r.json();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var m="FETCH_ADMIN_STATS_REQUEST",y="FETCH_ADMIN_STATS_SUCCESS",v="FETCH_ADMIN_STATS_FAILURE",g="EDIT_USERNAME_REQUEST",b="EDIT_USERNAME_SUCCESS",w="EDIT_USERNAME_FAILURE",E="EDIT_EMAIL_REQUEST",S="EDIT_EMAIL_SUCCESS",_="EDIT_EMAIL_FAILURE",x=function(){return{type:m}},k=function(e){return{type:y,payload:e}},M=function(e){return{type:"FETCH_SYNC_STATS_FAILURE",payload:e}},C=function(e){return{type:v,payload:e}},O=function(e){return{type:"FETCH_SYNC_STATS_SUCCESS",payload:e}},T=function(e){return{type:"FETCH_ALL_CONVERSATIONS_SUCCESS",payload:e}},A=function(e){return{type:"FETCH_ALL_CONVERSATIONS_FAILURE",payload:e}},P=function(e){return{type:"CREATE_INVITATION_SUCCESS",payload:e}},L=function(e){return{type:"CREATE_INVITATION_FAILURE",payload:e}},D=function(e){return{type:w,payload:e,loading:!1}},j=function(e){return{type:_,payload:e,loading:!1}};e.exports={fetchAdminStats:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t(x()),r=n().auth.token,e.prev=2,e.next=5,l(r);case 5:i=e.sent,t(k(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(M(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},fetchAllConversationsFromAPI:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t(x()),r=n().auth.token,e.prev=2,e.next=5,s("/conversations",{query:{include:"*"}},r);case 5:i=e.sent,t(T(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(A(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},fetchSyncStats:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:"FETCH_SYNC_STATS_REQUEST"}),r=n().auth.token,e.prev=2,e.next=5,f(r);case 5:i=e.sent,t(O(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(C(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},createInvitation:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:"CREATE_INVITATION_REQUEST"}),i=r().auth.token,t.prev=2,t.next=5,d(e,i);case 5:a=t.sent,n(P(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(L(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},editUsername:function(e,t){return function(){var n=a(o().mark((function n(r,i){var a,s,l;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=i().auth.token,r({type:g,loading:!0}),n.prev=2,s=fetch("/users/username",{method:"PATCH",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify({id:e,newUsername:t})}),l=u(15e3,"Fetch timed out"),n.next=7,Promise.race([l,s]);case 7:n.sent,r({type:b,loading:!1}),n.next=14;break;case 11:n.prev=11,n.t0=n.catch(2),r(D(n.t0));case 14:case"end":return n.stop()}}),n,null,[[2,11]])})));return function(e,t){return n.apply(this,arguments)}}()},editEmail:function(e,t){return function(){var n=a(o().mark((function n(r,i){var a,s,l;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=i().auth.token,r({type:E,loading:!0}),n.prev=2,s=fetch("/users/email",{method:"PATCH",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify({id:e,newEmail:t})}),l=u(15e3,"Fetch timed out"),n.next=7,Promise.race([l,s]);case 7:n.sent,r({type:S,loading:!1}),n.next=14;break;case 11:n.prev=11,n.t0=n.catch(2),r(j(n.t0));case 14:case"end":return n.stop()}}),n,null,[[2,11]])})));return function(e,t){return n.apply(this,arguments)}}()},FETCH_ADMIN_STATS_REQUEST:m,FETCH_ADMIN_STATS_SUCCESS:y,FETCH_ADMIN_STATS_FAILURE:v,EDIT_USERNAME_REQUEST:g,EDIT_USERNAME_SUCCESS:b,EDIT_USERNAME_FAILURE:w,EDIT_EMAIL_REQUEST:E,EDIT_EMAIL_SUCCESS:S,EDIT_EMAIL_FAILURE:_}},2412:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(3092);function u(){return u=a(o().mark((function e(t){var n,r,i=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:null,e.next=4,s(t,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:n?"Bearer ".concat(n):void 0}});case 4:return r=e.sent,e.next=7,r.json();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e)}))),u.apply(this,arguments)}function l(){return l=a(o().mark((function e(){var t,n,r=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:document.path,e.next=3,s(t,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:token?"Bearer ".concat(token):void 0}});case 3:return n=e.sent,e.abrupt("return",n.json());case 5:case"end":return e.stop()}}),e)}))),l.apply(this,arguments)}function c(){return c=a(o().mark((function e(t,n){var r,i,a=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>2&&void 0!==a[2]?a[2]:null,e.next=3,s(t,{method:"PATCH",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:r?"Bearer ".concat(r):void 0},body:JSON.stringify([{op:"replace",path:"/",value:n}])});case 3:return i=e.sent,e.next=6,i.json();case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)}))),c.apply(this,arguments)}function f(){return f=a(o().mark((function e(t,n){var r,i,a=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>2&&void 0!==a[2]?a[2]:null,e.next=3,s(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:r?"Bearer ".concat(r):void 0},body:n});case 3:return i=e.sent,e.next=6,i.json();case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)}))),f.apply(this,arguments)}e.exports={fetchFromAPI:function(e){return u.apply(this,arguments)},fetchResource:function(){return l.apply(this,arguments)},patchAPI:function(e,t){return c.apply(this,arguments)},postAPI:function(e,t){return f.apply(this,arguments)}}},1730:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}var a=n(2412).fetchFromAPI,s="BRIDGE_SYNC_REQUEST",u="BRIDGE_SYNC_SUCCESS",l="BRIDGE_SYNC_FAILURE",c=function(e){return{type:u,payload:e,loading:!1}},f=function(e){return{type:l,payload:e,loading:!1}};e.exports={bridgeSync:function(){return function(){var e,t=(e=o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:s,loading:!0}),r=n().auth.token.token,e.prev=2,e.next=5,a("/",null,r);case 5:i=e.sent,t(c(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(f(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))});return function(e,n){return t.apply(this,arguments)}}()},BRIDGE_SYNC_REQUEST:s,BRIDGE_SYNC_SUCCESS:u,BRIDGE_SYNC_FAILURE:l}},2842:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function u(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){u(i,r,o,a,s,"next",e)}function s(e){u(i,r,o,a,s,"throw",e)}a(void 0)}))}}var c=n(4945),f="CHAT_REQUEST",h="CHAT_SUCCESS",d="CHAT_FAILURE",p="GET_MESSAGES_REQUEST",m="GET_MESSAGES_SUCCESS",y="GET_MESSAGES_FAILURE",v="RESET_CHAT_SUCCESS",g=function(){return{type:f,isSending:!0}},b=function(e){return{type:h,payload:{message:e},isSending:!1}},w=function(e){return{type:d,payload:e,error:e,isSending:!1}},E=function(e){return{type:y,payload:e,error:e,isSending:!1}},S=function(e){return{type:"GET_INFORMATION_SUCCESS",payload:e}},_=function(e){return{type:"GET_INFORMATION_FAILURE",payload:e,error:e}};e.exports={resetChat:function(e){return function(){var e=l(s().mark((function e(t,n){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t({type:v});case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},submitMessage:function(e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(){var n=l(s().mark((function n(r,o){var a,u,l,f,h;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r(g()),a=o().auth.token,n.prev=2,u=i({},e),null!==t&&(u.file_fabric_id=t),n.next=7,c("/messages",{method:"POST",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify(u)});case 7:if((l=n.sent).ok){n.next=13;break}return n.next=11,l.json();case 11:throw f=n.sent,new Error(f.message);case 13:return n.next=15,l.json();case 15:h=n.sent,r(b(h)),n.next=22;break;case 19:n.prev=19,n.t0=n.catch(2),r(w(n.t0.message));case 22:case"end":return n.stop()}}),n,null,[[2,19]])})));return function(e,t){return n.apply(this,arguments)}}()},fetchResponse:function(e){return function(){var t=l(s().mark((function t(n,r){var o,a,u,l,f;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n(g()),o=r().auth.token,t.prev=2,a=i({},e),t.next=6,c("/v1/chat/completions",{method:"POST",headers:{Authorization:"Bearer ".concat(o),"Content-Type":"application/json"},body:JSON.stringify(a)});case 6:if((u=t.sent).ok){t.next=12;break}return t.next=10,u.json();case 10:throw l=t.sent,new Error(l.message);case 12:return t.next=14,u.json();case 14:f=t.sent,n(b(f)),t.next=21;break;case 18:t.prev=18,t.t0=t.catch(2),n(w(t.t0.message));case 21:case"end":return t.stop()}}),t,null,[[2,18]])})));return function(e,n){return t.apply(this,arguments)}}()},getMessages:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(){var t=l(s().mark((function t(n,r){var o,i,a,u,l;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:p,isSending:!0}),o=r(),i=o.auth.token,e.conversation_id||(e.conversation_id=o.chat.message.conversation),t.prev=4,t.next=7,c("/messages?"+new URLSearchParams(e),{method:"GET",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});case 7:if((a=t.sent).ok){t.next=13;break}return t.next=11,a.json();case 11:throw u=t.sent,new Error(u.message);case 13:return t.next=15,a.json();case 15:l=t.sent,n({type:m,payload:{messages:l},isSending:!1}),t.next=22;break;case 19:t.prev=19,t.t0=t.catch(4),n(E(t.t0.message));case 22:case"end":return t.stop()}}),t,null,[[4,19]])})));return function(e,n){return t.apply(this,arguments)}}()},regenAnswer:function(e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(){var n=l(s().mark((function n(r,o){var a,u,l,f,h;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r(g()),a=o().auth.token,e.temperature="extreme",e.regenerate=!0,u=i({},e),null!==t&&(u.file_fabric_id=t),n.prev=6,n.next=9,c("/messages/".concat(e.id),{method:"PATCH",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json","X-Temperature":e.temperature},body:JSON.stringify(u)});case 9:if((l=n.sent).ok){n.next=15;break}return n.next=13,l.json();case 13:throw f=n.sent,new Error(f.message);case 15:return n.next=17,l.json();case 17:h=n.sent,r(b(h)),n.next=24;break;case 21:n.prev=21,n.t0=n.catch(6),r(w(n.t0.message));case 24:case"end":return n.stop()}}),n,null,[[6,21]])})));return function(e,t){return n.apply(this,arguments)}}()},getMessageInformation:function(e){return function(){var t=l(s().mark((function t(n,r){var o,i,a;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:"GET_INFORMATION_REQUEST"}),t.prev=1,r().auth.token,t.next=6,c("/documents",{method:"SEARCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});case 6:if((o=t.sent).ok){t.next=12;break}return t.next=10,o.json();case 10:throw i=t.sent,new Error(i.message);case 12:return t.next=14,o.json();case 14:a=t.sent,n(S(a)),t.next=21;break;case 18:t.prev=18,t.t0=t.catch(1),n(_(t.t0.message));case 21:case"end":return t.stop()}}),t,null,[[1,18]])})));return function(e,n){return t.apply(this,arguments)}}()},CHAT_SUCCESS:h,CHAT_FAILURE:d,CHAT_REQUEST:f,GET_MESSAGES_REQUEST:p,GET_MESSAGES_SUCCESS:m,GET_MESSAGES_FAILURE:y,FETCH_RESPONSE_REQUEST:"FETCH_RESPONSE_REQUEST",FETCH_RESPONSE_SUCCESS:"FETCH_RESPONSE_SUCCESS",FETCH_RESPONSE_FAILURE:"FETCH_RESPONSE_FAILURE",RESET_CHAT_STATE:"RESET_CHAT_STATE",RESET_CHAT_SUCCESS:v}},6494:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(4945),u=n(2412),l=u.fetchFromAPI,c=u.patchAPI,f="FETCH_CONTRACT_REQUEST",h="FETCH_CONTRACT_SUCCESS",d="FETCH_CONTRACT_FAILURE",p="SIGN_CONTRACT_REQUEST",m="SIGN_CONTRACT_SUCCESS",y="SIGN_CONTRACT_FAILURE",v="GET_CONTRACTS_REQUEST",g="GET_CONTRACTS_SUCCESS",b="GET_CONTRACTS_FAILURE",w=function(e){return{type:h,payload:e}},E=function(e){return{type:d,payload:e}},S=function(e){return{type:b,payload:e,error:e,isSending:!1}},_=function(e){return{type:m,payload:e,isCompliant:!0}},x=function(e){return{type:y,payload:e}},k=function(){return function(){var e=a(o().mark((function e(t,n){var r,i,a,u,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:v,isSending:!0}),r=n(),i=r.auth.token,e.prev=3,e.next=6,s("/contracts",{method:"GET",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});case 6:if((a=e.sent).ok){e.next=12;break}return e.next=10,a.json();case 10:throw u=e.sent,new Error(u.contract);case 12:return e.next=14,a.json();case 14:l=e.sent,t({type:g,payload:{contracts:l},isSending:!1}),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(3),t(S(e.t0.contract));case 21:case"end":return e.stop()}}),e,null,[[3,18]])})));return function(t,n){return e.apply(this,arguments)}}()},M=k;e.exports={fetchContracts:M,fetchContract:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:f}),i=r().auth.token.token,t.prev=2,t.next=5,l("/contracts/".concat(e),i);case 5:a=t.sent,n(w(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(E(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},signContract:function(e){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:p}),r=n().auth.token,e.prev=2,e.next=5,c("/settings/compliance",{isCompliant:!0},r);case 5:i=e.sent,t(_(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(x(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},getContracts:k,FETCH_CONTRACT_REQUEST:f,FETCH_CONTRACT_SUCCESS:h,FETCH_CONTRACT_FAILURE:d,GET_CONTRACTS_REQUEST:v,GET_CONTRACTS_SUCCESS:g,GET_CONTRACTS_FAILURE:b,SIGN_CONTRACT_REQUEST:p,SIGN_CONTRACT_SUCCESS:m,SIGN_CONTRACT_FAILURE:y}},6841:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(2412).fetchFromAPI;function u(e){return l.apply(this,arguments)}function l(){return l=a(o().mark((function e(t){var n,r=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",s("/conversations",n,t));case 2:case"end":return e.stop()}}),e)}))),l.apply(this,arguments)}var c="FETCH_CONVERSATIONS_REQUEST",f="FETCH_CONVERSATIONS_SUCCESS",h="FETCH_CONVERSATIONS_FAILURE",d="FETCH_CONVERSATION_REQUEST",p="FETCH_CONVERSATION_SUCCESS",m="FETCH_CONVERSATION_FAILURE",y="EDIT_TITLE_REQUEST",v="EDIT_TITLE_SUCCESS",g="EDIT_TITLE_FAILURE",b=function(e){return{type:f,payload:e}},w=function(e){return{type:h,payload:e}},E=function(e){return{type:p,payload:e}},S=function(e){return{type:m,payload:e}},_=function(e){return{type:g,payload:e}};e.exports={fetchConversation:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:d}),i=r().auth.token,t.prev=2,t.next=5,s("/conversations/".concat(e),i);case 5:a=t.sent,n(E(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(S(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},fetchConversations:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:c}),r=n().auth.token,e.prev=2,e.next=5,u(r);case 5:i=e.sent,t(b(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(w(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},conversationTitleEdit:function(e,t){return function(){var n=a(o().mark((function n(r,i){var a,s,u;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=i().auth.token,n.prev=1,r({type:y}),s=fetch("/conversations/".concat(e),{method:"PATCH",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify({title:t})}),u=new Promise((function(e,t){setTimeout((function(){t(new Error("Fetch timed out"))}),15e3)})),n.next=7,Promise.race([u,s]);case 7:n.sent,r({type:v}),n.next=14;break;case 11:n.prev=11,n.t0=n.catch(1),r(_(n.t0));case 14:case"end":return n.stop()}}),n,null,[[1,11]])})));return function(e,t){return n.apply(this,arguments)}}()},FETCH_CONVERSATION_REQUEST:d,FETCH_CONVERSATION_SUCCESS:p,FETCH_CONVERSATION_FAILURE:m,FETCH_CONVERSATIONS_REQUEST:c,FETCH_CONVERSATIONS_SUCCESS:f,FETCH_CONVERSATIONS_FAILURE:h,EDIT_TITLE_REQUEST:y,EDIT_TITLE_SUCCESS:v,EDIT_TITLE_FAILURE:g}},9283:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(2412).fetchFromAPI,u=n(4641);function l(e){return c.apply(this,arguments)}function c(){return(c=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s("/documents",null,t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var f="FETCH_DOCUMENTS_REQUEST",h="FETCH_DOCUMENTS_SUCCESS",d="FETCH_DOCUMENTS_FAILURE",p="FETCH_DOCUMENT_REQUEST",m="FETCH_DOCUMENT_SUCCESS",y="FETCH_DOCUMENT_FAILURE",v="FETCH_DOCUMENT_SECTIONS_REQUEST",g="FETCH_DOCUMENT_SECTIONS_SUCCESS",b="FETCH_DOCUMENT_SECTIONS_FAILURE",w="UPLOAD_DOCUMENT_REQUEST",E="UPLOAD_DOCUMENT_SUCCESS",S="UPLOAD_DOCUMENT_FAILURE",_="SEARCH_DOCUMENT_REQUEST",x="SEARCH_DOCUMENT_SUCCESS",k="SEARCH_DOCUMENT_FAILURE",M="CREATE_DOCUMENT_REQUEST",C="CREATE_DOCUMENT_SUCCESS",O="CREATE_DOCUMENT_FAILURE",T="CREATE_DOCUMENT_SECTION_REQUEST",A="CREATE_DOCUMENT_SECTION_SUCCESS",P="CREATE_DOCUMENT_SECTION_FAILURE",L="DELETE_DOCUMENT_SECTION_REQUEST",D="DELETE_DOCUMENT_SECTION_SUCCESS",j="DELETE_DOCUMENT_SECTION_FAILURE",N="EDIT_DOCUMENT_SECTION_REQUEST",I="EDIT_DOCUMENT_SECTION_SUCCESS",R="EDIT_DOCUMENT_SECTION_FAILURE",F="EDIT_DOCUMENT_REQUEST",U="EDIT_DOCUMENT_SUCCESS",B="EDIT_DOCUMENT_FAILURE",H="DELETE_DOCUMENT_REQUEST",z="DELETE_DOCUMENT_SUCCESS",q="DELETE_DOCUMENT_FAILURE",G=function(e){return{type:h,payload:e}},V=function(e){return{type:d,payload:e}},W=function(e){return{type:m,payload:e}},K=function(e){return{type:y,payload:e}},$=function(e){return{type:g,payload:e}},Q=function(e){return{type:b,payload:e}},Y=function(e){return{type:S,payload:e}},Z=function(e){return{type:k,payload:e}},J=function(e){return{type:O,payload:e}},X=function(e){return{type:A,payload:e}},ee=function(e){return{type:P,payload:e}},te=function(e){return{type:D,payload:e}},ne=function(e){return{type:j,payload:e}},re=function(e){return{type:R,payload:e}},oe=function(e){return{type:U,payload:e}},ie=function(e){return{type:B,payload:e}},ae=function(e){return{type:q,payload:e}};e.exports={fetchDocument:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:p}),i=r().auth.token.token,t.prev=2,t.next=5,s("/documents/".concat(e),null,i);case 5:a=t.sent,n(W(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(K(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},fetchDocuments:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:f}),r=n().auth.token,e.prev=2,e.next=5,l(r);case 5:i=e.sent,t(G(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(V(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},fetchDocumentSections:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:v}),i=r().auth.token.token,t.prev=2,t.next=5,s("/documents/sections/".concat(e),null,i);case 5:a=t.sent,n($(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(Q(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},uploadDocument:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a,s,l,c,f,h;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:w}),t.prev=1,i=r().auth.token,a=u(12e5,"File upload could not be completed due to a timeout error. Please check your network connection and try again. For ongoing issues, contact our support team at support@sensemaker.io."),(s=new FormData).append("name",e.name),s.append("file",e),t.next=9,fetch("/files",{headers:{Authorization:"Bearer ".concat(i)},method:"POST",body:s});case 9:return l=t.sent,t.next=12,Promise.race([a,l]);case 12:if((c=t.sent).ok){t.next=18;break}return t.next=16,c.json();case 16:throw f=t.sent,new Error(f.message||"Server error");case 18:return t.next=20,c.json();case 20:h=t.sent,n((o=h.fabric_id,{type:E,payload:o})),t.next=27;break;case 24:t.prev=24,t.t0=t.catch(1),n(Y(t.t0.message));case 27:case"end":return t.stop()}var o}),t,null,[[1,24]])})));return function(e,n){return t.apply(this,arguments)}}()},searchDocument:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:_}),r().auth.token,t.prev=2,t.next=5,fetch("/documents",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"SEARCH",body:JSON.stringify({query:e})});case 5:return i=t.sent,t.next=8,i.json();case 8:a=t.sent,console.debug("fetch result: ",a),n((o=a.content,{type:x,payload:o})),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(2),console.error("Error fetching data:",t.t0),n(Z(t.t0.message));case 17:case"end":return t.stop()}var o}),t,null,[[2,13]])})));return function(e,n){return t.apply(this,arguments)}}()},createDocument:function(e,t){return function(){var n=a(o().mark((function n(r,i){var a,s,u,l;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r({type:M}),a=i().auth.token,n.prev=2,n.next=5,fetch("/documents",{headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},method:"POST",body:JSON.stringify({type:e,query:t})});case 5:if((s=n.sent).ok){n.next=11;break}return n.next=9,s.json();case 9:throw u=n.sent,new Error(u.message||"Server error");case 11:return n.next=13,s.json();case 13:l=n.sent,r({type:C,payload:l}),n.next=20;break;case 17:n.prev=17,n.t0=n.catch(2),r(J(n.t0.message));case 20:case"end":return n.stop()}}),n,null,[[2,17]])})));return function(e,t){return n.apply(this,arguments)}}()},createDocumentSection:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return function(){var i=a(o().mark((function i(a,s){var u,l,c;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a({type:T}),u=s().auth.token,o.prev=2,o.next=5,fetch("/documents/".concat(e,"/section/").concat(t),{headers:{Authorization:"Bearer ".concat(u),"Content-Type":"application/json"},method:"POST",body:JSON.stringify({title:n,content:r})});case 5:return l=o.sent,o.next=8,l.json();case 8:c=o.sent,a(X(c)),o.next=16;break;case 12:o.prev=12,o.t0=o.catch(2),console.error("Error fetching data:",o.t0),a(ee(o.t0.message));case 16:case"end":return o.stop()}}),i,null,[[2,12]])})));return function(e,t){return i.apply(this,arguments)}}()},deleteDocumentSection:function(e,t){return function(){var n=a(o().mark((function n(r,i){var a,s,u;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r({type:L}),a=i().auth.token,n.prev=2,n.next=5,fetch("/documents/".concat(e,"/section/delete/").concat(t),{headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},method:"PATCH"});case 5:return s=n.sent,n.next=8,s.json();case 8:u=n.sent,r(te(u)),n.next=16;break;case 12:n.prev=12,n.t0=n.catch(2),console.error("Error fetching data:",n.t0),r(ne(n.t0.message));case 16:case"end":return n.stop()}}),n,null,[[2,12]])})));return function(e,t){return n.apply(this,arguments)}}()},editDocumentSection:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return function(){var i=a(o().mark((function i(a,s){var u,l,c;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a({type:N}),u=s().auth.token,o.prev=2,o.next=5,fetch("/documents/".concat(e,"/section/").concat(t),{headers:{Authorization:"Bearer ".concat(u),"Content-Type":"application/json"},method:"PATCH",body:JSON.stringify({title:n,content:r})});case 5:return l=o.sent,o.next=8,l.json();case 8:c=o.sent,a({type:I,payload:c}),o.next=16;break;case 12:o.prev=12,o.t0=o.catch(2),console.error("Error fetching data:",o.t0),a(re(o.t0.message));case 16:case"end":return o.stop()}}),i,null,[[2,12]])})));return function(e,t){return i.apply(this,arguments)}}()},editDocument:function(e,t){return function(){var n=a(o().mark((function n(r,i){var a,s,u;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r({type:F}),a=i().auth.token,n.prev=2,n.next=5,fetch("/documents/".concat(e),{headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},method:"PATCH",body:JSON.stringify({title:t})});case 5:return s=n.sent,n.next=8,s.json();case 8:u=n.sent,r(oe(u)),n.next=16;break;case 12:n.prev=12,n.t0=n.catch(2),console.error("Error fetching data:",n.t0),r(ie(n.t0.message));case 16:case"end":return n.stop()}}),n,null,[[2,12]])})));return function(e,t){return n.apply(this,arguments)}}()},deleteDocument:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:H}),i=r().auth.token,t.prev=2,t.next=5,fetch("/documents/delete/".concat(e),{headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},method:"PATCH",body:JSON.stringify({fabricID:e})});case 5:if((a=t.sent).ok){t.next=11;break}return t.next=9,a.json();case 9:throw s=t.sent,new Error(s.message);case 11:n({type:z}),t.next=18;break;case 14:t.prev=14,t.t0=t.catch(2),console.error("Error fetching data:",t.t0),n(ae(t.t0.message));case 18:case"end":return t.stop()}}),t,null,[[2,14]])})));return function(e,n){return t.apply(this,arguments)}}()},FETCH_DOCUMENT_REQUEST:p,FETCH_DOCUMENT_SUCCESS:m,FETCH_DOCUMENT_FAILURE:y,FETCH_DOCUMENTS_REQUEST:f,FETCH_DOCUMENTS_SUCCESS:h,FETCH_DOCUMENTS_FAILURE:d,FETCH_DOCUMENT_SECTIONS_REQUEST:v,FETCH_DOCUMENT_SECTIONS_SUCCESS:g,FETCH_DOCUMENT_SECTIONS_FAILURE:b,UPLOAD_DOCUMENT_REQUEST:w,UPLOAD_DOCUMENT_SUCCESS:E,UPLOAD_DOCUMENT_FAILURE:S,SEARCH_DOCUMENT_REQUEST:_,SEARCH_DOCUMENT_SUCCESS:x,SEARCH_DOCUMENT_FAILURE:k,CREATE_DOCUMENT_REQUEST:M,CREATE_DOCUMENT_SUCCESS:C,CREATE_DOCUMENT_FAILURE:O,CREATE_DOCUMENT_SECTION_REQUEST:T,CREATE_DOCUMENT_SECTION_SUCCESS:A,CREATE_DOCUMENT_SECTION_FAILURE:P,DELETE_DOCUMENT_SECTION_REQUEST:L,DELETE_DOCUMENT_SECTION_SUCCESS:D,DELETE_DOCUMENT_SECTION_FAILURE:j,EDIT_DOCUMENT_SECTION_REQUEST:N,EDIT_DOCUMENT_SECTION_SUCCESS:I,EDIT_DOCUMENT_SECTION_FAILURE:R,EDIT_DOCUMENT_REQUEST:F,EDIT_DOCUMENT_SUCCESS:U,EDIT_DOCUMENT_FAILURE:B,DELETE_DOCUMENT_REQUEST:H,DELETE_DOCUMENT_SUCCESS:z,DELETE_DOCUMENT_FAILURE:q}},5606:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}var a=n(4641),s="SEND_FEEDBACK_REQUEST",u="SEND_FEEDBACK_SUCCESS",l="SEND_FEEDBACK_FAILURE",c=function(e){return{type:l,payload:e}};e.exports={sendFeedback:function(e){return function(){var t,n=(t=o().mark((function t(n,r){var i,l,f,h,d;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:s}),i=r().auth.token,t.prev=2,l=a(15e3,"Feedback could not be sent due to a timeout error. Please check your network connection and try again. For ongoing issues, contact our support team at support@sensemaker.io."),f=fetch("/feedback",{method:"POST",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify({comment:e})}),t.next=7,Promise.race([l,f]);case 7:if((h=t.sent).ok){t.next=13;break}return t.next=11,h.json();case 11:throw d=t.sent,new Error(d.message||"Server error");case 13:n({type:u}),t.next=19;break;case 16:t.prev=16,t.t0=t.catch(2),n(c(t.t0.message));case 19:case"end":return t.stop()}}),t,null,[[2,16]])})),function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))});return function(e,t){return n.apply(this,arguments)}}()},SEND_FEEDBACK_REQUEST:s,SEND_FEEDBACK_SUCCESS:u,SEND_FEEDBACK_FAILURE:l}},7434:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(2412).fetchFromAPI,u=n(4641);function l(e){return c.apply(this,arguments)}function c(){return(c=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s("/files",null,t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var f="FETCH_FILES_REQUEST",h="FETCH_FILES_SUCCESS",d="FETCH_FILES_FAILURE",p="FETCH_FILE_REQUEST",m="FETCH_FILE_SUCCESS",y="FETCH_FILE_FAILURE",v="UPLOAD_FILE_REQUEST",g="UPLOAD_FILE_SUCCESS",b="UPLOAD_FILE_FAILURE",w=function(){return{type:f,loading:!0}},E=function(e){return{type:h,payload:e,loading:!1}},S=function(e){return{type:d,payload:e,loading:!1}},_=function(e){return{type:m,payload:e,loading:!1}},x=function(e){return{type:y,payload:e,loading:!1}},k=function(e){return{type:b,payload:e}};e.exports={fetchFile:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:p,loading:!0}),i=r().auth.token.token,t.prev=2,t.next=5,s("/files/".concat(e),null,i);case 5:a=t.sent,n(_(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(x(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},fetchFiles:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t(w()),r=n().auth.token,e.prev=2,e.next=5,l(r);case 5:i=e.sent,t(E(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(S(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},fetchUserFiles:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n(w()),i=r().auth.token,t.prev=2,t.next=5,s("/files/user/".concat(e),null,i);case 5:a=t.sent,n(E(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(S(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},uploadFile:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a,s,l,c,f,h;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:v}),t.prev=1,i=r().auth.token,a=u(12e5,"File upload could not be completed due to a timeout error. Please check your network connection and try again. For ongoing issues, contact our support team at support@sensemaker.io."),(s=new FormData).append("name",e.name),s.append("file",e),t.next=9,fetch("/files",{headers:{Authorization:"Bearer ".concat(i)},method:"POST",body:s});case 9:return l=t.sent,t.next=12,Promise.race([a,l]);case 12:if((c=t.sent).ok){t.next=18;break}return t.next=16,c.json();case 16:throw f=t.sent,new Error(f.message||"Server error");case 18:return t.next=20,c.json();case 20:h=t.sent,n((o=h.fabric_id,{type:g,payload:o})),t.next=27;break;case 24:t.prev=24,t.t0=t.catch(1),n(k(t.t0.message));case 27:case"end":return t.stop()}var o}),t,null,[[1,24]])})));return function(e,n){return t.apply(this,arguments)}}()},FETCH_FILE_REQUEST:p,FETCH_FILE_SUCCESS:m,FETCH_FILE_FAILURE:y,FETCH_FILES_REQUEST:f,FETCH_FILES_SUCCESS:h,FETCH_FILES_FAILURE:d,UPLOAD_FILE_REQUEST:v,UPLOAD_FILE_SUCCESS:g,UPLOAD_FILE_FAILURE:b}},8301:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(2412).fetchFromAPI;function u(e){return l.apply(this,arguments)}function l(){return l=a(o().mark((function e(t){var n,r=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",s("/conversations/help",n,t));case 2:case"end":return e.stop()}}),e)}))),l.apply(this,arguments)}function c(e){return f.apply(this,arguments)}function f(){return f=a(o().mark((function e(t){var n,r=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",s("/conversations/help/admin",n,t));case 2:case"end":return e.stop()}}),e)}))),f.apply(this,arguments)}var h="FETCH_HELP_CONVERSATIONS_REQUEST",d="FETCH_HELP_CONVERSATIONS_SUCCESS",p="FETCH_HELP_CONVERSATIONS_FAILURE",m="FETCH_ADMIN_HELP_CONVERSATIONS_REQUEST",y="FETCH_ADMIN_HELP_CONVERSATIONS_SUCCESS",v="FETCH_ADMIN_HELP_CONVERSATIONS_FAILURE",g="FETCH_HELP_MESSAGES_REQUEST",b="FETCH_HELP_MESSAGES_SUCCESS",w="FETCH_HELP_MESSAGES_FAILURE",E="FETCH_ADMIN_HELP_MESSAGES_REQUEST",S="FETCH_ADMIN_HELP_MESSAGES_SUCCESS",_="FETCH_ADMIN_HELP_MESSAGES_FAILURE",x="SEND_HELP_MESSAGE_REQUEST",k="SEND_HELP_MESSAGE_SUCCESS",M="SEND_HELP_MESSAGE_FAILURE",C="CLEAR_HELP_MESSAGES_SUCCESS",O=function(e){return{type:d,payload:e}},T=function(e){return{type:p,payload:e}},A=function(e){return{type:y,payload:e}},P=function(e){return{type:v,payload:e}},L=function(){return{type:g}},D=function(e){return{type:b,payload:e}},j=function(e){return{type:w,payload:e}},N=function(){return{type:E}},I=function(e){return{type:S,payload:e}},R=function(e){return{type:_,payload:e}},F=function(e){return{type:k,payload:e}},U=function(e){return{type:M,payload:e}};e.exports={fetchHelpConversations:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:h}),r=n().auth.token,e.prev=2,e.next=5,u(r);case 5:i=e.sent,t(O(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(T(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},fetchAdminHelpConversations:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:m}),r=n().auth.token,e.prev=2,e.next=5,c(r);case 5:i=e.sent,t(A(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(P(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},fetchHelpMessages:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(){var n=a(o().mark((function n(r,i){var a,u,l,c;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r((a=t?{request:N,success:I,failure:R}:{request:L,success:D,failure:j}).request()),u=i().auth.token,l="/messages/help/".concat(e),n.prev=4,n.next=7,s(l,u);case 7:c=n.sent,r(a.success(c)),n.next=14;break;case 11:n.prev=11,n.t0=n.catch(4),r(a.failure(n.t0));case 14:case"end":return n.stop()}}),n,null,[[4,11]])})));return function(e,t){return n.apply(this,arguments)}}()},sendHelpMessage:function(e,t,n){return function(){var r=a(o().mark((function r(i,a){var s,u,l,c;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i({type:x}),s=a().auth.token,r.prev=2,r.next=5,fetch("/messages/help/".concat(t),{method:"POST",headers:{Authorization:"Bearer ".concat(s),"Content-Type":"application/json"},body:JSON.stringify({content:e,help_role:n})});case 5:if((u=r.sent).ok){r.next=11;break}return r.next=9,u.json();case 9:throw l=r.sent,new Error(l.message);case 11:return r.next=13,u.json();case 13:c=r.sent,i(F(c.conversation_id)),r.next=20;break;case 17:r.prev=17,r.t0=r.catch(2),i(U(r.t0));case 20:case"end":return r.stop()}}),r,null,[[2,17]])})));return function(e,t){return r.apply(this,arguments)}}()},markMessagesRead:function(e,t){return function(){var n=a(o().mark((function n(r,i){var a,s,u;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=i().auth.token,n.prev=1,n.next=4,fetch("/messages/help/".concat(e),{method:"PATCH",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify({help_role:t})});case 4:if((s=n.sent).ok){n.next=10;break}return n.next=8,s.json();case 8:throw u=n.sent,new Error(u.message);case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(1),console.log(n.t0);case 15:case"end":return n.stop()}}),n,null,[[1,12]])})));return function(e,t){return n.apply(this,arguments)}}()},clearHelpMessages:function(){return function(){var e=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t({type:C});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},FETCH_HELP_CONVERSATIONS_REQUEST:h,FETCH_HELP_CONVERSATIONS_SUCCESS:d,FETCH_HELP_CONVERSATIONS_FAILURE:p,FETCH_ADMIN_HELP_CONVERSATIONS_REQUEST:m,FETCH_ADMIN_HELP_CONVERSATIONS_SUCCESS:y,FETCH_ADMIN_HELP_CONVERSATIONS_FAILURE:v,FETCH_HELP_MESSAGES_REQUEST:g,FETCH_HELP_MESSAGES_SUCCESS:b,FETCH_HELP_MESSAGES_FAILURE:w,FETCH_ADMIN_HELP_MESSAGES_REQUEST:E,FETCH_ADMIN_HELP_MESSAGES_SUCCESS:S,FETCH_ADMIN_HELP_MESSAGES_FAILURE:_,SEND_HELP_MESSAGE_REQUEST:x,SEND_HELP_MESSAGE_SUCCESS:k,SEND_HELP_MESSAGE_FAILURE:M,CLEAR_HELP_MESSAGES_REQUEST:"CLEAR_HELP_MESSAGES_REQUEST",CLEAR_HELP_MESSAGES_SUCCESS:C,CLEAR_HELP_MESSAGES_FAILURE:"CLEAR_HELP_MESSAGES_FAILURE"}},3983:(e,t,n)=>{"use strict";var r=n(49),o=r.fetchUsers,i=r.fetchUser,a=r.askPasswordReset,s=n(1730),u=s.login,l=s.reLogin,c=s.register,f=s.logout,h=s.checkUsernameAvailable,d=s.checkEmailAvailable,p=s.fullRegister,m=n(9993),y=m.fetchAdminStats,v=m.fetchAllConversationsFromAPI,g=m.createInvitation,b=m.editUsername,w=m.editEmail,E=n(8889),S=E.fetchInvitation,_=E.fetchInvitations,x=E.sendInvitation,k=E.reSendInvitation,M=E.checkInvitationToken,C=E.acceptInvitation,O=E.declineInvitation,T=E.deleteInvitation,A=n(5047),P=A.fetchInquiry,L=A.fetchInquiries,D=A.deleteInquiry,j=A.createInquiry,N=n(2842),I=N.resetChat,R=N.submitMessage,F=N.fetchResponse,U=N.regenAnswer,B=N.getMessages,H=N.getMessageInformation,z=n(6494),q=(z.fetchContracts,z.fetchContract),G=z.signContract,V=n(6841),W=V.fetchConversations,K=V.fetchConversation,$=V.conversationTitleEdit,Q=n(2135),Y=Q.fetchPeople,Z=Q.fetchPerson,J=n(9283),X=J.fetchDocuments,ee=J.fetchDocument,te=J.uploadDocument,ne=J.searchDocument,re=J.createDocument,oe=J.createDocumentSection,ie=J.editDocumentSection,ae=J.editDocument,se=J.deleteDocument,ue=J.fetchDocumentSections,le=J.deleteDocumentSection,ce=n(7434),fe=ce.fetchFiles,he=ce.fetchFile,de=ce.uploadFile,pe=(ce.searchFile,ce.fetchUserFiles),me=n(827),ye=me.fetchUploads,ve=me.fetchUpload,ge=me.searchUploads,be=n(5408).searchGlobal,we=n(2375),Ee=we.createTask,Se=we.fetchTasks,_e=we.fetchTask,xe=n(5606).sendFeedback,ke=n(8301),Me=ke.fetchHelpConversations,Ce=ke.fetchAdminHelpConversations,Oe=ke.fetchHelpMessages,Te=ke.sendHelpMessage,Ae=ke.markMessagesRead,Pe=ke.clearHelpMessages,Le=n(6181),De=Le.syncRedisQueue,je=Le.lastJobTaken,Ne=Le.lastJobCompleted,Ie=Le.clearQueue,Re=n(6263),Fe=Re.fetchKey,Ue=Re.fetchKeys,Be=Re.createKey;e.exports={fetchKey:Fe,fetchKeys:Ue,createKey:Be,fetchContract:q,signContract:G,fetchConversation:K,fetchConversations:W,conversationTitleEdit:$,fetchDocuments:X,fetchDocument:ee,fetchDocumentSections:ue,searchDocument:ne,uploadDocument:te,createDocument:re,createDocumentSection:oe,deleteDocumentSection:le,editDocumentSection:ie,editDocument:ae,deleteDocument:se,fetchFiles:fe,fetchFile:he,uploadFile:de,fetchUserFiles:pe,fetchInquiry:P,fetchInquiries:L,deleteInquiry:D,createInquiry:j,createTask:Ee,fetchInvitation:S,fetchInvitations:_,sendInvitation:x,reSendInvitation:k,checkInvitationToken:M,acceptInvitation:C,declineInvitation:O,deleteInvitation:T,fetchPeople:Y,fetchPerson:Z,fetchResponse:F,fetchTask:_e,fetchTasks:Se,fetchUploads:ye,fetchUpload:ve,searchUploads:ge,fetchAdminStats:y,fetchAllConversationsFromAPI:v,login:u,logout:f,reLogin:l,register:c,fullRegister:p,checkUsernameAvailable:h,checkEmailAvailable:d,createInvitation:g,editUsername:b,editEmail:w,resetChat:I,submitMessage:R,regenAnswer:U,getMessages:B,getMessageInformation:H,fetchUsers:o,fetchUser:i,askPasswordReset:a,searchGlobal:be,sendFeedback:xe,fetchHelpConversations:Me,fetchAdminHelpConversations:Ce,fetchHelpMessages:Oe,sendHelpMessage:Te,markMessagesRead:Ae,clearHelpMessages:Pe,syncRedisQueue:De,lastJobTaken:je,lastJobCompleted:Ne,clearQueue:Ie}},5047:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(2412).fetchFromAPI;function u(e){return l.apply(this,arguments)}function l(){return(l=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s("/inquiries",null,t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var c="FETCH_INQUIRIES_REQUEST",f="FETCH_INQUIRIES_SUCCESS",h="FETCH_INQUIRIES_FAILURE",d="FETCH_INQUIRY_REQUEST",p="FETCH_INQUIRY_SUCCESS",m="FETCH_INQUIRY_FAILURE",y="DELETE_INQUIRY_REQUEST",v="DELETE_INQUIRY_SUCCESS",g="DELETE_INQUIRY_FAILURE",b="CREATE_INQUIRY_REQUEST",w="CREATE_INQUIRY_SUCCESS",E="CREATE_INQUIRY_FAILURE",S=function(e){return{type:f,payload:e,loading:!1}},_=function(e){return{type:h,payload:e,loading:!1}},x=function(e){return{type:p,payload:e,loading:!1}},k=function(e){return{type:m,payload:e,loading:!1}},M=function(e){return{type:v,payload:e}},C=function(e){return{type:g,payload:e}},O=function(e){return{type:E,payload:e}};e.exports={fetchInquiry:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:d,loading:!0}),i=r().auth.token.token,t.prev=2,t.next=5,s("/inquiries/".concat(e),null,i);case 5:a=t.sent,n(x(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(k(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},fetchInquiries:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:c,loading:!0}),r=n().auth.token,e.prev=2,e.next=5,u(r);case 5:i=e.sent,t(S(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(_(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},deleteInquiry:function(e){return function(){var t=a(o().mark((function t(n){var r,i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:y}),t.prev=1,t.next=4,fetch("/inquiries/delete/".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}});case 4:if((r=t.sent).ok){t.next=10;break}return t.next=8,r.json();case 8:throw i=t.sent,new Error(i.message||"Server error");case 10:return t.next=12,r.json();case 12:a=t.sent,n(M(a)),t.next=20;break;case 16:t.prev=16,t.t0=t.catch(1),console.log("Error updating invitation status:",t.t0.message),n(C(t.t0.message));case 20:case"end":return t.stop()}}),t,null,[[1,16]])})));return function(e){return t.apply(this,arguments)}}()},createInquiry:function(e){return function(){var t=a(o().mark((function t(n){var r,i,a,s,u;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:b}),t.prev=1,r=fetch("/inquiries",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})}),i=new Promise((function(e,t){setTimeout((function(){t(new Error("Error joining the waitlist. Please check your internet connection."))}),15e3)})),t.t0=Promise,t.t1=new Promise((function(e,t){setTimeout(e,1500)})),t.next=8,Promise.race([r,i]);case 8:return t.t2=t.sent,t.t3=[t.t1,t.t2],t.next=12,t.t0.all.call(t.t0,t.t3);case 12:if(a=t.sent,(s=a[1]).ok){t.next=19;break}return t.next=17,s.json();case 17:throw u=t.sent,new Error(u.message);case 19:n({type:w,payload:s}),t.next=25;break;case 22:t.prev=22,t.t4=t.catch(1),n(O(t.t4.message));case 25:case"end":return t.stop()}}),t,null,[[1,22]])})));return function(e){return t.apply(this,arguments)}}()},FETCH_INQUIRY_REQUEST:d,FETCH_INQUIRY_SUCCESS:p,FETCH_INQUIRY_FAILURE:m,FETCH_INQUIRIES_REQUEST:c,FETCH_INQUIRIES_SUCCESS:f,FETCH_INQUIRIES_FAILURE:h,CREATE_INQUIRY_REQUEST:b,CREATE_INQUIRY_SUCCESS:w,CREATE_INQUIRY_FAILURE:E,DELETE_INQUIRY_REQUEST:y,DELETE_INQUIRY_SUCCESS:v,DELETE_INQUIRY_FAILURE:g}},8889:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(2412).fetchFromAPI;function u(e){return l.apply(this,arguments)}function l(){return(l=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s("/invitations",null,t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var c=n(4641),f="FETCH_INVITATIONS_REQUEST",h="FETCH_INVITATIONS_SUCCESS",d="FETCH_INVITATIONS_FAILURE",p="FETCH_INVITATION_REQUEST",m="FETCH_INVITATION_SUCCESS",y="FETCH_INVITATION_FAILURE",v="SEND_INVITATION_REQUEST",g="SEND_INVITATION_SUCCESS",b="SEND_INVITATION_FAILURE",w="ACCEPT_INVITATION_REQUEST",E="ACCEPT_INVITATION_SUCCESS",S="ACCEPT_INVITATION_FAILURE",_="DECLINE_INVITATION_REQUEST",x="DECLINE_INVITATION_SUCCESS",k="DECLINE_INVITATION_FAILURE",M="DELETE_INVITATION_REQUEST",C="DELETE_INVITATION_SUCCESS",O="DELETE_INVITATION_FAILURE",T="CHECK_INVITATION_TOKEN_REQUEST",A="CHECK_INVITATION_TOKEN_SUCCESS",P="CHECK_INVITATION_TOKEN_FAILURE",L=function(e){return{type:h,payload:e,loading:!1}},D=function(e){return{type:d,payload:e,loading:!1}},j=function(e){return{type:m,payload:e,loading:!1}},N=function(e){return{type:y,payload:e,loading:!1}},I=function(){return{type:v,loading:!0}},R=function(e){return{type:g,payload:e}},F=function(e){return{type:b,payload:e}},U=function(e){return{type:A,payload:e.invitation}},B=function(e){return{type:P,payload:e}},H=function(e){return{type:E,payload:e}},z=function(e){return{type:S,payload:e}},q=function(e){return{type:x,payload:e}},G=function(e){return{type:k,payload:e}},V=function(e){return{type:C,payload:e}},W=function(e){return{type:O,payload:e}};e.exports={fetchInvitation:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:p,loading:!0}),i=r().auth.token,t.prev=2,t.next=5,s("/invitations/".concat(e),null,i);case 5:a=t.sent,n(j(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(N(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},fetchInvitations:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:f,loading:!0}),r=n().auth.token,e.prev=2,e.next=5,u(r);case 5:i=e.sent,t(L(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(D(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},sendInvitation:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a,s,u,l,f;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n(I()),i=r().auth.token,t.prev=2,a=c(6e4,"Fetch timed out"),s=fetch("/invitations",{method:"POST",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify({email:e})}),t.next=7,Promise.race([a,s]);case 7:if((u=t.sent).ok){t.next=13;break}return t.next=11,u.json();case 11:throw l=t.sent,new Error(l.message||"Server error");case 13:return t.next=15,u.json();case 15:f=t.sent,n(R(f)),t.next=22;break;case 19:t.prev=19,t.t0=t.catch(2),n(F(t.t0));case 22:case"end":return t.stop()}}),t,null,[[2,19]])})));return function(e,n){return t.apply(this,arguments)}}()},reSendInvitation:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a,s,u,l,f;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n(I()),i=r().auth.token,t.prev=2,a=c(6e4,"Fetch timed out"),s=fetch("/invitations/".concat(e),{method:"PATCH",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}}),t.next=7,Promise.race([a,s]);case 7:if((u=t.sent).ok){t.next=13;break}return t.next=11,u.json();case 11:throw l=t.sent,new Error(l.message||"Server error");case 13:return t.next=15,u.json();case 15:f=t.sent,n(R(f)),t.next=22;break;case 19:t.prev=19,t.t0=t.catch(2),n(F(t.t0));case 22:case"end":return t.stop()}}),t,null,[[2,19]])})));return function(e,n){return t.apply(this,arguments)}}()},checkInvitationToken:function(e){return function(){var t=a(o().mark((function t(n){var r,i,a,s,u;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:T}),t.prev=1,r=c(15e3,"Error: Please check your internet connection"),i=fetch("/checkInvitationToken/".concat(e),{method:"POST",headers:{"Content-Type":"application/json"}}),t.next=6,Promise.race([r,i]);case 6:if((a=t.sent).ok){t.next=12;break}return t.next=10,a.json();case 10:throw s=t.sent,new Error(s.message||"Server error");case 12:return t.next=14,a.json();case 14:u=t.sent,n(U(u)),t.next=21;break;case 18:t.prev=18,t.t0=t.catch(1),n(B(t.t0.message));case 21:case"end":return t.stop()}}),t,null,[[1,18]])})));return function(e){return t.apply(this,arguments)}}()},acceptInvitation:function(e){return function(){var t=a(o().mark((function t(n){var r,i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:w}),t.prev=1,t.next=4,fetch("/invitations/accept/".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}});case 4:if((r=t.sent).ok){t.next=10;break}return t.next=8,r.json();case 8:throw i=t.sent,new Error(i.message||"Server error");case 10:return t.next=12,r.json();case 12:a=t.sent,n(H(a)),t.next=20;break;case 16:t.prev=16,t.t0=t.catch(1),console.log("Error updating invitation status:",t.t0.message),n(z(t.t0.message));case 20:case"end":return t.stop()}}),t,null,[[1,16]])})));return function(e){return t.apply(this,arguments)}}()},declineInvitation:function(e){return function(){var t=a(o().mark((function t(n){var r,i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:_}),t.prev=1,t.next=4,fetch("/invitations/decline/".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}});case 4:if((r=t.sent).ok){t.next=10;break}return t.next=8,r.json();case 8:throw i=t.sent,new Error(i.message||"Server error");case 10:return t.next=12,r.json();case 12:a=t.sent,n(q(a)),t.next=20;break;case 16:t.prev=16,t.t0=t.catch(1),console.log("Error updating invitation status:",t.t0.message),n(G(t.t0.message));case 20:case"end":return t.stop()}}),t,null,[[1,16]])})));return function(e){return t.apply(this,arguments)}}()},deleteInvitation:function(e){return function(){var t=a(o().mark((function t(n){var r,i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:M}),t.prev=1,t.next=4,fetch("/invitations/delete/".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}});case 4:if((r=t.sent).ok){t.next=10;break}return t.next=8,r.json();case 8:throw i=t.sent,new Error(i.message||"Server error");case 10:return t.next=12,r.json();case 12:a=t.sent,n(V(a)),t.next=20;break;case 16:t.prev=16,t.t0=t.catch(1),console.log("Error deleting invitation:",t.t0.message),n(W(t.t0.message));case 20:case"end":return t.stop()}}),t,null,[[1,16]])})));return function(e){return t.apply(this,arguments)}}()},FETCH_INVITATION_REQUEST:p,FETCH_INVITATION_SUCCESS:m,FETCH_INVITATION_FAILURE:y,FETCH_INVITATIONS_REQUEST:f,FETCH_INVITATIONS_SUCCESS:h,FETCH_INVITATIONS_FAILURE:d,SEND_INVITATION_REQUEST:v,SEND_INVITATION_SUCCESS:g,SEND_INVITATION_FAILURE:b,CHECK_INVITATION_TOKEN_REQUEST:T,CHECK_INVITATION_TOKEN_SUCCESS:A,CHECK_INVITATION_TOKEN_FAILURE:P,ACCEPT_INVITATION_REQUEST:w,ACCEPT_INVITATION_SUCCESS:E,ACCEPT_INVITATION_FAILURE:S,DECLINE_INVITATION_REQUEST:_,DECLINE_INVITATION_SUCCESS:x,DECLINE_INVITATION_FAILURE:k,DELETE_INVITATION_REQUEST:M,DELETE_INVITATION_SUCCESS:C,DELETE_INVITATION_FAILURE:O}},2135:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(2412).fetchFromAPI;function u(e){return l.apply(this,arguments)}function l(){return(l=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s("/people",null,t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var c="FETCH_PEOPLE_REQUEST",f="FETCH_PEOPLE_SUCCESS",h="FETCH_PEOPLE_FAILURE",d="FETCH_PERSON_REQUEST",p="FETCH_PERSON_SUCCESS",m="FETCH_PERSON_FAILURE",y=function(e){return{type:f,payload:e,loading:!1}},v=function(e){return{type:h,payload:e,loading:!1}},g=function(e){return{type:p,payload:e,loading:!1}},b=function(e){return{type:m,payload:e,loading:!1}};e.exports={fetchPerson:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:d,loading:!0}),i=r().auth.token.token,t.prev=2,t.next=5,s("/people/".concat(e),null,i);case 5:a=t.sent,n(g(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(b(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},fetchPeople:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:c,loading:!0}),r=n().auth.token,e.prev=2,e.next=5,u(r);case 5:i=e.sent,t(y(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(v(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},FETCH_PERSON_REQUEST:d,FETCH_PERSON_SUCCESS:p,FETCH_PERSON_FAILURE:m,FETCH_PEOPLE_REQUEST:c,FETCH_PEOPLE_SUCCESS:f,FETCH_PEOPLE_FAILURE:h}},6181:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(2412).fetchFromAPI;function u(e){return l.apply(this,arguments)}function l(){return(l=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s("/redis/queue",null,t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var c="SYNC_REDIS_QUEUE_REQUEST",f="SYNC_REDIS_QUEUE_SUCCESS",h="SYNC_REDIS_QUEUE_FAILURE",d="LAST_JOB_TAKEN_REQUEST",p="LAST_JOB_TAKEN_SUCCESS",m="LAST_JOB_TAKEN_FAILURE",y="LAST_JOB_COMPLETED_REQUEST",v="LAST_JOB_COMPLETED_SUCCESS",g="LAST_JOB_COMPLETED_FAILURE",b=function(e){return{type:f,payload:e,loading:!1}},w=function(e){return{type:h,payload:e,loading:!1}},E=function(e){return{type:p,payload:e}},S=function(e){return{type:m,payload:e}},_=function(e){return{type:v,payload:e}},x=function(e){return{type:g,payload:e}},k=function(e){return{type:"CLEAR_QUEUE_SUCCESS",payload:e}},M=function(e){return{type:"CLEAR_QUEUE_FAILURE",payload:e}};e.exports={syncRedisQueue:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:c,loading:!0}),r=n().auth.token,e.prev=2,e.next=5,u(r);case 5:i=e.sent,t(b(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(w(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},lastJobTaken:function(e){return function(){var t=a(o().mark((function t(n){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n({type:d,loading:!0});try{n(E(e))}catch(e){n(S(e))}case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},lastJobCompleted:function(e){return function(){var t=a(o().mark((function t(n){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n({type:y,loading:!0});try{n(_(e))}catch(e){n(x(e))}case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},clearQueue:function(){return function(){var e=a(o().mark((function e(t,n){var r,i,a,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:"CLEAR_QUEUE_REQUEST",loading:!0}),r=n().auth.token,e.prev=2,e.next=5,fetch("/redis/queue",{method:"DELETE",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"}});case 5:if((i=e.sent).ok){e.next=11;break}return e.next=9,i.json();case 9:throw a=e.sent,new Error(a.message||"Server error");case 11:return e.next=13,i.json();case 13:s=e.sent,t(k(s)),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(2),t(M(e.t0));case 20:case"end":return e.stop()}}),e,null,[[2,17]])})));return function(t,n){return e.apply(this,arguments)}}()},SYNC_REDIS_QUEUE_REQUEST:c,SYNC_REDIS_QUEUE_SUCCESS:f,SYNC_REDIS_QUEUE_FAILURE:h,LAST_JOB_TAKEN_REQUEST:d,LAST_JOB_TAKEN_SUCCESS:p,LAST_JOB_TAKEN_FAILURE:m,LAST_JOB_COMPLETED_REQUEST:y,LAST_JOB_COMPLETED_SUCCESS:v,LAST_JOB_COMPLETED_FAILURE:g}},5408:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}n(2412).fetchFromAPI;var a="SEARCH_GLOBAL_REQUEST",s="SEARCH_GLOBAL_SUCCESS",u="SEARCH_GLOBAL_FAILURE",l=function(e){return{type:s,payload:e}},c=function(e){return{type:u,payload:e}};e.exports={searchGlobal:function(e){return function(){var t,n=(t=o().mark((function t(n,r){var i,s,u,f,h;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:a}),i=r().auth.token,t.prev=2,s=fetch("/",{method:"SEARCH",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify({query:e})}),u=new Promise((function(e,t){setTimeout((function(){t(new Error("Fetch timed out"))}),15e3)})),t.next=7,Promise.race([u,s]);case 7:return f=t.sent,t.next=10,f.json();case 10:h=t.sent,n(l(h)),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(2),n(c(t.t0));case 17:case"end":return t.stop()}}),t,null,[[2,14]])})),function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))});return function(e,t){return n.apply(this,arguments)}}()},SEARCH_GLOBAL_REQUEST:a,SEARCH_GLOBAL_SUCCESS:s,SEARCH_GLOBAL_FAILURE:u}},2375:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function u(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){u(i,r,o,a,s,"next",e)}function s(e){u(i,r,o,a,s,"throw",e)}a(void 0)}))}}var c=n(2412).fetchFromAPI;function f(e){return h.apply(this,arguments)}function h(){return(h=l(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c("/tasks",null,t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var d="FETCH_TASKS_REQUEST",p="FETCH_TASKS_SUCCESS",m="FETCH_TASKS_FAILURE",y="FETCH_TASK_REQUEST",v="FETCH_TASK_SUCCESS",g="FETCH_TASK_FAILURE",b="CREATE_TASK_REQUEST",w="CREATE_TASK_SUCCESS",E="CREATE_TASK_FAILURE",S=function(e){return{type:p,payload:e,loading:!1}},_=function(e){return{type:m,payload:e,loading:!1}},x=function(e){return{type:v,payload:e,loading:!1}},k=function(e){return{type:g,payload:e,loading:!1}},M=function(e){return{type:E,payload:e}};e.exports={fetchTask:function(e){return function(){var t=l(s().mark((function t(n,r){var o,i;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:y,loading:!0}),o=r().auth.token,t.prev=2,t.next=5,c("/tasks/".concat(e),null,o);case 5:i=t.sent,n(x(i)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(k(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},fetchTasks:function(){return function(){var e=l(s().mark((function e(t,n){var r,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:d,loading:!0}),r=n().auth.token,e.prev=2,e.next=5,f(r);case 5:o=e.sent,t(S(o)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(_(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},createTask:function(e){return function(){var t=l(s().mark((function t(n,r){var o,a,u,l,c;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:b,payload:e}),o=r().auth.token,t.prev=2,a=fetch("/tasks",{method:"POST",headers:{Authorization:o?"Bearer ".concat(o):void 0,"Content-Type":"application/json"},body:JSON.stringify(i({},e))}),u=new Promise((function(e,t){setTimeout((function(){t(new Error("Could not create task. Please try again."))}),6e4)})),t.next=7,Promise.race([u,a]);case 7:if((l=t.sent).ok){t.next=13;break}return t.next=11,l.json();case 11:throw c=t.sent,new Error(c.message);case 13:n({type:w}),t.next=19;break;case 16:t.prev=16,t.t0=t.catch(2),n(M(t.t0));case 19:case"end":return t.stop()}}),t,null,[[2,16]])})));return function(e,n){return t.apply(this,arguments)}}()},FETCH_TASK_REQUEST:y,FETCH_TASK_SUCCESS:v,FETCH_TASK_FAILURE:g,FETCH_TASKS_REQUEST:d,FETCH_TASKS_SUCCESS:p,FETCH_TASKS_FAILURE:m,CREATE_TASK_REQUEST:b,CREATE_TASK_SUCCESS:w,CREATE_TASK_FAILURE:E}},827:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(2412).fetchFromAPI;function u(e){return l.apply(this,arguments)}function l(){return(l=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s("/files",null,t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var c="FETCH_UPLOADS_REQUEST",f="FETCH_UPLOADS_SUCCESS",h="FETCH_UPLOADS_FAILURE",d="FETCH_UPLOAD_REQUEST",p="FETCH_UPLOAD_SUCCESS",m="FETCH_UPLOAD_FAILURE",y="SEARCH_UPLOAD_REQUEST",v="SEARCH_UPLOAD_SUCCESS",g="SEARCH_UPLOAD_FAILURE",b=function(e){return{type:f,payload:e,loading:!1}},w=function(e){return{type:h,payload:e,loading:!1}},E=function(e){return{type:p,payload:e,loading:!1}},S=function(e){return{type:m,payload:e,loading:!1}},_=function(e){return{type:g,payload:e}};e.exports={fetchUpload:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:d,loading:!0}),i=r().auth.token,t.prev=2,t.next=5,s("/files/".concat(e),null,i);case 5:a=t.sent,n(E(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(S(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},fetchUploads:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:c,loading:!0}),r=n().auth.token,e.prev=2,e.next=5,u(r);case 5:i=e.sent,t(b(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(w(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},searchUploads:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:y}),r().auth.token,t.prev=2,t.next=5,fetch("/files",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"SEARCH",body:JSON.stringify({query:e})});case 5:return i=t.sent,t.next=8,i.json();case 8:a=t.sent,console.debug("fetch result: ",a),n((o=a.content,{type:v,payload:o})),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(2),console.error("Error fetching data:",t.t0),n(_(t.t0.message));case 17:case"end":return t.stop()}var o}),t,null,[[2,13]])})));return function(e,n){return t.apply(this,arguments)}}()},FETCH_UPLOAD_REQUEST:d,FETCH_UPLOAD_SUCCESS:p,FETCH_UPLOAD_FAILURE:m,SEARCH_UPLOAD_REQUEST:y,SEARCH_UPLOAD_SUCCESS:v,SEARCH_UPLOAD_FAILURE:g,FETCH_UPLOADS_REQUEST:c,FETCH_UPLOADS_SUCCESS:f,FETCH_UPLOADS_FAILURE:h}},6263:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}var s=n(2412).fetchFromAPI;function u(e){return l.apply(this,arguments)}function l(){return(l=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s("/keys",null,t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var c="FETCH_KEYS_REQUEST",f="FETCH_KEYS_SUCCESS",h="FETCH_KEYS_FAILURE",d="FETCH_KEY_REQUEST",p="FETCH_KEY_SUCCESS",m="FETCH_KEY_FAILURE",y="CREATE_KEY_REQUEST",v="CREATE_KEY_SUCCESS",g="CREATE_KEY_FAILURE",b=function(e){return{type:f,payload:e,loading:!1}},w=function(e){return{type:h,payload:e,loading:!1}},E=function(e){return{type:p,payload:e,loading:!1}},S=function(e){return{type:m,payload:e,loading:!1}},_=function(e){return{type:g,payload:e}};e.exports={fetchKey:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:d,loading:!0}),i=r().auth.token,t.prev=2,t.next=5,s("/keys/".concat(e),null,i);case 5:a=t.sent,n(E(a)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),n(S(t.t0));case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()},fetchKeys:function(){return function(){var e=a(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:c,loading:!0}),r=n().auth.token,e.prev=2,e.next=5,u(r);case 5:i=e.sent,t(b(i)),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),t(w(e.t0));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},createKey:function(e){return function(){var t=a(o().mark((function t(n,r){var i,a,s,u;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:y,payload:e}),r().auth.token,t.prev=2,i=fetch("/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({task:e})}),a=new Promise((function(e,t){setTimeout((function(){t(new Error("Could not create task. Please try again."))}),6e4)})),t.next=7,Promise.race([a,i]);case 7:if((s=t.sent).ok){t.next=13;break}return t.next=11,s.json();case 11:throw u=t.sent,new Error(u.message);case 13:n({type:v}),t.next=19;break;case 16:t.prev=16,t.t0=t.catch(2),n(_(t.t0));case 19:case"end":return t.stop()}}),t,null,[[2,16]])})));return function(e,n){return t.apply(this,arguments)}}()},FETCH_KEY_REQUEST:d,FETCH_KEY_SUCCESS:p,FETCH_KEY_FAILURE:m,FETCH_KEYS_REQUEST:c,FETCH_KEYS_SUCCESS:f,FETCH_KEYS_FAILURE:h,CREATE_KEY_REQUEST:y,CREATE_KEY_SUCCESS:v,CREATE_KEY_FAILURE:g}},3799:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),u(e=function(e,t,n){return t=a(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}(this,t,[n]),"scrollToBottom",(function(){var t=e.messagesEndRef.current;t&&(t.scrollTop=t.scrollHeight)})),u(e,"handleInputChange",(function(t){e.setState(u({},t.target.name,t.target.value))})),u(e,"handleKeyDown",(function(t){"Enter"===t.key&&(e.sendMessage(),t.preventDefault())})),u(e,"sendMessage",(function(){var t=e.state,n=t.messageQuery,r=t.conversation_id;""!==n&&(e.setState({sending:!0}),console.log(n),e.props.sendHelpMessage(n,r,"admin"),e.setState({messageQuery:""}))})),u(e,"handleIconClick",(function(){e.sendMessage()})),e.state={open:!0,messageQuery:"",sending:!1,conversation_id:0},e.messagesEndRef=c.createRef(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(t,e),n=t,(l=[{key:"componentDidMount",value:function(){var e=this.props.conversationID;e&&(this.setState({conversation_id:e}),this.props.fetchHelpMessages(e,!0)),this.scrollToBottom()}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.help,r=t.conversationID;e.conversationID==r||this.state.sending||(this.setState({conversation_id:r}),this.props.fetchHelpMessages(r,!0),this.scrollToBottom()),e.help!=n&&!n.sending&&n.sentSuccess&&this.state.sending&&(this.setState({sending:!1,conversation_id:n.conversation_id}),this.props.fetchHelpMessages(n.conversation_id,!0),this.scrollToBottom(),this.props.fetchHelpConversations()),e.help.admin_messages.length!=n.admin_messages.length&&this.scrollToBottom()}},{key:"render",value:function(){var e=this.props.help,t=this.state.conversation_id;return c.createElement("section",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"}},c.createElement(m,{visible:!e.loadingMsgsAdmin,animation:"fade",duration:1e3},c.createElement("div",{className:"help-chat-feed",style:{overflowY:"auto",scrollBehavior:"smooth",maxWidth:"100%"},ref:this.messagesEndRef},e&&e.admin_messages&&e.admin_messages.length>0&&0!=t?e.admin_messages.map((function(e){return"user"===e.help_role?c.createElement("p",{id:e.id,className:"help-admin-msg"},e.content):c.createElement("p",{id:e.id,className:"help-user-msg"},e.content)})):c.createElement("p",{className:"help-welcome-msg"},"What can we do to help you?"))),c.createElement(p,{placeholder:"Write your message...",name:"messageQuery",onChange:this.handleInputChange,onKeyDown:this.handleKeyDown,value:this.state.messageQuery,icon:!0,style:{flex:"0 0 auto",width:"100%"}},c.createElement("input",null),c.createElement(d,{name:"send",onClick:this.handleIconClick,style:{cursor:"pointer"},link:!0})))}},{key:"toHTML",value:function(){return f.renderToString(this.render())}}])&&o(n.prototype,l),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,l}(c.Component);e.exports=y},5670:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?f.createElement(y,{style:{flex:1,overflowY:"auto",width:"50%",minHeight:"55vh",maxHeight:"55vh",padding:"0",marginBottom:"0",overflowX:"hidden"}},f.createElement("div",{style:{maxWidth:"100%"}},f.createElement(d,{loading:i.loading,vertical:!0,fluid:!0,style:{border:"none"}},i.admin_conversations.filter((function(t){return e.state.showAll||e.state.showUnread&&"user"===t.last_message.help_role&&0===t.last_message.is_read})).map((function(t){return f.createElement(d.Item,{key:t.id,onClick:function(){e.openConversation(t.id),e.props.resetHelpUpdated()},style:{display:"flex",flexDirection:"row",gap:"2em",alignItems:"center"}},f.createElement(p,{name:"user"===t.last_message.help_role&&1===t.last_message.is_read||"admin"===t.last_message.help_role?"envelope open outline":"envelope",color:"user"===t.last_message.help_role&&1===t.last_message.is_read||"admin"===t.last_message.help_role?"grey":void 0,size:"big"}),f.createElement("div",{style:{maxWidth:"40vw"}},f.createElement("p",{className:"help-adm-conversation",style:{margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"70%"}},t.last_message.content),f.createElement("p",{className:"help-adm-conversation",style:{margin:"0",fontStyle:"italic",fontSize:"0.8em"}},e.formatDateTime(t.last_message.created_at)),f.createElement("p",null,"Username: ",f.createElement("span",{style:{color:"#336699"}},t.creator_username),"- ID: ",f.createElement("span",{style:{color:"#336699"}},t.creator_id),"- Name: ",f.createElement("span",{style:{color:"#336699"}},t.creator_first_name))))}))))):f.createElement("h5",null,"You dont have any conversation yet"),f.createElement(y,{style:{flex:1,overflowY:"auto",width:"50%",height:"100%",maxHeight:"55vh",marginTop:"0"}},r&&f.createElement(b,o({},this.props,{conversationID:n})))))}}])&&i(n.prototype,c),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,c}(f.Component);e.exports=w},7233:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,u,"next",e)}function u(e){a(i,r,o,s,u,"throw",e)}s(void 0)}))}}function u(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n{"use strict";var r=n(8287).Buffer;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(){i=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&r.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(i,a,s,u){var l=d(e[i],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==o(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var i;a(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,u,"next",e)}function u(e){a(i,r,o,s,u,"throw",e)}s(void 0)}))}}function u(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n0&&l.createElement(Message.Group,null,t.map((function(e,t){return l.createElement(Message,{key:t,info:!0,style:o,className:"slide-down"},l.createElement(Message.Header,null,l.createElement("span",{dangerouslySetInnerHTML:{__html:marked.parse(e.title)}})),l.createElement(Message.Content,null,l.createElement("span",{dangerouslySetInnerHTML:{__html:marked.parse(e.body)}})))}))),l.createElement("h2",null,"Releases"),l.createElement("ul",null,l.createElement("li",null,"1.0.0-RC1: Exclusive access!")))}}])&&o(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(l.Component);e.exports=c},2119:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&(r=n[0],i.isValidFileType(r.type)?(console.debug("File selected:",r.name,r.size,r.type),i.setState({file:r,formatError:!1,attachmentExists:!0}),i.handleUpload()):i.setState({formatError:!0,file:null}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),p(i,"handleSaveEditing",a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.setState({editLoading:!0}),e.next=3,new Promise((function(e){return setTimeout(e,1500)}));case 3:return e.next=5,i.props.conversationTitleEdit(i.props.conversationID,i.state.editedTitle);case 5:i.setState({editingTitle:!1,editLoading:!1});case 6:case"end":return e.stop()}}),e)})))),p(i,"handleCancelEditing",(function(){i.setState({editingTitle:!1,editedTitle:""})})),p(i,"handleUpload",a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.setState({uploading:!0,fileExists:!1,file_id:null,formatError:!1,errorMsg:"",uploadSuccess:!1}),console.debug("Uploading:",i.state.file),e.prev=2,e.next=5,i.props.uploadDocument(i.state.file);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.debug("Upload error:",e.t0);case 10:console.debug("Upload complete:",i.props.uploadedDocument);case 11:case"end":return e.stop()}}),e,null,[[2,7]])})))),p(i,"scrollToBottom",(function(){setTimeout((function(){if(i.props.messagesEndRef.current){var e=i.props.messagesEndRef.current.querySelector(".chat-feed").lastElementChild;e&&e.scrollIntoView({behavior:"smooth"})}}),0)})),i.settings=Object.assign({takeFocus:!1},e),i.state={query:"",generatingResponse:!1,reGeneratingResponse:!1,groupedMessages:(null===(n=e.chat)||void 0===n?void 0:n.messages.length)>0?i.groupMessages(e.chat.messages):[],currentDisplayedMessage:{},previousFlag:!1,connectionProblem:!1,copiedStatus:{},windowWidth:window.innerWidth,windowHeight:window.innerHeight,checkingMessageID:0,thumbsUpClicked:!1,thumbsDownClicked:!1,isTextareaFocused:!1,editedTitle:"",editLoading:!1,editingTitle:!1,startedChatting:!1,takeFocus:i.settings.takeFocus||i.props.takeFocus||!1},i.handleSubmit=i.handleSubmit.bind(i),i.handleChangeDropdown=i.handleChangeDropdown.bind(i),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(t,e),n=t,i=[{key:"componentDidMount",value:function(){this.props.takeFocus&&w("#primary-query").focus(),this.props.conversationID&&this.startPolling(this.props.conversationID),window.addEventListener("resize",this.handleResize)}},{key:"componentDidUpdate",value:function(e,t){var n=this.props.chat.messages,r=e.chat.messages[e.chat.messages.length-1],o=n[n.length-1];if(this.props.conversationID&&this.props.conversationID!==e.conversationID&&(this.stopPolling(),this.startPolling(this.props.conversationID)),e.chat.messages.length!==n.length||r&&o&&r.content!==o.content){var i=this.groupMessages(this.props.chat.messages);if(this.setState({groupedMessages:i}),n&&n.length>0){var a=n[n.length-1];a&&a.role&&"assistant"===a.role&&"computing"!==a.status?(this.setState({generatingResponse:!1}),this.setState({reGeneratingResponse:!1}),this.props.getMessageInformation(a.content)):this.setState({generatingResponse:!0})}this.scrollToBottom()}}},{key:"componentWillUnmount",value:function(){this.stopPolling(),this.setState({chat:{message:null,messages:[]},conversations:[],message:null,messages:[]}),window.removeEventListener("resize",this.handleResize)}},{key:"isValidFileType",value:function(e){return g.includes(e)}},{key:"render",value:function(){var e=this,t="".concat(window.location.protocol,"//").concat(window.location.hostname,":").concat(window.location.port),n=this.props.chat,r=n.messages,o=n.message,i=this.state,a=i.loading,s=i.generatingResponse,l=i.reGeneratingResponse,c=i.query,f=i.windowWidth,h=i.windowHeight,d=(i.checkingMessageID,this.props),p=d.isSending,m=d.placeholder,y=(d.homePage,d.announTitle,d.announBody,d.conversationID),w=d.actualConversation,S=d.documentChat,_={display:"flex",flexDirection:"column",alignItems:"left",transition:"height 1s",width:"100%"};r.length>0&&(_=u(u({},_),{},{height:"98%",justifyContent:h<1200||h0?this.state.groupedMessages.map((function(n,o){var i,a;return a="assistant"===n.messages[0].role&&n.messages.length>1?n.messages[n.activeMessageIndex]:n.messages[0],b.createElement(O.Event,{key:a.id,"data-message-id":a.id},b.createElement(O.Content,null,b.createElement(O.Summary,{className:"info-assistant-header"},b.createElement(O.User,null,b.createElement(x,{to:"/users/"+a.author},a.author||a.user_id)," "),b.createElement(O.Date,{as:"abbr",title:a.updated_at,className:"relative"},N(a.updated_at)),"assistant"===a.role&&b.createElement("div",{className:"controls info-icon"},b.createElement(C.Group,{basic:!0,size:"mini"},b.createElement(D,{content:"More information",trigger:b.createElement(C,{icon:!0,onClick:function(t){t.stopPropagation(),e.props.messageInfo(a.id)}},b.createElement(P,{name:"info",color:"blue",style:{cursor:"pointer",marginLeft:"0.5rem"}}))}),n===e.state.groupedMessages[e.state.groupedMessages.length-1]&&"assistant"===a.role&&!l&&!s&&b.createElement(D,{content:"Regenerate this answer",trigger:b.createElement(C,{icon:!0,onClick:e.regenerateAnswer},b.createElement(P,{name:"redo",color:"grey",style:{cursor:"pointer",marginLeft:"1rem"}}))}),"assistant"===a.role&&b.createElement(D,{content:"Copied to clipboard",on:"click",open:e.state.copiedStatus[a.id]||!1,trigger:b.createElement(D,{content:"Copy to clipboard",trigger:b.createElement(C,{onClick:function(t){t.stopPropagation(),e.copyToClipboard(a.id,E.parse(a.content))},icon:!0},b.createElement(P,{name:"clipboard outline"}))})}),b.createElement(D,{content:"Rate this message",trigger:b.createElement(C,{icon:!0,onClick:function(t){t.stopPropagation(),e.props.thumbsDown(a.id)}},b.createElement(P,{name:"thumbs down outline",color:"grey",style:{cursor:"pointer",marginLeft:"1rem"}}))}),b.createElement(D,{content:"Rate this message",trigger:b.createElement(C,{icon:!0,onClick:function(t){t.stopPropagation(),e.props.thumbsUp(a.id)}},b.createElement(P,{name:"thumbs up outline",color:"grey",style:{cursor:"pointer",marginLeft:"0.1rem"}}))})))),b.createElement(O.Extra,{text:!0},"computing"!==a.status&&b.createElement("span",{dangerouslySetInnerHTML:{__html:E.parse((null===(i=a.content)||void 0===i?void 0:i.replace("https://sensemaker.io",t))||"")}})),b.createElement(O.Extra,{text:!0},s&&a.id===r[r.length-1].id&&!l&&b.createElement(A,{size:"small",style:{fontSize:"1em",marginTop:"1.5em"}},b.createElement(P,{name:"spinner",loading:!0}),v," is generating a response..."),l&&n===e.state.groupedMessages[e.state.groupedMessages.length-1]&&b.createElement(A,{size:"small",style:{fontSize:"1em",marginTop:"1.5em"}},b.createElement(P,{name:"spinner",loading:!0})," Sensemaker is trying again..."),b.createElement("div",{className:"answer-controls",text:!0},n.messages.length>1&&b.createElement("div",{className:"answer-navigation"},b.createElement(C,{icon:"angle left",size:"tiny",style:M,basic:!0,onClick:function(){return e.navigateMessage(o,-1)},disabled:0===n.activeMessageIndex}),b.createElement("span",{style:{fontWeight:"bold",color:"grey"}},"".concat(n.activeMessageIndex+1," / ").concat(n.messages.length)),b.createElement(C,{icon:"angle right",size:"tiny",style:M,basic:!0,onClick:function(){return e.navigateMessage(o,1)},disabled:n.activeMessageIndex===n.messages.length-1}))))))})):null),b.createElement(T,{id:"input-control-form",size:"big",onSubmit:this.handleSubmit.bind(this),loading:a},b.createElement(T.Input,null,this.props.includeAttachments&&b.createElement(C,{size:"huge",left:!0,attached:!0,icon:!0,onClick:this.handleAttachmentIntent,loading:this.state.loading,style:{borderBottomLeftRadius:"5px",borderTopLeftRadius:"5px"}},b.createElement("input",{hidden:!0,type:"file",name:"file",accept:g.join(","),onChange:this.handleFileChange}),b.createElement(P,{name:"paperclip",color:"grey",style:{color:(this.state.isTextareaFocused,"grey"),cursor:"pointer"}})),b.createElement(j,{id:"primary-query",className:"prompt-bar",name:"query",required:!0,placeholder:m,onChange:function(t){return e.setState({query:t.target.value})},disabled:p,loading:p,value:c,maxRows:5,onKeyDown:function(t){"Enter"!==t.key||t.shiftKey||(t.preventDefault(),e.handleSubmit(t))},onFocus:this.handleTextareaFocus,onBlur:this.handleTextareaBlur,style:L}),b.createElement(P,{name:"microphone",color:"grey",onClick:function(){return e.handleMicrophoneClick(e)},style:{color:this.state.isTextareaFocused?"grey":"lightgrey"}})))):b.createElement(k,{to:"/conversations/".concat(o.conversation),replace:!0})}}],i&&c(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(b.Component));e.exports=R},9346:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function s(e,t){for(var n=0;nm?d.createElement(g,{size:"tiny",activePage:u,totalPages:Math.ceil(i.length/m),onPageChange:this.handlePaginationChange,ellipsisItem:l>480?void 0:null,boundaryRange:l>480?1:0}):null,d.createElement(_,o({},this.props,{messagesEndRef:this.messagesEndRef,includeFeed:!0,placeholder:"Ask me anything...",resetInformationSidebar:this.props.resetInformationSidebar,messageInfo:this.props.messageInfo,thumbsUp:this.props.thumbsUp,thumbsDown:this.props.thumbsDown}))),i.length>m?d.createElement(g,{size:"tiny",activePage:u,totalPages:Math.ceil(i.length/m),onPageChange:this.handlePaginationChange,ellipsisItem:l>480?void 0:null,boundaryRange:l>480?1:0}):null)}}],h&&s(n.prototype,h),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,h}(d.Component));e.exports=x},4056:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e,t){for(var n=0;n0&&this.renderConversationsSection("Today",l.today),l.yesterday.length>0&&this.renderConversationsSection("Yesterday",l.yesterday),l.last7Days.length>0&&this.renderConversationsSection("Last 7 Days",l.last7Days),l.last30Days.length>0&&this.renderConversationsSection("Last 30 Days",l.last30Days),l.older.length>0&&this.renderConversationsSection("Older",l.older)))}}])&&a(n.prototype,f),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,f}(h.Component);e.exports=g},1178:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=100?(n.completeProgress(),n.setState({isLoading:!1}),clearInterval(n.intervalId)):n.ref.current.continuousStart()}))}),5)})),l(n,"completeProgress",(function(){n.ref.current.complete()})),l(n,"handleSearchChange",(function(e){console.log("search change:",e),n.setState({search:e.target.value})})),l(n,"toggleHelpBox",(function(){n.state.helpBoxOpen||n.props.fetchHelpConversations(),n.setState({helpNotification:!1}),n.setState((function(e){return{helpBoxOpen:!e.helpBoxOpen}}))})),l(n,"toggleInformationSidebar",(function(){n.setState({informationSidebarOpen:!1,checkingMessageID:null,documentSection:!1,documentInfo:null,resetInformationSidebar:!1,thumbsUpClicked:!1,thumbsDownClicked:!1})})),l(n,"closeSidebars",(function(){n.setState({openSectionBar:!1}),n.closeHelpBox(),n.state.informationSidebarOpen&&n.toggleInformationSidebar()})),l(n,"resetInformationSidebar",(function(){n.setState((function(e){return{resetInformationSidebar:!e.resetInformationSidebar}}))})),l(n,"messageInfo",(function(e){var t={thumbsUpClicked:!1,thumbsDownClicked:!1,checkingMessageID:e,informationSidebarOpen:!0,documentSection:!1,documentInfo:null,openSectionBar:!1};!n.state.informationSidebarOpen||e!==n.state.checkingMessageID||n.state.thumbsUpClicked||n.state.thumbsDownClicked||(t.informationSidebarOpen=!1),n.setState(t),n.resetInformationSidebar()})),l(n,"thumbsUp",(function(e){n.setState({thumbsDownClicked:!1,openSectionBar:!1}),n.state.thumbsUpClicked&&n.state.checkingMessageID===e?n.setState({informationSidebarOpen:!1,thumbsUpClicked:!1,thumbsDownClicked:!1}):n.setState({thumbsUpClicked:!0,thumbsDownClicked:!1,documentSection:!1,documentInfo:null,openSectionBar:!1,checkingMessageID:e,informationSidebarOpen:!0}),n.resetInformationSidebar()})),l(n,"thumbsDown",(function(e){n.setState({thumbsUpClicked:!1,openSectionBar:!1}),n.state.thumbsDownClicked&&n.state.checkingMessageID===e?n.setState({informationSidebarOpen:!1,thumbsUpClicked:!1,thumbsDownClicked:!1}):n.setState({thumbsUpClicked:!1,thumbsDownClicked:!0,documentSection:!1,documentInfo:null,openSectionBar:!1,checkingMessageID:e,informationSidebarOpen:!0}),n.resetInformationSidebar()})),l(n,"documentInfoSidebar",(function(e,t){n.setState({openSectionBar:!1}),n.state.documentInfo!==e?n.setState({informationSidebarOpen:!0,checkingMessageID:null,thumbsUpClicked:!1,thumbsDownClicked:!1,documentSection:!0,documentInfo:e,documentSections:t}):n.toggleInformationSidebar(),n.resetInformationSidebar()})),l(n,"handleMenuItemClick",(function(e){var t={openLibrary:!1,openConversations:!1};switch(e){case"home":n.setState({openSectionBar:!1}),n.props.resetChat();break;case"conversations":n.state.openConversations&&n.state.openSectionBar?n.setState({openSectionBar:!1}):(t.openConversations=!0,n.setState({openSectionBar:!0}),n.props.resetChat());break;case"library":n.state.openLibrary&&n.state.openSectionBar?(n.setState({openSectionBar:!1}),t.openLibrary=!0):(t.openLibrary=!0,n.setState({openSectionBar:!0}),n.state.openLibrary||n.props.resetChat());break;default:return void console.error("Unknown menu item")}n.setState(t)})),l(n,"closeHelpBox",(function(){n.setState({helpBoxOpen:!1})})),l(n,"responseCapture",(function(e){var t=n.props.auth,r=t.id,o=t.isAdmin,i=new Audio(k);r==e.creator&&("HelpMsgAdmin"==e.type&&(n.props.fetchHelpConversations(),n.state.helpBoxOpen&&n.props.fetchHelpMessages(e.conversation_id),i.play().catch((function(e){console.error("Failed to play sound: ",e)})),S("You have a message from an assistant!",x)),"IngestFile"==e.type&&(e.completed&&S(f.createElement("p",null,"Your file ",f.createElement("b",null,e.filename)," has been ingested! "),x),n.props.fetchUserFiles(r)),"IngestDocument"==e.type&&o&&S(f.createElement("p",null,'Your document "',e.title,'"" has been ingested! You can check it ',f.createElement("a",{href:"".concat(window.location.protocol,"//").concat(window.location.hostname,":").concat(window.location.port,"/documents/").concat(e.fabric_id)},"Here")),x)),"HelpMsgUser"==e.type&&o&&(n.setState({helpConversationUpdate:e.conversation_id}),n.props.fetchAdminHelpConversations(),"/settings/admin"!==n.props.location.pathname&&(i.play().catch((function(e){console.error("Failed to play sound: ",e)})),S("An user sent a message asking for assistance",x))),"takenJob"==e.type&&(n.props.lastJobTaken(e.job),o&&n.props.syncRedisQueue()),"completedJob"==e.type&&(e.job.status=e.status,n.props.lastJobCompleted(e.job),o&&n.props.syncRedisQueue())})),l(n,"captureFileUpload",(function(e){S("a file has finishing uploading",x)})),n.settings=Object.assign({debug:!1,state:{loading:!1,username:"(guest account)",search:"",sidebarCollapsed:!1,sidebarVisible:!0,progress:0,isLoading:!0,isLoggingOut:!1,openLibrary:!0,openConversations:!1,openSectionBar:!1,helpBoxOpen:!1,helpConversationUpdate:0,informationSidebarOpen:!1,checkingMessageID:0,documentSection:!1,documentInfo:null,documentSections:null,resetInformationSidebar:!1,thumbsUpClicked:!1,thumbsDownClicked:!1,helpNotification:!1,steps:[{target:".my-first-step",content:"This is my awesome feature!"},{target:".my-other-step",content:"This another awesome feature!"}]}},e),n.state=n.settings.state,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(t,e),n=t,(c=[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=(t.location,t.params,t.navigate,this.props.auth.isAdmin);this.props.fetchConversations(),this.props.fetchHelpConversations(),setTimeout((function(){e.setState({isLoading:!1})}),250),n&&this.props.syncRedisQueue()}},{key:"componentDidUpdate",value:function(e){var t=this.props.help;if(e.help!=t)if(t.conversations&&t.conversations.length>0){var n=t.conversations.some((function(e){return"admin"===e.last_message.help_role&&0===e.last_message.is_read}));this.setState({helpNotification:n})}else this.setState({helpNotification:!1})}},{key:"render",value:function(){var e=this,t=this.props.auth&&this.props.auth.isAdmin||!1,n=this.props.auth&&this.props.auth.isAlpha||this.props.auth.isAdmin||!1,r=(this.props.auth&&this.props.auth.isBeta||this.props.auth.isAdmin,this.state),i=r.openSectionBar,a=r.resetInformationSidebar,s=r.checkingMessageID,u=r.thumbsUpClicked,l=r.thumbsDownClicked,c=r.documentSection,h=r.documentInfo,v=r.documentSections,g=r.informationSidebarOpen,b=(r.openLibrary,{margin:"1em 1em 0 1em",marginLeft:i?"1em":"calc(-300px + 1em)",transition:"margin-left 0.5s ease-in-out",maxHeight:"97vh"});return f.createElement("sensemaker-dashboard",{style:{height:"100%"},className:"fade-in"},f.createElement("div",{attached:"bottom",style:{overflowX:"hidden",borderRadius:0,height:"100vh",backgroundColor:"#ffffff",display:"flex"}},f.createElement(D,{as:P,id:"main-sidebar",animation:"overlay",icon:"labeled",inverted:!0,vertical:!0,visible:!0,size:"huge",style:{overflow:"hidden"},onClick:function(){e.toggleInformationSidebar(),e.closeHelpBox()}},f.createElement("div",null,f.createElement(P.Item,{as:d,to:"/",onClick:function(){return e.handleMenuItemClick("home")}},f.createElement(T,{name:"home",size:"large"}),f.createElement("p",{className:"icon-label"},"Home")),z&&n&&f.createElement(P.Item,{as:d,to:"/tasks",onClick:this.closeSidebars},f.createElement(T,{name:"tasks",size:"large"}),f.createElement("p",{className:"icon-label"},"Tasks")),f.createElement(P.Item,{as:d,to:"/conversations",onClick:function(){return e.handleMenuItemClick("conversations")},className:"expand-menu"},f.createElement("div",{className:"col-center"},f.createElement(T,{name:"comment alternate",size:"large"}),f.createElement("p",{className:"icon-label"},"Chat")),f.createElement("div",{className:"expand-icon"},i?null:f.createElement(T,{name:"right chevron",className:"fade-in",size:"small"}))),B&&t&&f.createElement(P.Item,{as:d,to:"/peers",onClick:this.closeSidebars},f.createElement(T,{name:"globe",size:"large"}),f.createElement("p",{className:"icon-label"},"Network")),H&&t&&f.createElement(P.Item,{as:d,to:"/sources",onClick:this.closeSidebars},f.createElement(T,{name:"globe",size:"large"}),f.createElement("p",{className:"icon-label"},"Sources")),q&&t&&f.createElement(P.Item,{as:d,to:"/keys",onClick:this.closeSidebars},f.createElement(T,{name:"bitcoin",size:"large"}),f.createElement("p",{className:"icon-label"},"Wallet")),F&&(n||t)&&f.createElement(P.Item,{as:d,to:"/documents",onClick:this.closeSidebars},f.createElement(T,{name:"book",size:"large"}),f.createElement("p",{className:"icon-label"},"Library"))),f.createElement("div",{style:{flexGrow:1}})," ",f.createElement("div",null,R&&f.createElement(P.Item,{as:d,to:"/updates",onClick:this.closeSidebars},f.createElement(T,{name:"announcement",size:"large"}),f.createElement("p",{className:"icon-label"},"News")),this.props.auth&&this.props.auth.isAdmin?f.createElement(P.Item,{as:d,to:"/settings/admin",id:"adminItem",onClick:this.closeSidebars},f.createElement(T,{name:"key",size:"large"}),f.createElement("p",{className:"icon-label"},"Admin")):null,f.createElement("div",{className:"settings-menu-container"},f.createElement(P.Item,{as:d,to:"/settings",id:"settingsItem",onClick:this.closeSidebars},f.createElement(T,{name:"cog",size:"large"}),f.createElement("p",{className:"icon-label"},"Settings"))))),f.createElement(D,{as:P,animation:"overlay",id:"collapse-sidebar",icon:"labeled",inverted:!0,vertical:!0,visible:i,style:{minWidth:"300px",maxWidth:"300px",position:"relative",display:"flex",flexDirection:"column",justifyContent:"space-between",overflowY:"auto",scrollbarGutter:"stable both-edges"},size:"huge",onClick:function(){e.toggleInformationSidebar(),e.closeHelpBox()}},f.createElement("div",{className:"collapse-sidebar-arrow"},f.createElement(T,{name:"caret left",size:"large",className:"fade-in",style:{cursor:"pointer"},onClick:function(){return e.setState({openSectionBar:!1})}})),f.createElement(P.Item,{as:d,to:"/",style:{paddingBottom:"0em",marginTop:"-1.5em"},onClick:function(){e.setState({openSectionBar:!1}),e.props.resetChat()}},f.createElement(O,{className:"dashboard-header"},f.createElement("div",null,f.createElement("div",null,f.createElement(L,{trigger:f.createElement(T,{name:"help",className:"dashboard-help",onClick:this.toggleHelpBox})},f.createElement(L.Header,null,"Need Help?"),f.createElement(L.Content,null,f.createElement("p",null,"Send us an email: ",f.createElement("a",{href:"mailto:support@sensemaker.io"},"support@sensemaker.io"))))),f.createElement("div",null,f.createElement(L,{trigger:f.createElement(T,{name:"circle",color:"green",size:"tiny"})},f.createElement(L.Content,null,"disconnected")),f.createElement(L,{trigger:f.createElement(A,{color:"black",style:{borderColor:"transparent",backgroundColor:"transparent"}},N)},f.createElement(L.Content,null,I)))))),this.state.openConversations&&f.createElement("section",{className:"fade-in"},f.createElement(X,{resetChat:this.props.resetChat,fetchConversations:this.props.fetchConversations,auth:this.props.auth,conversations:this.props.conversations})),this.state.openLibrary&&f.createElement("section",{className:"fade-in"},f.createElement(ee,{resetChat:this.props.resetChat,fetchConversations:this.props.fetchConversations,auth:this.props.auth,conversations:this.props.conversations,searchGlobal:this.props.searchGlobal,search:this.props.search,closeSidebars:this.closeSidebars})),f.createElement("div",{style:{flexGrow:1}})," ",f.createElement("section",null,f.createElement(P.Item,{style:{borderBottom:0}},f.createElement(me,{responseCapture:this.responseCapture}),f.createElement("p",{style:{marginTop:"2em"}},f.createElement("small",{className:"subtle"},"@FabricLabs")),this.state.debug&&f.createElement("p",null,f.createElement(A,null,f.createElement("strong",null,"Status:")," ",this.props.status||"disconnected"))))),f.createElement(C,{fluid:!0,style:b,onClick:this.closeSidebars},this.state.debug?f.createElement("div",null,f.createElement("strong",null,f.createElement("code",null,"isAdmin"),":")," ",f.createElement("span",null,this.props.isAdmin?"yes":"no"),f.createElement("br",null),f.createElement("strong",null,f.createElement("code",null,"isCompliant"),":")," ",f.createElement("span",null,this.props.isCompliant?"yes":"no"),f.createElement("br",null),f.createElement("strong",null,f.createElement("code",null,"auth"),":")," ",f.createElement("code",null,this.props.auth?JSON.stringify(this.props.auth,null," "):"undefined")):null,this.state.isLoading?null:f.createElement(y,null,f.createElement(m,{path:"*",element:f.createElement(p,{to:"/",replace:!0})}),f.createElement(m,{path:"/",element:f.createElement(G,{auth:this.props.auth,conversations:this.props.conversations,fetchConversations:this.props.fetchConversations,getMessages:this.props.getMessages,submitMessage:this.props.submitMessage,regenAnswer:this.props.regenAnswer,onMessageSuccess:this.props.onMessageSuccess,resetChat:this.props.resetChat,chat:this.props.chat,getMessageInformation:this.props.getMessageInformation,resetInformationSidebar:this.resetInformationSidebar,messageInfo:this.messageInfo,thumbsUp:this.thumbsUp,thumbsDown:this.thumbsDown,uploadFile:this.props.uploadFile,uploadDocument:this.props.uploadDocument})}),f.createElement(m,{path:"/settings/library",element:f.createElement(K,null)}),f.createElement(m,{path:"/updates",element:f.createElement(se,this.props)}),f.createElement(m,{path:"/documents",element:f.createElement($,{documents:this.props.documents,uploadDocument:this.props.uploadDocument,fetchDocuments:this.props.fetchDocuments,searchDocument:this.props.searchDocument,chat:this.props.chat,resetChat:this.props.resetChat,files:this.props.files,uploadFile:this.props.uploadFile}),uploadDocument:this.props.uploadDocument}),f.createElement(m,{path:"/documents/:fabricID",element:f.createElement(Q,o({},this.props,{documents:this.props.documents,fetchDocument:this.props.fetchDocument,resetChat:this.props.resetChat}))}),f.createElement(m,{path:"/conversations/documents/:id",element:f.createElement(Y,o({},this.props,{documentInfoSidebar:this.documentInfoSidebar,resetInformationSidebar:this.resetInformationSidebar,messageInfo:this.messageInfo,thumbsUp:this.thumbsUp,thumbsDown:this.thumbsDown}))}),f.createElement(m,{path:"/people",element:f.createElement(Z,{people:this.props.people,fetchPeople:this.props.fetchPeople,chat:this.props.chat})}),f.createElement(m,{path:"/conversations/:id",element:f.createElement(ue,{conversation:this.props.conversation,conversations:this.props.conversations,fetchConversations:this.props.fetchConversations,fetchConversation:this.props.fetchConversation,chat:this.props.chat,getMessages:this.props.getMessages,submitMessage:this.props.submitMessage,resetChat:this.props.resetChat,regenAnswer:this.props.regenAnswer,getMessageInformation:this.props.getMessageInformation,conversationTitleEdit:this.props.conversationTitleEdit,resetInformationSidebar:this.resetInformationSidebar,messageInfo:this.messageInfo,thumbsUp:this.thumbsUp,thumbsDown:this.thumbsDown,documentInfoSidebar:this.documentInfoSidebar,documents:this.props.documents,fetchDocument:this.props.fetchDocument,fetchDocumentSections:this.props.fetchDocumentSections})}),f.createElement(m,{path:"/conversations",element:f.createElement(J,{users:this.props.users,conversations:this.props.conversations,fetchConversations:this.props.fetchConversations,getMessages:this.props.getMessages,submitMessage:this.props.submitMessage,onMessageSuccess:this.props.onMessageSuccess,chat:this.props.chat,resetChat:this.props.resetChat,regenAnswer:this.props.regenAnswer,auth:this.props.auth,getMessageInformation:this.props.getMessageInformation,resetInformationSidebar:this.resetInformationSidebar,messageInfo:this.messageInfo,thumbsUp:this.thumbsUp,thumbsDown:this.thumbsDown})}),f.createElement(m,{path:"/sources",element:f.createElement(te,o({chat:this.props.chat,getMessages:this.props.getMessages,submitMessage:this.props.submitMessage},this.props))}),f.createElement(m,{path:"/tasks",element:f.createElement(ne,{chat:this.props.chat,fetchResponse:this.props.fetchResponse,getMessages:this.props.getMessages,submitMessage:this.props.submitMessage,getMessageInformation:this.props.getMessageInformation,tasks:this.props.tasks,fetchTasks:this.props.fetchTasks,createTask:this.props.createTask})}),f.createElement(m,{path:"/tasks/:id",element:f.createElement(re,{task:this.props.task})}),f.createElement(m,{path:"/uploads",element:f.createElement(oe,this.props)}),f.createElement(m,{path:"/users/:username",element:f.createElement(ie,this.props)}),f.createElement(m,{path:"/settings/admin/overview",element:f.createElement(ce,o({},this.props,{activeIndex:0,helpConversationUpdate:this.state.helpConversationUpdate,fetchAdminStats:this.props.fetchAdminStats,resetHelpUpdated:function(){return e.setState({helpConversationUpdate:0})}}))}),f.createElement(m,{path:"/settings/admin/announcements",element:f.createElement(ce,o({},this.props,{activeIndex:1,helpConversationUpdate:this.state.helpConversationUpdate,fetchAdminStats:this.props.fetchAdminStats,resetHelpUpdated:function(){return e.setState({helpConversationUpdate:0})}}))}),f.createElement(m,{path:"/settings/admin/settings",element:f.createElement(ce,o({},this.props,{activeIndex:2,helpConversationUpdate:this.state.helpConversationUpdate,fetchAdminStats:this.props.fetchAdminStats,resetHelpUpdated:function(){return e.setState({helpConversationUpdate:0})}}))}),f.createElement(m,{path:"/settings/admin/users",element:f.createElement(ce,o({},this.props,{activeIndex:3,helpConversationUpdate:this.state.helpConversationUpdate,fetchAdminStats:this.props.fetchAdminStats,resetHelpUpdated:function(){return e.setState({helpConversationUpdate:0})}}))}),f.createElement(m,{path:"/settings/admin/growth",element:f.createElement(ce,o({},this.props,{activeIndex:4,helpConversationUpdate:this.state.helpConversationUpdate,fetchAdminStats:this.props.fetchAdminStats,resetHelpUpdated:function(){return e.setState({helpConversationUpdate:0})}}))}),f.createElement(m,{path:"/settings/admin/conversations",element:f.createElement(ce,o({},this.props,{activeIndex:5,helpConversationUpdate:this.state.helpConversationUpdate,fetchAdminStats:this.props.fetchAdminStats,resetHelpUpdated:function(){return e.setState({helpConversationUpdate:0})}}))}),f.createElement(m,{path:"/settings/admin/services",element:f.createElement(ce,o({},this.props,{activeIndex:6,helpConversationUpdate:this.state.helpConversationUpdate,fetchAdminStats:this.props.fetchAdminStats,resetHelpUpdated:function(){return e.setState({helpConversationUpdate:0})}}))}),f.createElement(m,{path:"/settings/admin/design",element:f.createElement(ce,o({},this.props,{activeIndex:7,helpConversationUpdate:this.state.helpConversationUpdate,fetchAdminStats:this.props.fetchAdminStats,resetHelpUpdated:function(){return e.setState({helpConversationUpdate:0})}}))}),f.createElement(m,{path:"/settings/admin",element:f.createElement(ce,o({},this.props,{activeIndex:0,helpConversationUpdate:this.state.helpConversationUpdate,fetchAdminStats:this.props.fetchAdminStats,resetHelpUpdated:function(){return e.setState({helpConversationUpdate:0})}}))}),f.createElement(m,{path:"/settings",element:f.createElement(le,o({},this.props,{auth:this.props.auth,login:this.props.login}))}),f.createElement(m,{path:"/keys",element:f.createElement(ae,o({},this.props,{wallet:this.props.keys,auth:this.props.auth,login:this.props.login}))}),f.createElement(m,{path:"/peers",element:f.createElement(W,o({},this.props,{network:{peers:[]}}))}),f.createElement(m,{path:"/contracts",element:f.createElement(V,o({},this.props,{fetchContract:this.props.fetchContract,fetchContracts:this.props.fetchContracts}))}),f.createElement(m,{path:"/contracts/terms-of-use",element:f.createElement(fe,o({},this.props,{fetchContract:this.props.fetchContract}))})))),U&&f.createElement("div",null,f.createElement("div",{id:"feedback-button"},this.state.helpNotification?f.createElement(T,{size:"big",name:this.state.helpBoxOpen?"close":"bell outline",className:"red jiggle-animation",onClick:function(){return e.toggleHelpBox()}}):f.createElement(T,{size:"big",name:this.state.helpBoxOpen?"close":"question circle outline",className:"grey",onClick:function(){return e.toggleHelpBox()}})),f.createElement(de,{open:this.state.helpBoxOpen,toggleHelpBox:this.toggleHelpBox,feedbackSection:!0,sendFeedback:this.props.sendFeedback,feedback:this.props.feedback}),f.createElement(pe,{open:this.state.helpBoxOpen,fetchHelpConversations:this.props.fetchHelpConversations,fetchHelpMessages:this.props.fetchHelpMessages,sendHelpMessage:this.props.sendHelpMessage,markMessagesRead:this.props.markMessagesRead,clearHelpMessages:this.props.clearHelpMessages,help:this.props.help,notification:this.state.helpNotification,stopNotification:function(){return e.setState({helpNotification:!1})}})),f.createElement(he,{visible:g,toggleInformationSidebar:this.toggleInformationSidebar,resetInformationSidebar:a,checkingMessageID:s,thumbsUpClicked:u,thumbsDownClicked:l,documentSection:c,documentInfo:h,documentSections:v,onClick:function(){e.setState({openSectionBar:!1}),e.closeHelpBox()}}),f.createElement(E,null))}}])&&i(n.prototype,c),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,c}(f.Component);e.exports=function(e){var t=v(),n=g(),r=b();return f.createElement(ye,o({location:t,navigate:r,params:n},e))}},6171:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,u,"next",e)}function u(e){a(i,r,o,s,u,"throw",e)}s(void 0)}))}}function u(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(e=function(e,t,n){return t=s(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,a()?Reflect.construct(t,n||[],s(e).constructor):t.apply(e,n))}(this,t,[n]),"handleSearchChange",f((function(t){e.setState({searching:!0}),e.props.searchDocument(t)}),1e3)),l(e,"toggleCreateDocumentModal",(function(){console.debug("creating document modal...")})),e.state={searchQuery:"",filteredDocuments:[],searching:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(t,e),n=t,c=[{key:"componentDidMount",value:function(){this.props.fetchDocuments()}},{key:"componentDidUpdate",value:function(e){var t=this.props.documents;e.documents!=t&&!t.loading&&this.state.searching&&this.setState({filtereDocuments:t.results,searching:!1})}},{key:"render",value:function(){var e=this,t=this.props,n=t.loading,r=t.documents,i=this.state,a=i.filteredDocuments,s=i.searchQuery,u=i.searching,l=s?a:r;return h.createElement("fabric-document-home",null,h.createElement(g,{className:"fade-in",fluid:!0,style:{maxHeight:"100%"}},h.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},h.createElement("h1",{style:{marginTop:"0"}},"Library"),h.createElement(y.Group,null,h.createElement(y,{icon:!0,color:"green",onClick:this.toggleCreateDocumentModal.bind(this)},"Create Document ",h.createElement(S,{name:"add"})))),h.createElement("p",null,"Search, upload, and manage files."),h.createElement(k,{files:this.props.files,uploadFile:this.props.uploadFile,resetChat:this.props.resetChat,fetchDocuments:this.props.fetchDocuments}),l&&l.documents&&l.documents.length>0?h.createElement("fabric-search",{fluid:!0,placeholder:"Find...",className:"ui search"},h.createElement("div",{className:"ui huge icon fluid input"},h.createElement("input",{name:"query",autoComplete:"off",placeholder:"Find...",type:"text",tabIndex:"0",className:"prompt",onChange:function(t){var n=t.target.value;e.setState({searchQuery:n}),e.handleSearchChange(n)}}),h.createElement("i",{"aria-hidden":"true",className:"search icon"}))):null,h.createElement(w,{as:v.Group,doubling:!0,loading:n,style:{marginTop:"1em",marginBottom:"1em"}},u||r.loading?h.createElement(E,{active:!0,inline:"centered"}):l&&l.documents&&l.documents.length>0?l.documents.slice(0,11).map((function(e){return h.createElement(w.Item,{as:v,key:e.id,loading:"processing"===e.ingestion_status},h.createElement(v.Content,{loading:"processing"===e.ingestion_status},h.createElement("h3",null,h.createElement(p,{to:"/documents/"+e.fabric_id},e.title)),"processing"===e.ingestion_status?h.createElement(_,{icon:!0,size:"tiny"},h.createElement(S,{name:"circle notched",loading:!0}),h.createElement(_.Content,null,h.createElement(_.Header,null,"Your document is being processed..."))):h.createElement("div",null,h.createElement(b.Group,{basic:!0},h.createElement(b,{title:"Creation date"},h.createElement(S,{name:"calendar alternate outline"})," ",h.createElement("abbr",{className:"relative-time",title:e.created_at},e.created_at))),h.createElement("p",{title:e.summary||e.description},e.description))),h.createElement(y.Group,{attached:"bottom"},h.createElement(y,{as:p,to:"/documents/"+e.fabric_id},h.createElement(S,{name:"linkify"})),h.createElement(y,{as:p,to:"/documents/"+e.fabric_id+"#pin"},h.createElement(S,{name:"thumbtack"}))))})):h.createElement("p",null,"You haven't uploaded any documents yet!")),l&&l.documents&&l.documents.length>0?h.createElement(x,o({},this.props,{messagesEndRef:this.messagesEndRef,includeFeed:!1,placeholder:"Ask about these documents...",context:{documents:l},resetInformationSidebar:this.props.resetInformationSidebar,messageInfo:this.props.messageInfo,thumbsUp:this.props.thumbsUp,thumbsDown:this.props.thumbsDown})):null))}},{key:"toHTML",value:function(){return d.renderToString(this.render())}}],c&&i(n.prototype,c),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,c}(h.Component));e.exports=M},6647:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),f(e=function(e,t,n){return t=l(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}(this,t,[n]),"handleFileChange",function(){var t=a(o().mark((function t(n){var r,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.target.files,e.setState({formatError:!1}),r.length>0&&(i=r[0],e.isValidFileType(i.type)?(console.debug("File:",i.name,i.size,i.type),e.setState({file:i,formatError:!1})):e.setState({formatError:!0,file:null}));case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),f(e,"handleUpload",a(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.setState({uploading:!0,fileExists:!1,file_id:null,formatError:!1,errorMsg:"",uploadSuccess:!1}),t.next=3,e.props.uploadFile(e.state.file);case 3:case"end":return t.stop()}}),t)})))),e.state={file:null,fileExists:!1,file_id:null,formatError:!1,uploading:!1,errorMsg:"",uploadSuccess:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),n=t,(i=[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.files,r=t.drafterSection;n!==e.files&&this.state.uploading&&!n.loading&&(n.fileUploaded?(this.setState({uploadSuccess:!0,file_id:n.fileId}),r?this.props.attachFile(this.state.file):this.props.fetchDocuments()):this.setState({errorMsg:n.error}),this.setState({uploading:!1,file:null}))}},{key:"isValidFileType",value:function(e){return d.includes(e)}},{key:"render",value:function(){var e=this,t=this.props.files;return p.createElement(w,{className:"documents-upload-form"},p.createElement(w.Field,null,p.createElement("div",{style:{maxWidth:"500px",gap:"0.5em",display:"flex"}},p.createElement(b,{type:"file",name:"file",accept:d.join(","),onChange:this.handleFileChange,style:{cursor:"pointer"}}),p.createElement(g,{icon:"upload",disabled:!this.state.file,onClick:function(){return e.handleUpload()},loading:t.loading},"Upload"))),this.state.formatError&&p.createElement(w.Field,null,p.createElement(E,{negative:!0,content:"File format not allowed. Please upload PNG, JPG, TIFF, BMP, PDF"})),this.state.errorMsg&&p.createElement(w.Field,null,p.createElement(E,{negative:!0,content:this.state.errorMsg})),this.state.uploadSuccess&&p.createElement(w.Field,null,this.props.drafterSection?p.createElement(E,{positive:!0},p.createElement(E.Content,null,"Document attached successfully!")):p.createElement(E,{positive:!0},p.createElement(E.Header,null,"Document uploaded successfully!"),p.createElement(E.Content,null,"Sensemaker is processing your upload; you will be able to start conversations about this upload as soon as ingestion is complete."),p.createElement(E.Content,null,"You will receive a notification when the process is complete. You can check your document ",p.createElement("b",null,p.createElement(y,{to:"/documents/"+t.fabric_id},"Here"))))))}},{key:"toHTML",value:function(){return m.renderToString(this.render())}}])&&s(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(p.Component);e.exports=S},1314:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&t.sections.map((function(t){return f.createElement("section",{onMouseEnter:function(){return e.handleMouseEnter(t.section_number)},onMouseLeave:e.handleMouseLeave},r&&o===t.section_number?f.createElement(_,null,f.createElement("div",{className:"drafter-section-title"},f.createElement(E,{name:"editSectionTitle",focus:!0,onChange:e.handleInputChange,defaultValue:t.title,style:{width:"100%",marginRight:"1em"}}),f.createElement(w.Group,null,f.createElement(w,{icon:!0,color:"green",size:"small",onClick:e.handleSectionEdit},f.createElement(b,{name:"check"})),f.createElement(w,{icon:!0,color:"grey",size:"small",onClick:function(){return e.setState({editMode:!1,editSection:0,editSectionTitle:""})}},f.createElement(b,{name:"close"})))),f.createElement(M,{id:"section-content",placeholder:t.content?null:"Add content to this section",name:"editSectionContent",defaultValue:t.content,onChange:e.handleInputChange,style:{resize:"none",minHeight:"100%"}})):f.createElement("article",null,f.createElement("div",{className:"drafter-section-title"},f.createElement(y,{as:"h3",style:{margin:"0"}},t.title),!r&&f.createElement("div",{style:{display:"flex"}},f.createElement(b,{name:"pencil",title:"Edit section title",className:"edit-icon",onClick:function(){return e.setState({editMode:!0,editSection:t.section_number,editSectionContent:t.content,editSectionTitle:t.title})}}),f.createElement(b,{name:"trash alternate",title:"Delete section",className:"edit-icon",onClick:function(){return e.setState({modalOpen:!0,editSection:t.section_number})}}))),f.createElement("div",{style:{whiteSpace:"pre-wrap"}},t.content)),f.createElement("div",{className:"col-center",style:{margin:"0.5em 0",visibility:i!==t.section_number||r?"hidden":"visible"}},f.createElement(x,{content:"Add a new Section here",trigger:f.createElement(w,{icon:!0,basic:!0,size:"mini",className:"new-section-btn",onClick:function(){return e.createSection(t.section_number+1)},style:{width:"100%"}},f.createElement(b,{name:"plus"}))})))})))):f.createElement("div",{className:"document-file-header"},f.createElement(y,{as:"h3",style:{margin:0}},"Document Not Found"),f.createElement(y,{as:"h3",style:{margin:0}},f.createElement(d,{to:"/documents"},f.createElement(b,{name:"left chevron"})," Back to documents")))),t.document.file_id&&f.createElement(g,{style:{width:"100%",height:"100%"}},f.createElement("iframe",{src:"".concat(window.location.protocol,"//").concat(window.location.hostname,":").concat(window.location.port,"/files/serve/").concat(t.document.file_id),className:"document-frame"})),f.createElement(g,{fluid:!0},f.createElement("h3",null,"History")),f.createElement(g,{fluid:!0},f.createElement(C,this.props)),this.renderConfirmModal())}},{key:"toHTML",value:function(){return ReactDOMServer.renderToString(this.render())}}])&&i(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(f.Component);e.exports=function(e){var t=p().fabricID;return f.createElement(T,o({fabricID:t},e))}},5834:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&r.messages.map((function(e){return c.createElement(m.Event,{key:e.id,"data-message-id":e.id},c.createElement(m.Content,null,c.createElement(m.Summary,null,c.createElement(m.User,null,e.author),c.createElement(m.Date,null,c.createElement("abbr",{title:e.created_at},e.created_at))),c.createElement(m.Extra,{text:!0},c.createElement("span",{dangerouslySetInnerHTML:{__html:d.parse(e.content)}}))))})))}}])&&i(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(c.Component));e.exports=function(e){var t=h().id;return c.createElement(y,o({id:t},e))}},9680:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),u(e=function(e,t,n){return t=a(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}(this,t,[n]),"handleInputChange",(function(t,n){var r=n.name,o=n.value;e.setState(u({},r,o))})),u(e,"handleClose",(function(){e.resetState(),e.props.toggleFeedbackBox()})),u(e,"resetState",(function(){e.setState({comment:"",sending:!1,feedbackSent:!1,feedbackFail:!1,errorMsg:""})})),u(e,"submitFeedback",(function(){e.setState({sending:!0,feedbackFail:!1,errorMsg:"",feedbackSent:!1}),e.props.sendFeedback(e.state.comment)})),e.state={comment:"",sending:!1,feedbackSent:!1,feedbackFail:!1,errorMsg:""},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(t,e),n=t,(l=[{key:"componentDidMount",value:function(){}},{key:"componentDidUpdate",value:function(e){e.feedback!=this.props.feedback&&this.state.sending&&!this.props.feedback.loading&&this.setState({feedbackFail:!this.props.feedback.sentSuccesfull,errorMsg:this.props.feedback.error,feedbackSent:this.props.feedback.sentSuccesfull})}},{key:"render",value:function(){var e=this,t=this.state,n=t.sending,r=t.feedbackSent,o=t.feedbackFail,i=t.errorMsg;return c.createElement(m,{onOpen:this.resetState,open:this.props.open,className:"col-center",id:"feedback-box",size:"tiny"},c.createElement(m.Header,null,"Feedback"),c.createElement(m.Content,null,c.createElement(p,{as:"h4"},"Leave us a message"),c.createElement(d,null,c.createElement(d.Field,null,c.createElement(m.Actions,null,c.createElement(d.TextArea,{rows:6,placeholder:"Enter your comment...",style:{resize:"none"},name:"comment",onChange:this.handleInputChange}),r&&c.createElement(y,{positive:!0},c.createElement(y.Header,null,"Feedback Sent!"),c.createElement(y.Content,null,"Your comment has been successfully sent.")),o&&c.createElement(y,{negative:!0},c.createElement(y.Header,null,"Feedback could not be sent"),c.createElement("p",null,i)),c.createElement(h.Group,null,c.createElement(h,{content:"Close",icon:"close",onClick:function(){return e.handleClose()},labelPosition:"right",size:"small",secondary:!0}),!r&&!o&&c.createElement(h,{content:"Send",icon:n?"spinner":"checkmark",onClick:this.submitFeedback,labelPosition:"right",size:"small",loading:this.props.feedback.loading,disabled:!this.state.comment,primary:!0})))))))}}])&&o(n.prototype,l),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,l}(c.Component);e.exports=v},2604:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=s(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,a()?Reflect.construct(t,n||[],s(e).constructor):t.apply(e,n))}(this,t,[n])).state={loading:!1,request:{query:""}},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(t,e),n=t,(i=[{key:"componentDidMount",value:function(){var e=this.props.request;this.props.fetchResponse(e)}},{key:"componentDidUpdate",value:function(e){this.props.response,e.response}},{key:"render",value:function(){var e=this.props,t=e.network,n=e.response;return c.createElement(d,{className:"fade-in",loading:null==t?void 0:t.loading},null!=n&&n.loading?c.createElement("h3",null,l," is thinking..."):c.createElement("sensemaker-response",null,c.createElement("h3",null,l," says..."),c.createElement("div",{dangerouslySetInnerHTML:{__html:h.parse(n?n.choices[0].message.content:"")}})))}},{key:"_toHTML",value:function(){return f.renderToString(this.render())}},{key:"toHTML",value:function(){return this._toHTML()}}])&&o(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(c.Component);e.exports=p},5498:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(e=function(e,t,n){return t=u(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}(this,t,[n]),"handleResize",(function(){e.setState({windowHeight:window.innerHeight}),e.forceUpdate()})),c(e,"toggleFaqMenu",(function(){e.setState((function(e){return{showFaqMenu:!e.showFaqMenu}}))})),e.state={open:!0,windowHeight:window.innerHeight,showFaq:!0,showFaqMenu:!0,showConversations:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,(o=[{key:"componentDidMount",value:function(){window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize)}},{key:"componentDidUpdate",value:function(e){!e.open&&this.props.open&&this.setState({showFaq:!0,showConversations:!1})}},{key:"render",value:function(){var e=this,t=this.state,n=t.windowHeight,r=t.showFaq,o=t.showFaqMenu,a=(t.showConversations,n>720?{height:"650px"}:{height:"450px"}),s=n>720?{height:"90%"}:{height:"87%"},u=this.props.open?{}:{display:"none"};return h.createElement(v,{className:"fade-in",id:"help-box",fluid:!0,style:i(i(i({},a),u),{},{padding:"0",maxHeight:"100%",width:"350px",overflowY:"hidden"})},h.createElement("section",{style:i(i({},s),{},{color:"white",marginBottom:"0",padding:"1em",paddingTop:"1.5em",display:"flex",flexDirection:"column"})},r?h.createElement(w,{as:"h3",fluid:!0,textAlign:"center",style:{flex:"none",color:"white"}},"FAQ"):h.createElement(w,{as:"h3",fluid:!0,textAlign:"center",style:{flex:"none",color:"white"}},"Conversations"),h.createElement("div",{style:{flex:"1",overflowY:"auto"}},r?h.createElement(m,{openHelpChat:function(){return e.setState({showFaq:!1,showConversations:!0})},showFaqMenu:o,toggleFaqMenu:function(){return e.toggleFaqMenu()}}):h.createElement(p,{fetchHelpConversations:this.props.fetchHelpConversations,fetchHelpMessages:this.props.fetchHelpMessages,sendHelpMessage:this.props.sendHelpMessage,markMessagesRead:this.props.markMessagesRead,clearHelpMessages:this.props.clearHelpMessages,help:this.props.help}))),h.createElement(g.Group,{style:{width:"100%",height:"10%"}},h.createElement(g,{icon:!0,style:{backgroundColor:"white",paddingTop:"0.5em",fontWeight:"400"},className:"col-center",onClick:function(){return e.setState({showFaq:!0,showConversations:!1,showFaqMenu:!0})}},h.createElement(b,{name:"home",size:"big"}),h.createElement("p",null,"Home")),h.createElement(g,{icon:!0,style:{backgroundColor:"white",paddingTop:"0.5em",fontWeight:"400"},className:"col-center",onClick:function(){e.setState({showFaq:!1,showConversations:!0}),e.props.stopNotification(),e.forceUpdate()}},h.createElement(b,{name:"chat",size:"big"}),h.createElement("p",null,"Messages"))))}},{key:"toHTML",value:function(){return d.renderToString(this.render())}}])&&a(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(h.Component);e.exports=E},3055:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(e=function(e,t,n){return t=u(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}(this,t,[n]),"componentDidUpdate",function(){var t,n=(t=o().mark((function t(n){var r,i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.props,i=r.help,a=r.conversationID,n.conversationID==a||e.state.sending){t.next=7;break}return e.setState({conversation_id:a,loading:!0}),t.next=5,new Promise((function(e){return setTimeout(e,1500)}));case 5:e.props.fetchHelpMessages(a),e.setState({loading:!1});case 7:n.help!=i&&!i.sending&&i.sentSuccess&&e.state.sending&&(e.setState({sending:!1,conversation_id:i.conversation_id}),e.props.fetchHelpMessages(i.conversation_id)),n.help.messages.length!=i.messages.length&&e.scrollToBottom();case 9:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))});return function(e){return n.apply(this,arguments)}}()),c(e,"scrollToBottom",(function(){var t=e.messagesEndRef.current;t&&(t.scrollTop=t.scrollHeight)})),c(e,"handleInputChange",(function(t){e.setState(c({},t.target.name,t.target.value))})),c(e,"handleKeyDown",(function(t){"Enter"===t.key&&(e.sendMessage(),t.preventDefault())})),c(e,"sendMessage",(function(){var t=e.state,n=t.messageQuery,r=t.conversation_id;""!==n&&(e.setState({sending:!0}),e.props.sendHelpMessage(n,r,"user"),e.setState({messageQuery:""}))})),c(e,"handleIconClick",(function(){e.sendMessage()})),e.state={open:!0,messageQuery:"",sending:!1,conversation_id:0,loading:!1},e.messagesEndRef=h.createRef(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,(f=[{key:"componentDidMount",value:function(){var e=this.props.conversationID;e&&(this.setState({conversation_id:e}),this.props.fetchHelpMessages(e)),this.scrollToBottom()}},{key:"render",value:function(){var e=this,t=this.props.help;return h.createElement("section",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"}},h.createElement(m,{icon:!0,style:{position:"absolute",backgroundColor:"transparent"},onClick:function(){e.props.closeHelpChat()}},h.createElement(y,{name:"chevron left"})),h.createElement(g,{visible:!t.loadingMsgs,animation:"fade",duration:1e3},h.createElement("div",{className:"help-chat-feed",style:{overflowY:"auto",scrollBehavior:"smooth"},ref:this.messagesEndRef},t&&t.messages&&t.messages.length>0?t.messages.map((function(e){return"user"===e.help_role?h.createElement("p",{id:e.id,className:"help-user-msg"},e.content):h.createElement("p",{id:e.id,className:"help-admin-msg"},e.content)})):!t.loadingMsgs&&h.createElement("p",{className:"help-welcome-msg"},"What can we do to help you? Tell us anything you need, an assistant will answer shortly."))),h.createElement(v,{placeholder:"Write your message...",name:"messageQuery",onChange:this.handleInputChange,onKeyDown:this.handleKeyDown,value:this.state.messageQuery,icon:!0,style:{flex:"0 0 auto",width:"100%"}},h.createElement("input",null),h.createElement(y,{name:"send",onClick:this.handleIconClick,style:{cursor:"pointer"},link:!0})))}},{key:"toHTML",value:function(){return d.renderToString(this.render())}}])&&a(n.prototype,f),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,f}(h.Component);e.exports=b},3197:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),u(e=function(e,t,n){return t=a(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}(this,t,[n]),"openConversation",(function(t){0===t&&e.props.clearHelpMessages(),e.setState({displayChat:!0,conversationID:t}),e.props.markMessagesRead(t,"admin")})),u(e,"closeHelpChat",(function(){e.setState({displayChat:!1,conversationID:null}),e.props.fetchHelpConversations()})),e.state={open:!0,conversationID:null,displayChat:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(t,e),n=t,(l=[{key:"componentDidMount",value:function(){this.props.fetchHelpConversations()}},{key:"componentDidUpdate",value:function(e){e.help,this.props.help}},{key:"formatDateTime",value:function(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}},{key:"render",value:function(){var e=this,t=this.state.displayChat,n=this.props.help;return c.createElement(d,{fluid:!0,style:{width:"100%",height:"100%",color:"black"}},t?c.createElement(v,{fetchHelpMessages:this.props.fetchHelpMessages,sendHelpMessage:this.props.sendHelpMessage,help:this.props.help,conversationID:this.state.conversationID,closeHelpChat:this.closeHelpChat}):c.createElement("section",{className:"col-center",style:{width:"100%",height:"100%"}},n&&n.conversations&&n.conversations.length>0?c.createElement("div",{style:{flex:1,overflowY:"auto",width:"100%",maxWidth:"100%"}},c.createElement(y,{vertical:!0,fluid:!0,id:"help-conversations"},n.conversations.map((function(t){return c.createElement(y.Item,{key:t.id,onClick:function(){return e.openConversation(t.id)},style:{display:"flex",flexDirection:"row",gap:"1em",alignItems:"center"}},c.createElement(m,{size:"big",name:"admin"===t.last_message.help_role&&1===t.last_message.is_read||"user"===t.last_message.help_role?"envelope open outline":"envelope",color:"admin"===t.last_message.help_role&&1===t.last_message.is_read||"user"===t.last_message.help_role?"grey":void 0}),c.createElement("div",{style:{maxWidth:"70%"}},c.createElement("p",{style:{margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.last_message.content),c.createElement("p",{style:{fontStyle:"italic",fontSize:"0.8em"}},e.formatDateTime(t.last_message.created_at))))})))):c.createElement("h5",null,"You dont have any conversation yet"),c.createElement(p,{primary:!0,content:"Chat with an assistant",style:{flex:"0 0 auto",marginTop:"1em"},onClick:function(){return e.openConversation(0)}})))}},{key:"toHTML",value:function(){return f.renderToString(this.render())}}])&&o(n.prototype,l),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,l}(c.Component);e.exports=g},9569:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=function(e,t,n){return t=a(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}(this,t,[l]),n=e,s=function(){},(o=u(o="closeHelpChat"))in n?Object.defineProperty(n,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[o]=s,e.state={openOption:!1,optionTitle:null,optionContent:null},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(t,e),n=t,(d=[{key:"componentDidMount",value:function(){}},{key:"componentDidUpdate",value:function(e){e.help,this.props.help,e.showFaqMenu!=this.props.showFaqMenu&&this.setState({openOption:!this.props.showFaqMenu})}},{key:"formatDateTime",value:function(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}},{key:"render",value:function(){var e=this,t=(this.props.help,this.state),n=t.openOption,r=t.optionContent,o=t.optionTitle;return l.createElement(p,{fluid:!0,style:{width:"100%",height:"100%",color:"black",display:"flex"}},n?l.createElement("section",null,l.createElement(m,{icon:!0,style:{backgroundColor:"transparent",paddingLeft:"0"},onClick:function(){e.setState({openOption:!1,optionTitle:null,optionContent:null}),e.props.toggleFaqMenu()}},l.createElement(y,{name:"chevron left"})),l.createElement("h3",{style:{marginTop:"0",textAlign:"center",textTransform:"inherit"}},o),l.createElement("div",{style:{padding:"0em 0.5em 2em 0.5em"}},l.createElement("span",{dangerouslySetInnerHTML:{__html:h.parse(r)}}))):l.createElement("div",{className:"col-center",style:{width:"100%"}},l.createElement("section",{style:{flex:1,overflowY:"auto",width:"100%",maxWidth:"100%"}},l.createElement("h3",{style:{textAlign:"center",textTransform:"inherit"}},"Quick Help Guide"),l.createElement(v,{vertical:!0,fluid:!0,id:"faq-themes"},f.map((function(t){return l.createElement(v.Item,{key:t.id,onClick:function(){e.setState({openOption:!0,optionTitle:t.title,optionContent:t.content}),e.props.toggleFaqMenu()}},l.createElement("h4",null,t.title))})))),l.createElement(m,{primary:!0,content:"Chat with an assistant",style:{flex:"0 0 auto",marginTop:"1em"},onClick:function(){return e.props.openHelpChat()}})))}},{key:"toHTML",value:function(){return c.renderToString(this.render())}}])&&o(n.prototype,d),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,d}(l.Component));e.exports=g},8470:(e,t,n)=>{"use strict";n.r(t),n.d(t,{faqOptions:()=>r});var r=[{id:1,title:"What can Sensemaker do?",content:"
**Make sense of things."}]},9309:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n0&&n.map((function(e){return l.createElement("section",null,l.createElement("article",null,l.createElement(f,{as:"h3",style:{marginTop:"1em"}},e.title),l.createElement("div",{style:{whiteSpace:"pre-wrap",color:"black"}},e.content)))}))),t.file_id&&l.createElement("iframe",{src:"".concat(window.location.protocol,"//").concat(window.location.hostname,":").concat(window.location.port,"/files/serve/").concat(t.file_id),className:"document-frame"}))}}])&&o(n.prototype,c),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,c}(l.Component);e.exports=y},2472:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(e=function(e,t,n){return t=u(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}(this,t,[n]),"componentDidMount",(function(){})),c(e,"componentDidUpdate",(function(t){var n=e.props.search;t.search!=n&&(n.searching||n.error||!e.state.loading||e.setState({filteredResults:n.result.results,loading:!1}))})),c(e,"handleSearchChange",h(function(){var t,n=(t=o().mark((function t(n){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n&&(e.setState({loading:!0}),e.props.searchGlobal(n));case 1:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))});return function(e){return n.apply(this,arguments)}}(),250)),c(e,"renderResults",(function(){var t=e.state.filteredResults;return Object.keys(t).length>0&&t.documents&&t.documents.length>0?[{name:"documents",results:Array.isArray(t.documents)?t.documents.map((function(e){return{title:d.createElement(m,{to:"/documents/"+e.id,style:{fontSize:"0.8em",margin:"0"}},e.short_name),description:d.createElement("p",{style:{fontSize:"0.7em"}},e.title)}})):[]}]:[]})),e.state={searchQuery:"",filteredResults:{},loading:!1,results:null},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,f=[{key:"render",value:function(){var e=this,t=this.state.loading;return d.createElement(y,{id:"global-search",name:"query",autoComplete:"off",placeholder:"Find...",category:!0,loading:t,value:this.state.searchQuery,results:this.renderResults(),onSearchChange:function(t){var n=t.target.value;e.setState({searchQuery:n}),e.handleSearchChange(n)}})}},{key:"_toHTML",value:function(){return p.renderToString(this.render())}},{key:"toHTML",value:function(){return this._toHTML()}}],f&&a(n.prototype,f),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,f}(d.Component));e.exports=v},4623:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=s(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,a()?Reflect.construct(t,n||[],s(e).constructor):t.apply(e,n))}(this,t,[n])).state={loading:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(t,e),n=t,(i=[{key:"componentDidMount",value:function(){}},{key:"componentDidUpdate",value:function(e){this.props.peers,e.peers}},{key:"render",value:function(){var e=this.props.network;return l.createElement(m,{loading:e.loading,style:{maxHeight:"100%",height:"97vh"}},l.createElement(y,{as:"h1"},"Network"),l.createElement(p,null,l.createElement(p.Content,null,l.createElement(p.Header,null,"Status"),l.createElement(p.Meta,null,"Connected"),l.createElement(p.Description,null,l.createElement(w,{name:"check",color:"green"})," Connected to the network."))),l.createElement(b,null),l.createElement(y,{as:"h2"},"Local"),l.createElement(E,null,l.createElement(E.Header,null,l.createElement(E.Row,null,l.createElement(E.HeaderCell,null,"Peer"),l.createElement(E.HeaderCell,null,"Address"),l.createElement(E.HeaderCell,null,"Port"),l.createElement(E.HeaderCell,null,"Protocol"),l.createElement(E.HeaderCell,null,"Connected"))),l.createElement(E.Body,null,l.createElement(E.Row,null,l.createElement(E.Cell,null,l.createElement(v,null,"sensemaker@localhost")),l.createElement(E.Cell,null,l.createElement("code",null,"127.0.0.1")),l.createElement(E.Cell,null,l.createElement("code",null,"3040")),l.createElement(E.Cell,null,l.createElement("code",null,"http")),l.createElement(E.Cell,null,l.createElement(w,{name:"check",color:"green"}))),l.createElement(E.Row,null,l.createElement(E.Cell,null,l.createElement(v,null,"sensemaker@localhost")),l.createElement(E.Cell,null,l.createElement("code",null,"127.0.0.1")),l.createElement(E.Cell,null,l.createElement("code",null,"3040")),l.createElement(E.Cell,null,l.createElement("code",null,"ws")),l.createElement(E.Cell,null,l.createElement(w,{name:"check",color:"green"}))),l.createElement(E.Row,null,l.createElement(E.Cell,null,l.createElement(v,null,"sensemaker@localhost")),l.createElement(E.Cell,null,l.createElement("code",null,"127.0.0.1")),l.createElement(E.Cell,null,l.createElement("code",null,"7777")),l.createElement(E.Cell,null,l.createElement("code",null,"fabric")),l.createElement(E.Cell,null,l.createElement(w,{name:"check",color:"green"}))),l.createElement(E.Row,null,l.createElement(E.Cell,null,l.createElement(v,null,"ollama@localhost")),l.createElement(E.Cell,null,l.createElement("code",null,"127.0.0.1")),l.createElement(E.Cell,null,l.createElement("code",null,"11434")),l.createElement(E.Cell,null,l.createElement("code",null,"http")),l.createElement(E.Cell,null,l.createElement(w,{name:"check",color:"green"}))))),l.createElement(y,{as:"h2"},"Peers"),l.createElement(E,null,l.createElement(E.Header,null,l.createElement(E.Row,null,l.createElement(E.HeaderCell,null,"Peer"),l.createElement(E.HeaderCell,null,"Address"),l.createElement(E.HeaderCell,null,"Port"),l.createElement(E.HeaderCell,null,"Protocol"),l.createElement(E.HeaderCell,null,"Connected"),l.createElement(E.HeaderCell,null,"Controls"))),l.createElement(E.Body,null,e&&e.peers&&e.peers.map((function(e){return l.createElement(E.Row,null,l.createElement(E.Cell,null,l.createElement(f,{to:"/peers/"+e.id},e.title)),l.createElement(E.Cell,null,e.address),l.createElement(E.Cell,null,e.port),l.createElement(E.Cell,null,e.protocol),l.createElement(E.Cell,null,e.connected?l.createElement(w,{name:"check",color:"green"}):l.createElement(w,{name:"close",color:"red"})),l.createElement(E.Cell,null,l.createElement(d,null,l.createElement(w,{name:"stop"}))))})))),l.createElement(b,null),l.createElement(f,{to:"/peers/new"},l.createElement(d,{primary:!0,content:"+ Connect Peer"})),l.createElement(y,{as:"h3"},"Fabric"),l.createElement(g,null,e&&e.peers&&e.peers.map((function(e){return l.createElement(g.Item,{style:{marginTop:"0.5em"}},l.createElement(y,{as:"h3"},l.createElement(f,{to:"/peers/"+e.id},e.title)))}))))}},{key:"_toHTML",value:function(){return c.renderToString(this.render())}},{key:"toHTML",value:function(){return this._toHTML()}}])&&o(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(l.Component);e.exports=S},3806:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=function(e,t,n){return t=u(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}(this,t,[d]),n=e,a="handleSearchChange",l=f((function(t){e.setState({searching:!0}),h("/people",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"SEARCH",body:JSON.stringify({query:t})}).then(function(){var n,r=(n=o().mark((function n(r){var i;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,r.json();case 2:i=n.sent,console.log("fetch result: ",i),e.setState({filteredPeople:i.content,searchQuery:t});case 5:case"end":return n.stop()}}),n)})),function(){var e=this,t=arguments;return new Promise((function(r,o){var a=n.apply(e,t);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))});return function(e){return r.apply(this,arguments)}}()).catch((function(e){console.error("Error fetching data:",e)})).finally((function(){e.setState({searching:!1})}))}),1e3),(a=c(a))in n?Object.defineProperty(n,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):n[a]=l,e.state={searchQuery:"",filteredPeople:[],searching:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,y=[{key:"componentDidMount",value:function(){this.props.fetchPeople()}},{key:"render",value:function(){var e=this,t=this.props,n=t.loading,r=(t.error,this.state),o=r.filteredPeople,i=r.searchQuery,a=r.searching;return d.createElement(g,{className:"fade-in",fluid:!0,style:{marginRight:"1em",maxHeight:"100%"}},d.createElement("h1",null,"People"),d.createElement("fabric-search",{fluid:!0,placeholder:"Find...",className:"ui search"},d.createElement("div",{className:"ui huge icon fluid input"},d.createElement("input",{name:"query",autoComplete:"off",placeholder:"Find...",type:"text",tabIndex:"0",className:"prompt",onChange:function(t){var n=t.target.value;e.setState({searchQuery:n}),e.handleSearchChange(n)}}),d.createElement("i",{"aria-hidden":"true",className:"search icon"}))),d.createElement(w,{as:v.Group,doubling:!0,centered:!0,loading:n,style:{marginTop:"1em"}},a?d.createElement(E,{active:!0,inline:"centered"}):i?o&&o.people&&o.people.length>0?o.people.map((function(e){return d.createElement(w.Item,{as:v,key:e.id},d.createElement(v.Content,null,d.createElement("h3",null,d.createElement(m,{to:"/people/"+e.id}," ",e.full_name," ")," "),d.createElement(b.Group,{basic:!0},d.createElement(b,{title:"Date of birth"},d.createElement(S,{name:"calendar alternate outline"})," ",e.date_of_birth),d.createElement(b,{title:"City/State of birth "},d.createElement(S,{name:"building"})," ",e.birth_city,", ",e.birth_state))))})):d.createElement("p",null,"No results found"):this.props.people&&this.props.people.people&&this.props.people.people.length>0?this.props.people.people.map((function(e){return d.createElement(w.Item,{as:v,key:e.id},d.createElement(v.Content,null,d.createElement("h3",null,d.createElement(m,{to:"/people/"+e.id}," ",e.full_name," ")," "),d.createElement(b.Group,{basic:!0},d.createElement(b,{title:"Date of birth"},d.createElement(S,{name:"calendar alternate outline"})," ",e.date_of_birth),d.createElement(b,{title:"City/State of birth "},d.createElement(S,{name:"building"})," ",e.birth_city,", ",e.birth_state))))})):d.createElement("p",null,"No people available")))}},{key:"toHTML",value:function(){return p.renderToString(this.render())}}],y&&a(n.prototype,y),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,y}(d.Component));e.exports=_},1034:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,u,"next",e)}function u(e){a(i,r,o,s,u,"throw",e)}s(void 0)}))}}function u(e,t){for(var n=0;nd,(f&&f>c||!f&&p)&&(l.title&&n.setState({announTitle:l.title}),l.body&&n.setState({announBody:l.body})),e.next=28;break;case 26:e.prev=26,e.t0=e.catch(2);case 28:case"end":return e.stop()}}),e,null,[[2,26]])})))),n.state={announTitle:"",announBody:""},n.messagesEndRef=p.createRef(),n.fetchAnnouncement=n.fetchAnnouncement.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,(a=[{key:"componentDidMount",value:function(){m("#primary-query").focus(),this.props.resetChat(),this.fetchAnnouncement()}},{key:"render",value:function(){var e=this.state,t=e.announTitle,n=e.announBody,r=this.props.chat.messages.length>0?h(h(h({display:"absolute",left:"calc(350px + 1em)",height:"calc(100vh - ".concat("2.5","rem)"),paddingRight:"0em",inset:0},"display","flex"),"flexDirection","column"),"paddingBottom","0"):{height:"auto",display:"flex",flexDirection:"column",paddingBottom:"1em"};return p.createElement("fabric-component",{ref:this.messagesEndRef,class:"ui fluid segment",style:r},p.createElement(v,o({},this.props,{resetInformationSidebar:this.props.resetInformationSidebar,messageInfo:this.props.messageInfo,thumbsUp:this.props.thumbsUp,thumbsDown:this.props.thumbsDown,announTitle:t,announBody:n,placeholder:this.props.placeholder,messagesEndRef:this.messagesEndRef,homePage:!0,size:"large",takeFocus:this.props.takeFocus})))}}])&&u(n.prototype,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a}(p.Component));e.exports=b},6380:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,u,"next",e)}function u(e){a(i,r,o,s,u,"throw",e)}s(void 0)}))}}function u(e,t){for(var n=0;n=8,n=/[A-Z]/.test(e),r=/[0-9]/.test(e);return t&&n&&r})),h(n,"validatePasswordsMatch",(function(){return n.state.newPassword&&n.state.confirmedNewPassword&&n.state.newPassword===n.state.confirmedNewPassword})),n.state={newPassword:"",confirmedNewPassword:"",passwordError:!1,passwordMatch:!1,tokenError:!1,loading:!1,updatedPassword:!1,updateError:!1,errorContent:"",pwdModalOpen:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,(o=[{key:"render",value:function(){var e=this.state,t=e.newPassword,n=e.confirmedNewPassword,r=e.loading,o=e.passwordError,i=e.passwordMatch,a=e.errorContent,s=e.updateError,u=e.updatedPassword,l=e.tokenError,c=e.pwdModalOpen,f=o&&t?{content:"The password must be at least 8 characters, include a capital letter and a number.",pointing:"above"}:null,h=i||!n?null:{content:"Both passwords must match.",pointing:"above"};return p.createElement("div",{className:"fade-in reset-password-form"},p.createElement(v,{onSubmit:this.handleSubmit},!u&&!l&&p.createElement("section",null,p.createElement("p",null,"Please choose a new Password for your account. It must have at least 8 characters, a capital letter and a number."),p.createElement(v.Input,{size:"mini",label:"New Password",type:"password",name:"newPassword",error:f,onChange:this.handleInputChange,autoComplete:"new-password",vale:t,required:!0}),p.createElement(v.Input,{size:"mini",label:"Confirm New Password",type:"password",name:"confirmedNewPassword",error:h,onChange:this.handleInputChange,autoComplete:"new-password",value:n,required:!0}),p.createElement(g,{content:"Submit",icon:"checkmark",loading:r,type:"submit",fluid:!0,primary:!0,disabled:o||!i})),(s||l)&&p.createElement(b,{negative:!0},p.createElement("p",null,a),l&&p.createElement("a",{onClick:this.togglePasswordModal},"Reset Password »")),u&&p.createElement(b,{positive:!0},p.createElement(b.Header,null,"Password updated"),p.createElement("p",null,"Your new password has been changed successfully. Use your new password to log in."),p.createElement("a",{href:"/sessions/new"},"Log In »")),p.createElement(w,{open:c,togglePasswordModal:this.togglePasswordModal})))}}])&&u(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(p.Component);e.exports=function(e){var t=m().resetToken;return p.createElement(E,o({resetToken:t},e))}},7249:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function s(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function s(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n=8,n=/[A-Z]/.test(e),r=/[0-9]/.test(e);return t&&n&&r})),f(n,"validatePasswordsMatch",(function(){return n.state.newPassword&&n.state.confirmNewPassword&&n.state.newPassword===n.state.confirmNewPassword})),f(n,"handleInputChange",(function(e,t){var r=t.name,o=t.value;n.setState(f({},r,o),(function(){var e=n.validateNewPassword(n.state.newPassword),t=n.validatePasswordsMatch(),r=e&&t&&n.state.newPassword!==n.state.oldPassword;n.setState({isNewPasswordValid:e,passwordMatch:t,allValid:r})}))})),f(n,"handlePasswordSubmit",a(o().mark((function e(){var t,r,i,a,s,u,l,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.state,r=t.oldPassword,i=t.newPassword,a=t.allValid,s=fetch("/passwordChange",{method:"POST",headers:{Authorization:"Bearer ".concat(n.props.token),"Content-Type":"application/json"},body:JSON.stringify({oldPassword:r,newPassword:i})}),u=new Promise((function(e,t){setTimeout((function(){t(new Error("Fetch timed out"))}),15e3)})),!a){e.next=27;break}return e.prev=4,n.setState({passwordModalLoading:!0,passwordUpdated:!1,passwordUpdateError:!1,invalidOldPassword:!1}),e.next=8,Promise.race([u,s]);case 8:if((l=e.sent).ok){e.next=14;break}return e.next=12,l.json();case 12:throw c=e.sent,new Error(c.message);case 14:return e.next=16,new Promise((function(e){return setTimeout(e,1500)}));case 16:n.setState({passwordUpdated:!0,passwordModalLoading:!1}),setTimeout((function(){n.props.logout(),window.location.href="/"}),2500),e.next=27;break;case 20:return e.prev=20,e.t0=e.catch(4),e.next=24,new Promise((function(e){return setTimeout(e,1500)}));case 24:"Invalid password."==e.t0.message?n.setState({invalidOldPassword:!0}):n.setState({passwordUpdateError:!0}),n.setState({passwordModalLoading:!1}),console.log(e.t0.message);case 27:case"end":return e.stop()}}),e,null,[[4,20]])})))),n.state={oldPassword:"",newPassword:"",confirmNewPassword:"",isNewPasswordValid:!0,passwordMatch:!0,allValid:!0,invalidOldPassword:!1,passwordUpdated:!1,passwordUpdateError:!1,passwordModalLoading:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),n=t,(i=[{key:"render",value:function(){var e=this.state,t=e.oldPassword,n=e.newPassword,r=e.confirmNewPassword,o=e.isNewPasswordValid,i=e.passwordMatch,a=e.allValid,s=e.invalidOldPassword,u=e.passwordUpdated,l=e.passwordUpdateError,c=e.passwordModalLoading,f=this.props.open,h=o||!n?null:{content:"The password must be at least 8 characters, include a capital letter and a number.",pointing:"above"},p=i||!r?null:{content:"Both passwords must match.",pointing:"above"};return d.createElement(v,{open:f,onOpen:this.passwordModalOpen,onClose:this.passwordModalClose,size:"medium"},d.createElement(v.Header,null,"Change Your Password"),d.createElement(v.Content,null,d.createElement(y,{onSubmit:this.handlePasswordSubmit},d.createElement(y.Input,{label:"Old Password",type:"password",name:"oldPassword",onChange:this.handleInputChange,autoComplete:"new-password",required:!0}),d.createElement(y.Input,{label:"New Password",type:"password",name:"newPassword",value:n,error:h,onChange:this.handleInputChange,autoComplete:"new-password",required:!0}),d.createElement(y.Input,{label:"Confirm New Password",type:"password",name:"confirmNewPassword",value:r,error:p,onChange:this.handleInputChange,autoComplete:"new-password",required:!0}),a&&n&&!s&&d.createElement("p",{style:{color:"green"}},"Both passwords are correct"),t&&n&&t===n&&d.createElement("p",{style:{color:"red"}},"Old password and new password must be different"),d.createElement(v.Actions,null,s&&d.createElement(g,{negative:!0},d.createElement(g.Header,null,"Password error"),d.createElement("p",null,"Your old password is not correct, please try again.")),u&&d.createElement(g,{positive:!0},d.createElement(g.Header,null,"Password updated"),d.createElement("p",null,"Your new password has been changed successfully. Use your new password to log in.")),l&&d.createElement(g,{negative:!0},d.createElement(g.Header,null,"Internal server error"),d.createElement("p",null,"Please try again later.")),d.createElement(m,{content:"Close",icon:"close",size:"small",secondary:!0,onClick:this.passwordModalClose}),d.createElement(m,{content:"Submit",icon:"checkmark",loading:c,type:"submit",size:"small",primary:!0,disabled:!a})))))}}])&&s(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(d.Component);e.exports=b},6007:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,u,"next",e)}function u(e){a(i,r,o,s,u,"throw",e)}s(void 0)}))}}function u(e,t){for(var n=0;n=8,n=/[A-Z]/.test(e),r=/[0-9]/.test(e);return t&&n&&r})),h(n,"validatePasswordsMatch",(function(){return n.state.password&&n.state.confirmedPassword&&n.state.password===n.state.confirmedPassword})),n.state={password:"",confirmedPassword:"",passwordError:!1,passwordMatch:!1,tokenError:!1,loading:!1,registerSuccess:!1,registerError:!1,errorContent:"",firstName:"",lastName:"",firmName:"",firmSize:null,username:"",email:"",isNewUserValid:!1,usernameError:"",isEmailValid:!1,emailError:""},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,(o=[{key:"componentDidUpdate",value:function(e){var t=this.props.adminPanel;if(!t&&e.invitation!==this.props.invitation){var n=this.props.invitation;n.invitationValid?(this.setState({loading:!1,tokenError:!1,errorContent:"",emailError:null,email:this.props.invitation.invitation.target}),this.props.checkEmailAvailable(this.props.invitation.invitation.target)):this.setState({loading:!1,tokenError:!0,errorContent:n.error})}if(e.auth!==this.props.auth){var r=this.props.auth;r.usernameAvailable&&this.state.username?this.setState({isNewUserValid:!0,usernameError:""}):this.setState({isNewUserValid:!1,usernameError:"Username already exists. Please choose a different one."}),r.emailAvailable&&this.state.email?this.setState({isEmailValid:!0,emailError:""}):this.setState({isEmailValid:!1,emailError:"Email already registered, please choose a differnt one."}),this.state.registering&&!r.registering&&(this.setState({registering:!1}),r.registerSuccess?(this.setState({registerSuccess:!0,registerError:!1,errorContent:""}),t||this.props.acceptInvitation(this.props.invitationToken)):this.setState({registerSuccess:!1,registerError:!0,errorContent:r.error}))}}},{key:"render",value:function(){var e=this.state,t=e.password,n=e.confirmedPassword,r=e.loading,o=e.passwordError,i=e.passwordMatch,a=e.errorContent,s=e.tokenError,u=e.firstName,l=e.lastName,c=e.firmName,f=e.firmSize,h=e.username,d=e.isNewUserValid,m=e.usernameError,y=e.email,S=e.isEmailValid,_=e.emailError,x=e.registerSuccess,k=e.registerError,M=e.registering,C=(e.adminPanel,o&&t?{content:"The password must be at least 8 characters, include a capital letter and a number.",pointing:"above"}:null),O=i||!n?null:{content:"Both passwords must match.",pointing:"above"},T=d||!h?null:{content:m,pointing:"above"},A=S||!y||null===_?null:{content:_,pointing:"above"};return p.createElement("div",{className:"fade-in signup-form"},p.createElement(E,null,p.createElement(v,{id:"signup-form",loading:r,centered:!0,style:{width:"500px"}},!s&&!x&&p.createElement("section",null,!this.props.adminPanel&&p.createElement(p.Fragment,null,p.createElement(w,{as:"h3",textAlign:"center"},"Sign Up"),p.createElement("p",null,"Complete your registration to access Sensemaker.")),p.createElement(v.Group,{className:"signup-form-group"},p.createElement(v.Input,{size:"small",label:"First name",type:"text",name:"firstName",onChange:this.handleInputChange,autoComplete:"off",value:u,required:!0}),p.createElement(v.Input,{size:"small",label:"Last name",type:"text",name:"lastName",onChange:this.handleInputChange,autoComplete:"off",value:l,required:!0})),p.createElement(v.Group,{className:"signup-form-group"},p.createElement(v.Input,{size:"small",label:"Firm name",type:"text",name:"firmName",onChange:this.handleInputChange,autoComplete:"off",value:c}),p.createElement(v.Input,{size:"small",label:"Firm size",type:"number",name:"firmSize",onChange:this.handleInputChange,autoComplete:"off",value:f})),p.createElement(v.Group,{className:"signup-form-group"},p.createElement(v.Input,{size:"small",label:"Username",type:"text",name:"username",error:T,onChange:this.handleInputChange,autoComplete:"off",value:h,required:!0}),p.createElement(v.Input,{size:"small",label:"Email",type:"email",name:"email",error:_?A:null,onChange:this.handleInputChange,autoComplete:"off",value:y,required:!0})),p.createElement("p",null,"Password must have at least 8 characters, a capital letter and a number."),p.createElement(v.Group,{className:"signup-form-group"},p.createElement(v.Input,{size:"small",label:"Password",type:"password",name:"password",error:C,onChange:this.handleInputChange,autoComplete:"new-password",value:t,required:!0}),p.createElement(v.Input,{size:"small",label:"Confirm Password",type:"password",name:"confirmedPassword",error:O,onChange:this.handleInputChange,autoComplete:"new-password",value:n,required:!0})),k&&p.createElement(b,{negative:!0},p.createElement("p",null,a)),p.createElement(g,{content:"Submit",icon:"checkmark",loading:M,onClick:this.handleSubmit,fluid:!0,primary:!0,disabled:o||!i||!d||m||!S||_})),s&&p.createElement(b,{negative:!0},p.createElement(b.Header,{style:{marginBottom:"1rem"}},"Something went wrong."),p.createElement("p",null,a)),x&&!this.props.adminPanel?p.createElement(b,{positive:!0,centered:!0},p.createElement(b.Header,{style:{marginBottom:"1rem"}},"Registration Successful"),p.createElement("p",null,"Your account has been successfully created. Thank you for registering with Sensemaker."),p.createElement("p",null,"Please log in to access your account and start utilizing our services."),p.createElement("div",{style:{margintop:"1.5rem",textAlign:"center"}},p.createElement(g,{primary:!0,href:"/sessions"},"Log In"))):x&&this.props.adminPanel&&p.createElement(b,{positive:!0,centered:!0},p.createElement(b.Header,{style:{marginBottom:"1rem"}},"User registered successfully"),p.createElement("p",null,"Your account has been successfully created. Thank you for registering with Sensemaker.")))))}}])&&u(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(p.Component));e.exports=function(e){var t=m().invitationToken;return p.createElement(S,o({invitationToken:t},e))}},4528:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";n.r(t),n.d(t,{caseDropOptions:()=>r,draftDropOptions:()=>o,outlineDropOptions:()=>i});var r=[{text:"",value:""},{text:"Find a case that defines the scope of First Amendment rights in online speech.",value:"Find a case that defines the scope of First Amendment rights in online speech."},{text:"Find a case that outlines legal standards for product liability in consumer electronics.",value:"Find a case that outlines legal standards for product liability in consumer electronics."},{text:"Find a case that examines the use of social media evidence in criminal proceedings.",value:"Find a case that examines the use of social media evidence in criminal proceedings."},{text:"Find a case that deals with the application of force majeure clauses in commercial leases.",value:"Find a case that deals with the application of force majeure clauses in commercial leases."}],o=[{text:"",value:""},{text:"Draft a brief exploring legal perspectives on public use of private drone footage.",value:"Draft a brief exploring legal perspectives on public use of private drone footage."},{text:"Draft a brief summarizing recent cases on vicarious liability in rideshare accidents.",value:"Draft a brief summarizing recent cases on vicarious liability in rideshare accidents."},{text:"Draft a brief discussing the legal implications of recreational space travel.",value:"Draft a brief discussing the legal implications of recreational space travel."},{text:"Draft a brief analyzing the enforceability of force majeure clauses in commercial contracts.",value:"Draft a brief analyzing the enforceability of force majeure clauses in commercial contracts."}],i=[{text:"",value:""},{text:"Outline a motion for a charity drive to support underprivileged families during the holiday season.",value:"Outline a motion for a charity drive to support underprivileged families during the holiday season."},{text:"Outline a motion for a city council proposal to enhance green spaces and parks.",value:"Outline a motion for a city council proposal to enhance green spaces and parks."},{text:"Outline a motion for a neighborhood event aimed at fostering local art and culture.",value:"Outline a motion for a neighborhood event aimed at fostering local art and culture."},{text:"Outline a motion for a community initiative promoting sustainable living practices.",value:"Outline a motion for a community initiative promoting sustainable living practices."}]},7876:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function s(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),f(e=function(e,t,n){return t=l(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}(this,t,[n]),"handleTaskCompletionChange",(function(t){console.debug("task completion changed, target:",t.target),console.debug("task completion changed, value:",t.target.value),new Date,e.setState({taskCompletion:t.target.value})})),f(e,"handleTaskInputChange",(function(t){e.setState({taskTitle:t.target.value})})),f(e,"handleTaskSubmit",function(){var t,n=(t=i().mark((function t(n){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.setState({loading:!0}),t.next=3,e.props.createTask({title:e.state.taskTitle});case 3:t.sent,e.setState({taskTitle:"",loading:!1}),e.props.fetchTasks();case 6:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(e){a(i,r,o,s,u,"next",e)}function u(e){a(i,r,o,s,u,"throw",e)}s(void 0)}))});return function(e){return n.apply(this,arguments)}}()),e.state={loading:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),n=t,(h=[{key:"componentDidMount",value:function(){this.props.fetchTasks().then(this.props.fetchResponse)}},{key:"componentDidUpdate",value:function(e){this.props.tasks}},{key:"render",value:function(){var e=this,t=this.props,n=t.network,r=t.tasks,i=t.response;return p.createElement(b,{className:"fade-in",loading:null==n?void 0:n.loading,style:{maxHeight:"100%",height:"97vh"}},p.createElement("h2",null,"Tasks"),p.createElement("p",null,d," will monitor active tasks and perform background work to assist you in completing them."),p.createElement("p",null,"To get started, create a task below."),p.createElement(g,{huge:!0,fluid:!0,onSubmit:this.handleTaskSubmit},p.createElement(g.Field,{fluid:!0,onChange:this.handleTaskInputChange,loading:this.state.loading},p.createElement("label",null,"Task"),p.createElement(w,{fluid:!0,type:"text",name:"title",placeholder:"e.g., do the laundry, etc.",action:p.createElement(v,{primary:!0,content:"Create Task »"})}))),p.createElement(S,null,p.createElement(S.Header,null,p.createElement(S.Row,null,p.createElement(S.HeaderCell,null),p.createElement(S.HeaderCell,null,"Task"),p.createElement(S.HeaderCell,null))),p.createElement(S.Body,null,r&&r.tasks.map((function(t){return p.createElement(S.Row,null,p.createElement(S.Cell,null,p.createElement(w,{type:"checkbox",name:"task_is_complete",checked:!!t.completed_at,onChange:e.handleTaskCompletionChange})),p.createElement(S.Cell,null,t.title),p.createElement(S.Cell,{right:!0,aligned:!0},t.can_edit?p.createElement(E,{name:"pencil"}):null,t.can_edit?p.createElement(E,{name:"archive"}):null))})))),p.createElement(x,o({request:{query:"Suggest next steps.",messages:[{role:"user",content:"The following is a list of tasks: ".concat(JSON.stringify(r.tasks))}]},chat:this.props.chat,fetchResponse:this.props.fetchResponse},this.props)),p.createElement(_,o({},this.props,{context:{tasks:r,summary:null==i?void 0:i.content},messagesEndRef:this.messagesEndRef,includeFeed:!0,placeholder:"Your request...",resetInformationSidebar:this.props.resetInformationSidebar,messageInfo:this.props.messageInfo,thumbsUp:this.props.thumbsUp,thumbsDown:this.props.thumbsDown})))}},{key:"_toHTML",value:function(){return m.renderToString(this.render())}},{key:"toHTML",value:function(){return this._toHTML()}}])&&s(n.prototype,h),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,h}(p.Component);e.exports=k},3674:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=function(e,t,n){return t=a(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}(this,t,[l]),n=e,s=function(e){console.debug("got change:",e.target.name,e.target.value)},(o=u(o="handleTaskChange"))in n?Object.defineProperty(n,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[o]=s,e.state={loading:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(t,e),n=t,(f=[{key:"componentDidMount",value:function(){this.props.fetchResource()}},{key:"componentDidUpdate",value:function(e){this.props.task,e.task}},{key:"render",value:function(){var e=this.props,t=e.network,n=e.task;return l.createElement(h,{loading:null==t?void 0:t.loading,style:{maxHeight:"100%",height:"97vh"}},l.createElement(d,{as:"h1"}),l.createElement(m,null,l.createElement(m.Header,null,l.createElement(m.Row,null,l.createElement(m.HeaderCell,null,"#"),l.createElement(m.HeaderCell,null),l.createElement(m.HeaderCell,null,l.createElement("code",null,"Content-Type")),l.createElement(m.HeaderCell,null,"Title"),l.createElement(m.HeaderCell,null,"Content"))),l.createElement(m.Body,null,l.createElement(m.Row,null,l.createElement(m.Cell,null,n.id),l.createElement(m.Cell,null,l.createElement(p,{type:"checkbox",name:"task_is_complete",checked:!0})),l.createElement(m.Cell,null,l.createElement("code",null,"text/plain")),l.createElement(m.Cell,null,l.createElement("code",null,n.title)),l.createElement(m.Cell,null,l.createElement("code",null,n.description))))))}},{key:"_toHTML",value:function(){return c.renderToString(this.render())}},{key:"toHTML",value:function(){return this._toHTML()}}])&&o(n.prototype,f),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,f}(l.Component));e.exports=y},5335:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,o=[i],r=u(r=t),function(e,t,n){(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(e=a(n,s()?Reflect.construct(r,o||[],u(n).constructor):r.apply(n,o)),"handleSearchChange",f((function(t){e.setState({searching:!0}),e.props.searchUpload(t)}),1e3)),e.state={searchQuery:"",filteredUploads:[],searching:!1},a(e,e)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,r=[{key:"componentDidMount",value:function(){this.props.fetchUserFiles(this.props.auth.id)}},{key:"componentDidUpdate",value:function(e){var t=this.props.files;e.files!=t&&!t.loading&&this.state.searching&&this.setState({filteredUploads:t.results,searching:!1})}},{key:"render",value:function(){var e=this,t=this.props,n=t.loading,r=(t.error,t.files),i=this.state,a=i.filteredUploads,s=i.searchQuery,u=i.searching,l=s?a:r;return h.createElement(v,{className:"fade-in",fluid:!0,style:{maxHeight:"100%"}},h.createElement(S,{color:"green",floated:"right",as:p,to:"/uploads#new"},"Upload File »"),h.createElement("h1",null,"Uploads"),h.createElement("p",null,h.createElement("strong",null,0)," files."),h.createElement("fabric-search",{fluid:!0,placeholder:"Find...",className:"ui search"},h.createElement("div",{className:"ui huge icon fluid input"},h.createElement("input",{name:"query",autoComplete:"off",placeholder:"Find...",type:"text",tabIndex:"0",className:"prompt",onChange:function(t){var n=t.target.value;e.setState({searchQuery:n}),e.handleSearchChange(n)}}),h.createElement("i",{"aria-hidden":"true",className:"search icon"}))),h.createElement(b,{as:y.Group,doubling:!0,centered:!0,loading:n,style:{marginTop:"1em"}},u||r.loading?h.createElement(w,{active:!0,inline:"centered"}):l&&l.files&&l.files.length>0?l.files.map((function(t){return h.createElement(b.Item,{as:y,key:t.id,loading:n},h.createElement(y.Content,null,h.createElement("h3",null,h.createElement(p,{to:"/files/"+t.id,onClick:function(){return e.props.resetChat()}},t.name)),h.createElement(g.Group,{basic:!0},h.createElement(g,null,h.createElement(E,{name:"calendar"}),x(t.decision_date))),h.createElement("p",null,t.content)))})):h.createElement("p",null,"No results found")),h.createElement(_,o({},this.props,{messagesEndRef:this.messagesEndRef,includeFeed:!0,placeholder:"Ask about these files...",resetInformationSidebar:this.props.resetInformationSidebar,messageInfo:this.props.messageInfo,thumbsUp:this.props.thumbsUp,thumbsDown:this.props.thumbsDown})))}},{key:"_toHTML",value:function(){return d.renderToString(this.render())}},{key:"toHTML",value:function(){return this._toHTML()}}],r&&i(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(h.Component);e.exports=k},5444:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,o=[i],r=u(r=t),(e=a(n,s()?Reflect.construct(r,o||[],u(n).constructor):r.apply(n,o))).state={loading:!1},a(e,e)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.props.fetchKeys()}},{key:"toggleCreateKeyModal",value:function(){console.debug("creating modal...")}},{key:"togglePaymentCreateModal",value:function(){console.debug("creating modal...")}},{key:"render",value:function(){var e=this.props,t=e.network,n=e.wallet;return console.debug("wallet:",n),c.createElement(p,{className:"fade-in",loading:null==t?void 0:t.loading,style:{maxHeight:"100%",height:"97vh"}},c.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},c.createElement("h1",{style:{marginTop:"0"}},"Wallet"),c.createElement(d.Group,null,c.createElement(d,{icon:!0,color:"black",onClick:this.togglePaymentCreateModal.bind(this)},c.createElement(y,{name:"send"}),"   Pay... "),c.createElement(d,{icon:!0,color:"green",onClick:this.toggleCreateKeyModal.bind(this)},"Add Funds ",c.createElement(y,{name:"add"})))),c.createElement(m,{as:"h2"},"Overview"),c.createElement(b,null,c.createElement(v,null,n&&n.balance||0),c.createElement(g,null,"balance")),c.createElement(b,null,c.createElement(v,null,n&&n.spendable||0),c.createElement(g,null,"spendable")),c.createElement(b,null,c.createElement(v,null,n&&n.unconfirmed||0),c.createElement(g,null,"unconfirmed")),c.createElement(m,{as:"h2"},"Unspent Transactions"),c.createElement(w,null,c.createElement(w.Header,null,c.createElement(w.Row,null,c.createElement(w.HeaderCell,null),c.createElement(w.HeaderCell,null),c.createElement(w.HeaderCell,null))),c.createElement(w.Body,null,n&&n.utxos&&n.utxos.map((function(e){return c.createElement(w.Row,null,c.createElement(w.Cell,null),c.createElement(w.Cell,null,e.title),c.createElement(w.Cell,null,c.createElement(y,{name:"note"})))})))),c.createElement(m,{as:"h2"},"Keys"),c.createElement(w,null,c.createElement(w.Header,null,c.createElement(w.Row,null,c.createElement(w.HeaderCell,null),c.createElement(w.HeaderCell,null),c.createElement(w.HeaderCell,null))),c.createElement(w.Body,null,n&&n.keys&&n.keys.map((function(e){return c.createElement(w.Row,null,c.createElement(w.Cell,null),c.createElement(w.Cell,null,e.title),c.createElement(w.Cell,null,c.createElement(y,{name:"pencil"}),c.createElement(y,{name:"archive"})))})))))}},{key:"_toHTML",value:function(){return f.renderToString(this.render())}},{key:"toHTML",value:function(){return this._toHTML()}}])&&o(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(c.Component);e.exports=E},5321:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n480?void 0:null,firstItem:r>480?void 0:null,lastItem:r>480?void 0:null,boundaryRange:r>480?1:0,style:{marginTop:"1em"}}))}}])&&o(n.prototype,l),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,l}(c.Component);e.exports=y},2387:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new L(r||[]);return a(i,"_invoke",{value:O(e,n,s)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var S={};f(S,u,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&i.call(x,u)&&(S=x);var k=E.prototype=b.prototype=Object.create(S);function M(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,s,u){var l=d(e[o],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function O(t,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?v:m,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n0?d.createElement(v.Row,null,d.createElement(v.Cell,null,d.createElement(y,{as:"h5"},"Queue")),d.createElement(v.Cell,null,null==n?void 0:n.map((function(e){return d.createElement("div",null,d.createElement(m,{style:{margin:"auto 0 0.3em 0"}},e.method))}))),d.createElement(v.Cell,null,null==n?void 0:n.map((function(e){return d.createElement("div",null,d.createElement(m,{style:{margin:"auto 0 0.3em 0"}},e.params[0]))}))),d.createElement(v.Cell,null)):d.createElement(v.Row,null,d.createElement(v.Cell,null,d.createElement(y,{as:"h5"},"Queue")),d.createElement(v.Cell,null,d.createElement(m,null,"Empty")),d.createElement(v.Cell,null),d.createElement(v.Cell,null)))),this.renderConfirmModal())}}])&&s(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(d.Component);e.exports=E},2532:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n{"use strict";var r=n(8901),o=r.BITCOIN_NETWORK,i=r.FIXTURE_SEED;e.exports={GENESIS_HASH:"",RELEASE_NAME:"1.0.0-RC1",RELEASE_DESCRIPTION:"Exclusive access!",SNAPSHOT_INTERVAL:6e5,MAX_RESPONSE_TIME_MS:6e5,BITCOIN_NETWORK:o,FIXTURE_SEED:i,AGENT_MAX_TOKENS:8192,MAX_MEMORY_SIZE:33554432,INTEGRITY_CHECK:!1,ALLOWED_UPLOAD_TYPES:["image/png","image/jpeg","image/tiff","image/bmp","application/pdf"],BCRYPT_PASSWORD_ROUNDS:10,EMBEDDING_MODEL:"mxbai-embed-large",ENABLE_CONTENT_TOPBAR:!0,ENABLE_CONTRACTS:!0,ENABLE_CHANGELOG:!0,ENABLE_CONVERSATION_SIDEBAR:!1,ENABLE_DISCORD_LOGIN:!1,ENABLE_DOCUMENTS:!0,ENABLE_FEEDBACK_BUTTON:!1,ENABLE_BILLING:!1,ENABLE_LOGIN:!0,ENABLE_REGISTRATION:!1,ENABLE_CHAT:!0,ENABLE_FILES:!0,ENABLE_DOCUMENT_SEARCH:!0,ENABLE_PERSON_SEARCH:!1,ENABLE_UPLOADS:!1,ENABLE_LIBRARY:!0,ENABLE_SOURCES:!0,ENABLE_TASKS:!0,ENABLE_WALLET:!1,PER_PAGE_LIMIT:100,PER_PAGE_DEFAULT:30,BROWSER_DATABASE_NAME:"sensemaker",BROWSER_DATABASE_TOKEN_TABLE:"tokens",BRAND_NAME:"Sensemaker",CHATGPT_MAX_TOKENS:8192,OPENAI_API_KEY:"replace with a valid OpenAI key",AGENT_TEMPERATURE:.5,USER_QUERY_TIMEOUT_MS:15e3,USER_HINT_TIME_MS:3e3,USER_MENU_HOVER_TIME_MS:1e3,SYNC_EMBEDDINGS_COUNT:100}},4641:e=>{e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Fetch timed out";return new Promise((function(n,r){setTimeout((function(){r(new Error(t))}),e)}))}},8574:e=>{e.exports=function(e){var t=new Date(e);if(isNaN(t.getTime()))return"Invalid Date";var n=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"long",day:"numeric"}).format(t),r=t.getDate(),o="th";return r%10==1&&11!==r?o="st":r%10==2&&12!==r?o="nd":r%10==3&&13!==r&&(o="rd"),n.replace(new RegExp(" ".concat(r,","))," ".concat(r).concat(o,","))}},3369:e=>{e.exports=function(e){var t=new Date-new Date(e),n=Math.floor(t/1e3),r=Math.floor(n/60),o=Math.floor(r/60),i=Math.floor(o/24),a=Math.floor(i/7),s=Math.floor(a/4),u=Math.floor(s/12);return u>0?"".concat(u," year").concat(1===u?"":"s"," ago"):s>0?"".concat(s," month").concat(1===s?"":"s"," ago"):a>0?"".concat(a," week").concat(1===a?"":"s"," ago"):i>0?"".concat(i," day").concat(1===i?"":"s"," ago"):o>0?"".concat(o," hour").concat(1===o?"":"s"," ago"):r>0?"".concat(r," minute").concat(1===r?"":"s"," ago"):n>0?"".concat(n," second").concat(1===n?"":"s"," ago"):"just now"}},5482:(e,t,n)=>{var r={position:"bottom-center",autoClose:5e3,icon:"🗨️",hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",transition:n(4168).Slide};e.exports={helpMessageToastEmitter:r,helpMessageSound:"https://s3.amazonaws.com/freecodecamp/simonSound1.mp3"}},4003:e=>{"use strict";e.exports={LOCALE:"en",BRAND_NAME:"sensemaker",BRAND_TAGLINE:"the next generation.",PITCH_CTA_TEXT:"Order from chaos. Powerful tools for intelligence work."}},5885:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{loading:!0,error:null});case l:return i(i({},e),{},{loading:!1,current:t.payload});case c:return i(i({},e),{},{loading:!1,error:t.payload});case f:return i(i({},e),{},{loading:!0,error:null});case h:return i(i({},e),{},{loading:!1,users:t.payload});case d:return i(i({},e),{},{loading:!1,error:t.payload});case p:return i(i({},e),{},{reseting:!0,error:null,passwordReseted:!1,currentEmail:t.payload});case m:return i(i({},e),{},{reseting:!1,error:null,passwordReseted:!0});case y:return i(i({},e),{},{reseting:!1,error:t.payload,passwordReseted:!1});default:return e}}},1652:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:w,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i({},e);case l:return i(i(i({},e),t.payload),{},{loading:!1});case c:return console.debug("fetch admin stats failure:",e,t),i(i({},e),{},{error:t.payload,loading:!1});case f:return i({},e);case h:return i(i(i({},e),t.payload),{},{loading:!1});case d:return console.debug("fetch sync stats failure:",e,t),i(i({},e),{},{error:t.payload,loading:!1});case p:return i({},e);case m:return i(i({},e),{},{loading:!1,userEditSuccess:!0});case y:return console.debug("edit username failure:",e,t),i(i({},e),{},{error:t.payload,loading:!1,userEditSuccess:!1});case v:return i({},e);case g:return i(i({},e),{},{loading:!1,emailEditSuccess:!0});case b:return console.debug("edit email failure:",e,t),i(i({},e),{},{error:t.payload,loading:!1,emailEditSuccess:!1});default:return e}}},7487:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:x,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{isAuthenticated:!1,token:null,error:null,loading:!0});case l:return i(i({},e),{},{isAuthenticated:!0,isAdmin:t.payload.isAdmin||!1,isBeta:t.payload.isBeta||!1,isCompliant:t.payload.isCompliant||!1,username:t.payload.username,email:t.payload.email,user_discord:t.payload.user_discord,token:t.payload.token,id:t.payload.id,loading:!1});case c:return i(i({},e),{},{isAuthenticated:!1,token:null,error:t.payload,loading:!1});case _:return i(i({},e),{},{isCompliant:!0});case f:return i(i({},e),{},{checking:!0});case h:return i(i({},e),{},{usernameAvailable:!0,checking:!1,error:null});case d:return i(i({},e),{},{error:t.payload,usernameAvailable:!1,checking:!1});case p:return i(i({},e),{},{checking:!0});case m:return i(i({},e),{},{emailAvailable:!0,checking:!1});case y:return i(i({},e),{},{error:t.payload,emailAvailable:!1,checking:!1});case w:return i(i({},e),{},{loading:!0});case E:return i(i({},e),{},{shortRegisterError:null,shortRegisterSuccess:!0,loading:!1});case S:return i(i({},e),{},{shortRegisterError:t.payload,shortRegisterSuccess:!1,loading:!1});case v:return i(i({},e),{},{registering:!0});case g:return i(i({},e),{},{registerSuccess:!0,registering:!1});case b:return i(i({},e),{},{error:t.payload,registerSuccess:!1,registering:!1});default:return e}}},5010:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{loading:!0,error:null});case l:return i(i({},e),{},{loading:!1,current:t.payload});case c:return i(i({},e),{},{loading:!1,error:t.payload});default:return e}}},1571:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{message:"",error:null,isSending:!0});case l:return i(i({},e),{},{message:t.payload.message.object,isMessageSent:!0,isSending:!1});case c:return i(i({},e),{},{error:t.payload,isMessageSent:!1,isSending:!1});case f:return i(i({},e),{},{messages:t.payload.messages,isSending:!1,loading:!1});case h:return i(i({},e),{},{isSending:!0});case d:return i(i({},e),{},{isSending:!1,response:t.payload});case p:return i(i({},e),{},{error:t.payload,isSending:!1});case m:case y:return v;default:return e}}},3079:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:case l:return i(i({},e),{},{contract:t.payload});case c:return i(i({},e),{},{error:t.payload});case h:return i(i({},e),{},{messages:t.payload.messages,isSending:!1,loading:!1});case f:return i(i({},e),{},{contract:t.payload,isCompliant:!0});default:return e}}},996:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{loading:!0,error:null});case l:return i(i({},e),{},{loading:!1,conversation:t.payload});case c:return i(i({},e),{},{loading:!1,error:t.payload});case f:return i(i({},e),{},{loading:!0,error:null});case h:return i(i({},e),{},{loading:!1,conversations:t.payload});case d:return i(i({},e),{},{loading:!1,error:t.payload});case p:return i(i({},e),{},{editing:!0,error:null});case m:return i(i({},e),{},{editing:!1,titleEditSuccess:!0});case y:return i(i({},e),{},{editing:!1,error:t.payload,titleEditSuccess:!1});default:return e}}},8478:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:H,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{loading:!0,error:null});case l:return i(i({},e),{},{loading:!1,document:t.payload});case c:return i(i({},e),{},{loading:!1,error:t.payload});case f:return i(i({},e),{},{loading:!0,error:null});case h:return i(i({},e),{},{loading:!1,sections:t.payload});case d:return i(i({},e),{},{loading:!1,error:t.payload});case p:return i(i({},e),{},{loading:!0,error:null});case m:return i(i({},e),{},{loading:!1,documents:t.payload});case y:return i(i({},e),{},{loading:!1,error:t.payload});case v:return i(i({},e),{},a({loading:!0,error:null,fileUploaded:!1,fabric_id:null},"error",null));case g:return i(i({},e),{},{loading:!1,fileUploaded:!0,fabric_id:t.payload,error:null});case b:return i(i({},e),{},{loading:!1,error:t.payload,fileUploaded:!1,fabric_id:null});case w:return i(i({},e),{},{loading:!0,error:null,results:[]});case E:return i(i({},e),{},{loading:!1,results:t.payload,error:null});case S:return i(i({},e),{},{loading:!1,error:t.payload,results:[]});case _:return i(i({},e),{},{creating:!0,error:null,document:{},creationSuccess:!1});case x:return console.log(t.payload),i(i({},e),{},{creating:!1,document:t.payload,error:null,creationSuccess:!0});case k:return i(i({},e),{},{creating:!1,error:t.payload,document:{},creationSuccess:!1});case M:return i(i({},e),{},{creating:!0,error:null,creationSuccess:!1});case C:return i(i({},e),{},{creating:!1,error:null,creationSuccess:!0,sections:t.payload});case O:return i(i({},e),{},{creating:!1,error:t.payload,creationSuccess:!1});case T:return i(i({},e),{},{editing:!0,error:null,deleteSuccess:!1});case A:return i(i({},e),{},{editing:!1,error:null,deleteSuccess:!0,sections:t.payload});case P:return i(i({},e),{},{editing:!1,error:t.payload,deleteSuccess:!1});case N:return i(i({},e),{},{creating:!0,error:null,editionSuccess:!1});case I:return console.log(t.payload),i(i({},e),{},{creating:!1,error:null,editionSuccess:!0,sections:t.payload});case R:return i(i({},e),{},{creating:!1,error:t.payload,editionSuccess:!1});case L:return i(i({},e),{},{editing:!0,error:null,editionSuccess:!1});case D:return console.log(t.payload),i(i({},e),{},{editing:!1,error:null,document:t.payload,editionSuccess:!0});case j:return i(i({},e),{},{editing:!1,error:t.payload,editionSuccess:!1});case F:return i(i({},e),{},{editing:!0,error:null,deleteSuccess:!1});case U:return console.log(t.payload),i(i({},e),{},{editing:!1,error:null,deleteSuccess:!0});case B:return i(i({},e),{},{editing:!1,error:t.payload,deleteSuccess:!1});default:return e}}},6188:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{loading:!0,error:null});case l:return i(i({},e),{},{loading:!1,sentSuccesfull:!0,error:null});case c:return i(i({},e),{},{loading:!1,error:t.payload,sentSuccesfull:!1});default:return e}}},3003:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:w,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{loading:!0,error:null});case l:return i(i({},e),{},{loading:!1,file:t.payload});case c:return i(i({},e),{},{loading:!1,error:t.payload});case f:return i(i({},e),{},{loading:!0,error:null});case h:return i(i({},e),{},{loading:!1,files:t.payload});case d:return i(i({},e),{},{loading:!1,error:t.payload});case p:return i(i({},e),{},a({loading:!0,error:null,fileUploaded:!1,fabric_id:null},"error",null));case m:return i(i({},e),{},{loading:!1,fileUploaded:!0,fabric_id:t.payload,error:null});case y:return i(i({},e),{},{loading:!1,error:t.payload,fileUploaded:!1,fabric_id:null});case v:return i(i({},e),{},{loading:!0,error:null,results:[]});case g:return i(i({},e),{},{loading:!1,results:t.payload,error:null});case b:return i(i({},e),{},{loading:!1,error:t.payload,results:[]});default:return e}}},4552:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:M,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{error:null,loading:!0});case l:return i(i({},e),{},{conversations:t.payload,loading:!1});case c:return console.debug("fetch help conversations failure:",e,t),i(i({},e),{},{conversations:[],error:t.payload,loading:!1});case f:return i(i({},e),{},{error:null,loading:!0});case h:return i(i({},e),{},{admin_conversations:t.payload,loading:!1});case d:return console.debug("fetch help admin conversations failure:",e,t),i(i({},e),{},{admin_conversations:[],error:t.payload,loading:!1});case p:return i(i({},e),{},{error:null,loadingMsgs:!0});case m:return i(i({},e),{},{messages:t.payload,loadingMsgs:!1});case y:return console.debug("fetch help messages failure:",e,t),i(i({},e),{},{error:t.payload,messages:[],loadingMsgs:!1});case v:return i(i({},e),{},{error:null,loadingMsgsAdmin:!0});case g:return i(i({},e),{},{admin_messages:t.payload,loadingMsgsAdmin:!1});case b:return console.debug("fetch help messages failure:",e,t),i(i({},e),{},{error:t.payload,admin_messages:[],loadingMsgsAdmin:!1});case w:return i(i({},e),{},{sentSuccess:!1,error:null,sending:!0});case E:return i(i({},e),{},{conversation_id:t.payload,sentSuccess:!0,sending:!1});case S:return console.debug("send help message failure:",e,t),i(i({},e),{},{sentSuccess:!1,error:t.payload,sending:!1});case _:return i(i({},e),{},{sentSuccess:!1,error:null});case x:return i(i({},e),{},{messages:[],error:null});case k:return console.debug("clear help messages failure:",e,t),i(i({},e),{},{error:t.payload});default:return e}}},9182:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{loading:!0});case l:return i(i({},e),{},{inquiries:t.payload,loading:!1});case c:return console.debug("fetch inquiries failure:",e,t),i(i({},e),{},{error:t.payload,loading:!1});case f:return i(i({},e),{},{creating:!0});case h:return i(i({},e),{},{createdSuccess:!0,creating:!1});case d:return console.debug("fetch inquiries failure:",e,t),i(i({},e),{},{createdSuccess:!1,error:t.payload,creating:!1});default:return e}}},6244:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:w,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{loading:!0});case l:return i(i({},e),{},{current:t.payload,loading:!1});case c:return console.debug("fetch invitation failure:",e,t),i(i({},e),{},{error:t.payload,loading:!1});case f:return i(i({},e),{},{loading:!0});case h:return i(i({},e),{},{invitations:t.payload,loading:!1});case d:return console.debug("fetch invitations failure:",e,t),i(i({},e),{},{error:t.payload,loading:!1});case p:return i(i({},e),{},{sending:!0});case m:return i(i({},e),{},{invitationSent:!0,sending:!1});case y:return i(i({},e),{},{error:t.payload,invitationSent:!1,sending:!1});case v:return i(i({},e),{},{loading:!0});case g:return i(i({},e),{},{invitationValid:!0,loading:!1,invitation:t.payload});case b:return i(i({},e),{},{error:t.payload,invitationValid:!1,loading:!1});default:return e}}},78:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{loading:!0,error:null});case l:return i(i({},e),{},{loading:!1,person:t.payload});case c:return i(i({},e),{},{loading:!1,error:t.payload});case f:return i(i({},e),{},{loading:!0,error:null});case h:return i(i({},e),{},{loading:!1,people:t.payload});case d:return i(i({},e),{},{loading:!1,error:t.payload});default:return e}}},1684:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{loading:!0,error:null});case l:return i(i({},e),{},{loading:!1,queue:t.payload});case c:return i(i({},e),{},{loading:!1,error:t.payload});case f:return i(i({},e),{},{loading:!0,error:null});case h:return i(i({},e),{},{loading:!1,lastJobTaken:t.payload});case d:return i(i({},e),{},{loading:!1,error:t.payload});case p:return i(i({},e),{},{loading:!0,error:null});case m:return i(i({},e),{},{loading:!1,lastJobCompleted:t.payload});case y:return i(i({},e),{},{loading:!1,error:t.payload});default:return e}}},8365:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{searching:!0,error:null});case l:return i(i({},e),{},{searching:!1,result:t.payload,error:null});case c:return i(i({},e),{},{searching:!1,error:t.payload,result:{}});default:return e}}},1755:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{loading:!0});case l:return i(i({},e),{},{tasks:t.payload,loading:!1});case c:return console.debug("fetch tasks failure:",e,t),i(i({},e),{},{error:t.payload,loading:!1});case f:return i(i({},e),{},{creating:!0});case h:return i(i({},e),{},{createdSuccess:!0,creating:!1});case d:return console.debug("fetch tasks failure:",e,t),i(i({},e),{},{createdSuccess:!1,error:t.payload,creating:!1});default:return e}}},1738:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case u:return i(i({},e),{},{loading:!0});case l:return i(i({},e),{},{keys:t.payload,wallet:{keys:t.payload},loading:!1});case c:return console.debug("fetch keys failure:",e,t),i(i({},e),{},{error:t.payload,loading:!1});case f:return i(i({},e),{},{creating:!0});case h:return i(i({},e),{},{createdSuccess:!0,creating:!1});case d:return console.debug("fetch keys failure:",e,t),i(i({},e),{},{createdSuccess:!1,error:t.payload,creating:!1});default:return e}}},7468:(e,t,n)=>{"use strict";var r=n(1407),o=r.createStore,i=r.combineReducers,a=r.applyMiddleware,s=n(1265).A,u=n(5885),l=n(1652),c=n(7487),f=n(5010),h=n(1571),d=n(3079),p=n(996),m=n(8478),y=n(3003),v=n(9182),g=n(6244),b=n(78),w=n(8365),E=n(1755),S=i({accounts:u,auth:c,bridge:f,chat:h,contracts:d,conversations:p,documents:m,files:y,stats:l,people:b,inquiries:v,invitation:g,search:w,feedback:n(6188),help:n(4552),redis:n(1684),tasks:E,users:u,wallet:n(1738)});e.exports=o(S,a(s))},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],u=i[1],l=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,u)),c=0,f=u>0?a-4:a;for(n=0;n>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===u&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,l[c++]=255&t),1===u&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,l=r-o;sl?l:s+a));return 1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var o,i,a=[],s=t;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},9404:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(7790).Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,n,o){for(var i=0,a=0,s=Math.min(e.length,n),u=t;u=49?l-49+10:l>=17?l-17+10:l,r(l>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=u(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,u=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var l=1;l>>26,f=67108863&u,h=Math.min(l,t.length-1),d=Math.max(0,l-e.length+1);d<=h;d++){var p=l-d|0;c+=(a=(o=0|e.words[p])*(i=0|t.words[d])+f)/67108864|0,f=67108863&a}n.words[l]=0|f,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n._strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),n=0!==i||a!==this.length-1?h[6-u.length]+u+n:u+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=d[e],c=p[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(c).toString(e);n=(f=f.idivn(c)).isZero()?m+n:h[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){this._strip();var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,o),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,o=0,i=0;o>8&255),n>16&255),6===i?(n>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===i?(n>=0&&(e[n--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 8191&t||(n+=13,t>>>=13),127&t||(n+=7,t>>>=7),15&t||(n+=4,t>>>=4),3&t||(n+=2,t>>>=2),1&t||n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,y=0|a[2],v=8191&y,g=y>>>13,b=0|a[3],w=8191&b,E=b>>>13,S=0|a[4],_=8191&S,x=S>>>13,k=0|a[5],M=8191&k,C=k>>>13,O=0|a[6],T=8191&O,A=O>>>13,P=0|a[7],L=8191&P,D=P>>>13,j=0|a[8],N=8191&j,I=j>>>13,R=0|a[9],F=8191&R,U=R>>>13,B=0|s[0],H=8191&B,z=B>>>13,q=0|s[1],G=8191&q,V=q>>>13,W=0|s[2],K=8191&W,$=W>>>13,Q=0|s[3],Y=8191&Q,Z=Q>>>13,J=0|s[4],X=8191&J,ee=J>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],fe=8191&ce,he=ce>>>13,de=0|s[9],pe=8191&de,me=de>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(l+(r=Math.imul(f,H))|0)+((8191&(o=(o=Math.imul(f,z))+Math.imul(h,H)|0))<<13)|0;l=((i=Math.imul(h,z))+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(p,H),o=(o=Math.imul(p,z))+Math.imul(m,H)|0,i=Math.imul(m,z);var ve=(l+(r=r+Math.imul(f,G)|0)|0)+((8191&(o=(o=o+Math.imul(f,V)|0)+Math.imul(h,G)|0))<<13)|0;l=((i=i+Math.imul(h,V)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,H),o=(o=Math.imul(v,z))+Math.imul(g,H)|0,i=Math.imul(g,z),r=r+Math.imul(p,G)|0,o=(o=o+Math.imul(p,V)|0)+Math.imul(m,G)|0,i=i+Math.imul(m,V)|0;var ge=(l+(r=r+Math.imul(f,K)|0)|0)+((8191&(o=(o=o+Math.imul(f,$)|0)+Math.imul(h,K)|0))<<13)|0;l=((i=i+Math.imul(h,$)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(w,H),o=(o=Math.imul(w,z))+Math.imul(E,H)|0,i=Math.imul(E,z),r=r+Math.imul(v,G)|0,o=(o=o+Math.imul(v,V)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,V)|0,r=r+Math.imul(p,K)|0,o=(o=o+Math.imul(p,$)|0)+Math.imul(m,K)|0,i=i+Math.imul(m,$)|0;var be=(l+(r=r+Math.imul(f,Y)|0)|0)+((8191&(o=(o=o+Math.imul(f,Z)|0)+Math.imul(h,Y)|0))<<13)|0;l=((i=i+Math.imul(h,Z)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(_,H),o=(o=Math.imul(_,z))+Math.imul(x,H)|0,i=Math.imul(x,z),r=r+Math.imul(w,G)|0,o=(o=o+Math.imul(w,V)|0)+Math.imul(E,G)|0,i=i+Math.imul(E,V)|0,r=r+Math.imul(v,K)|0,o=(o=o+Math.imul(v,$)|0)+Math.imul(g,K)|0,i=i+Math.imul(g,$)|0,r=r+Math.imul(p,Y)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(m,Y)|0,i=i+Math.imul(m,Z)|0;var we=(l+(r=r+Math.imul(f,X)|0)|0)+((8191&(o=(o=o+Math.imul(f,ee)|0)+Math.imul(h,X)|0))<<13)|0;l=((i=i+Math.imul(h,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(M,H),o=(o=Math.imul(M,z))+Math.imul(C,H)|0,i=Math.imul(C,z),r=r+Math.imul(_,G)|0,o=(o=o+Math.imul(_,V)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,V)|0,r=r+Math.imul(w,K)|0,o=(o=o+Math.imul(w,$)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,$)|0,r=r+Math.imul(v,Y)|0,o=(o=o+Math.imul(v,Z)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(p,X)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,ee)|0;var Ee=(l+(r=r+Math.imul(f,ne)|0)|0)+((8191&(o=(o=o+Math.imul(f,re)|0)+Math.imul(h,ne)|0))<<13)|0;l=((i=i+Math.imul(h,re)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(T,H),o=(o=Math.imul(T,z))+Math.imul(A,H)|0,i=Math.imul(A,z),r=r+Math.imul(M,G)|0,o=(o=o+Math.imul(M,V)|0)+Math.imul(C,G)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(_,K)|0,o=(o=o+Math.imul(_,$)|0)+Math.imul(x,K)|0,i=i+Math.imul(x,$)|0,r=r+Math.imul(w,Y)|0,o=(o=o+Math.imul(w,Z)|0)+Math.imul(E,Y)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(v,X)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(g,X)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(m,ne)|0,i=i+Math.imul(m,re)|0;var Se=(l+(r=r+Math.imul(f,ie)|0)|0)+((8191&(o=(o=o+Math.imul(f,ae)|0)+Math.imul(h,ie)|0))<<13)|0;l=((i=i+Math.imul(h,ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,H),o=(o=Math.imul(L,z))+Math.imul(D,H)|0,i=Math.imul(D,z),r=r+Math.imul(T,G)|0,o=(o=o+Math.imul(T,V)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,V)|0,r=r+Math.imul(M,K)|0,o=(o=o+Math.imul(M,$)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,$)|0,r=r+Math.imul(_,Y)|0,o=(o=o+Math.imul(_,Z)|0)+Math.imul(x,Y)|0,i=i+Math.imul(x,Z)|0,r=r+Math.imul(w,X)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(E,X)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(v,ne)|0,o=(o=o+Math.imul(v,re)|0)+Math.imul(g,ne)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0;var _e=(l+(r=r+Math.imul(f,ue)|0)|0)+((8191&(o=(o=o+Math.imul(f,le)|0)+Math.imul(h,ue)|0))<<13)|0;l=((i=i+Math.imul(h,le)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,H),o=(o=Math.imul(N,z))+Math.imul(I,H)|0,i=Math.imul(I,z),r=r+Math.imul(L,G)|0,o=(o=o+Math.imul(L,V)|0)+Math.imul(D,G)|0,i=i+Math.imul(D,V)|0,r=r+Math.imul(T,K)|0,o=(o=o+Math.imul(T,$)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,$)|0,r=r+Math.imul(M,Y)|0,o=(o=o+Math.imul(M,Z)|0)+Math.imul(C,Y)|0,i=i+Math.imul(C,Z)|0,r=r+Math.imul(_,X)|0,o=(o=o+Math.imul(_,ee)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,ee)|0,r=r+Math.imul(w,ne)|0,o=(o=o+Math.imul(w,re)|0)+Math.imul(E,ne)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(v,ie)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,ae)|0,r=r+Math.imul(p,ue)|0,o=(o=o+Math.imul(p,le)|0)+Math.imul(m,ue)|0,i=i+Math.imul(m,le)|0;var xe=(l+(r=r+Math.imul(f,fe)|0)|0)+((8191&(o=(o=o+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;l=((i=i+Math.imul(h,he)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(F,H),o=(o=Math.imul(F,z))+Math.imul(U,H)|0,i=Math.imul(U,z),r=r+Math.imul(N,G)|0,o=(o=o+Math.imul(N,V)|0)+Math.imul(I,G)|0,i=i+Math.imul(I,V)|0,r=r+Math.imul(L,K)|0,o=(o=o+Math.imul(L,$)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,$)|0,r=r+Math.imul(T,Y)|0,o=(o=o+Math.imul(T,Z)|0)+Math.imul(A,Y)|0,i=i+Math.imul(A,Z)|0,r=r+Math.imul(M,X)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,ee)|0,r=r+Math.imul(_,ne)|0,o=(o=o+Math.imul(_,re)|0)+Math.imul(x,ne)|0,i=i+Math.imul(x,re)|0,r=r+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,ae)|0,r=r+Math.imul(v,ue)|0,o=(o=o+Math.imul(v,le)|0)+Math.imul(g,ue)|0,i=i+Math.imul(g,le)|0,r=r+Math.imul(p,fe)|0,o=(o=o+Math.imul(p,he)|0)+Math.imul(m,fe)|0,i=i+Math.imul(m,he)|0;var ke=(l+(r=r+Math.imul(f,pe)|0)|0)+((8191&(o=(o=o+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;l=((i=i+Math.imul(h,me)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(F,G),o=(o=Math.imul(F,V))+Math.imul(U,G)|0,i=Math.imul(U,V),r=r+Math.imul(N,K)|0,o=(o=o+Math.imul(N,$)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,$)|0,r=r+Math.imul(L,Y)|0,o=(o=o+Math.imul(L,Z)|0)+Math.imul(D,Y)|0,i=i+Math.imul(D,Z)|0,r=r+Math.imul(T,X)|0,o=(o=o+Math.imul(T,ee)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,ee)|0,r=r+Math.imul(M,ne)|0,o=(o=o+Math.imul(M,re)|0)+Math.imul(C,ne)|0,i=i+Math.imul(C,re)|0,r=r+Math.imul(_,ie)|0,o=(o=o+Math.imul(_,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,r=r+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,le)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,le)|0,r=r+Math.imul(v,fe)|0,o=(o=o+Math.imul(v,he)|0)+Math.imul(g,fe)|0,i=i+Math.imul(g,he)|0;var Me=(l+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(F,K),o=(o=Math.imul(F,$))+Math.imul(U,K)|0,i=Math.imul(U,$),r=r+Math.imul(N,Y)|0,o=(o=o+Math.imul(N,Z)|0)+Math.imul(I,Y)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(L,X)|0,o=(o=o+Math.imul(L,ee)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(T,ne)|0,o=(o=o+Math.imul(T,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0,r=r+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,ae)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,ae)|0,r=r+Math.imul(_,ue)|0,o=(o=o+Math.imul(_,le)|0)+Math.imul(x,ue)|0,i=i+Math.imul(x,le)|0,r=r+Math.imul(w,fe)|0,o=(o=o+Math.imul(w,he)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,he)|0;var Ce=(l+(r=r+Math.imul(v,pe)|0)|0)+((8191&(o=(o=o+Math.imul(v,me)|0)+Math.imul(g,pe)|0))<<13)|0;l=((i=i+Math.imul(g,me)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(F,Y),o=(o=Math.imul(F,Z))+Math.imul(U,Y)|0,i=Math.imul(U,Z),r=r+Math.imul(N,X)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(L,ne)|0,o=(o=o+Math.imul(L,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(T,ie)|0,o=(o=o+Math.imul(T,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,r=r+Math.imul(M,ue)|0,o=(o=o+Math.imul(M,le)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,le)|0,r=r+Math.imul(_,fe)|0,o=(o=o+Math.imul(_,he)|0)+Math.imul(x,fe)|0,i=i+Math.imul(x,he)|0;var Oe=(l+(r=r+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(E,pe)|0))<<13)|0;l=((i=i+Math.imul(E,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(F,X),o=(o=Math.imul(F,ee))+Math.imul(U,X)|0,i=Math.imul(U,ee),r=r+Math.imul(N,ne)|0,o=(o=o+Math.imul(N,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(L,ie)|0,o=(o=o+Math.imul(L,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(T,ue)|0,o=(o=o+Math.imul(T,le)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,le)|0,r=r+Math.imul(M,fe)|0,o=(o=o+Math.imul(M,he)|0)+Math.imul(C,fe)|0,i=i+Math.imul(C,he)|0;var Te=(l+(r=r+Math.imul(_,pe)|0)|0)+((8191&(o=(o=o+Math.imul(_,me)|0)+Math.imul(x,pe)|0))<<13)|0;l=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(F,ne),o=(o=Math.imul(F,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(N,ie)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(L,ue)|0,o=(o=o+Math.imul(L,le)|0)+Math.imul(D,ue)|0,i=i+Math.imul(D,le)|0,r=r+Math.imul(T,fe)|0,o=(o=o+Math.imul(T,he)|0)+Math.imul(A,fe)|0,i=i+Math.imul(A,he)|0;var Ae=(l+(r=r+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,me)|0)+Math.imul(C,pe)|0))<<13)|0;l=((i=i+Math.imul(C,me)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(F,ie),o=(o=Math.imul(F,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(N,ue)|0,o=(o=o+Math.imul(N,le)|0)+Math.imul(I,ue)|0,i=i+Math.imul(I,le)|0,r=r+Math.imul(L,fe)|0,o=(o=o+Math.imul(L,he)|0)+Math.imul(D,fe)|0,i=i+Math.imul(D,he)|0;var Pe=(l+(r=r+Math.imul(T,pe)|0)|0)+((8191&(o=(o=o+Math.imul(T,me)|0)+Math.imul(A,pe)|0))<<13)|0;l=((i=i+Math.imul(A,me)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(F,ue),o=(o=Math.imul(F,le))+Math.imul(U,ue)|0,i=Math.imul(U,le),r=r+Math.imul(N,fe)|0,o=(o=o+Math.imul(N,he)|0)+Math.imul(I,fe)|0,i=i+Math.imul(I,he)|0;var Le=(l+(r=r+Math.imul(L,pe)|0)|0)+((8191&(o=(o=o+Math.imul(L,me)|0)+Math.imul(D,pe)|0))<<13)|0;l=((i=i+Math.imul(D,me)|0)+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(F,fe),o=(o=Math.imul(F,he))+Math.imul(U,fe)|0,i=Math.imul(U,he);var De=(l+(r=r+Math.imul(N,pe)|0)|0)+((8191&(o=(o=o+Math.imul(N,me)|0)+Math.imul(I,pe)|0))<<13)|0;l=((i=i+Math.imul(I,me)|0)+(o>>>13)|0)+(De>>>26)|0,De&=67108863;var je=(l+(r=Math.imul(F,pe))|0)+((8191&(o=(o=Math.imul(F,me))+Math.imul(U,pe)|0))<<13)|0;return l=((i=Math.imul(U,me))+(o>>>13)|0)+(je>>>26)|0,je&=67108863,u[0]=ye,u[1]=ve,u[2]=ge,u[3]=be,u[4]=we,u[5]=Ee,u[6]=Se,u[7]=_e,u[8]=xe,u[9]=ke,u[10]=Me,u[11]=Ce,u[12]=Oe,u[13]=Te,u[14]=Ae,u[15]=Pe,u[16]=Le,u[17]=De,u[18]=je,0!==l&&(u[19]=l,n.length++),n};function v(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n._strip()}function g(e,t,n){return v(e,t,n)}function b(e,t){this.x=e,this.y=t}Math.imul||(y=m),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):n<63?m(this,e,t):n<1024?v(this,e,t):g(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},b.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,n+=i/67108864|0,n+=a>>>26,this.words[o]=67108863&a}return 0!==n&&(this.words[o]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,l=0;l=0&&(0!==c||l>=o);l--){var f=0|this.words[l];this.words[l]=c<<26-i|f>>>i,c=f&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[o+n]=67108863&i}for(;o>26,this.words[o+n]=67108863&i;if(0===s)return this._strip();for(r(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l=0;f--){var h=67108864*(0|r.words[o.length+f])+(0|r.words[o.length+f-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,f);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):this.negative&e.negative?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(n*o+(0|this.words[i]))%e;return t?-o:o},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*n;this.words[o]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var c=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;!(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(c),a.isub(f)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;!(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(u)):(n.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:n.iushln(l)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,c=1;!(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;!(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new M(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function E(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function C(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},E.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},E.prototype.split=function(e,t){e.iushrn(this.n,0,t)},E.prototype.imulK=function(e){return e.imul(this.k)},o(S,E),S.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),o=0;o>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new S;else if("p224"===e)t=new _;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return w[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},M.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,o),h=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=a;0!==d.cmp(s);){for(var m=d,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var l=t.words[r],c=u-1;c>=0;c--){var f=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==f||0!==a?(a<<=1,a|=f,(4==++s||0===r&&0===c)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new C(e)},o(C,M),C.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},C.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},C.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},C.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},C.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},5037:(e,t,n)=>{var r;function o(e){this.rand=e}if(e.exports=function(e){return r||(r=new o(null)),r.generate(e)},e.exports.Rand=o,o.prototype.generate=function(e){return this._rand(e)},o.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n{var r=n(2861).Buffer;function o(e){r.isBuffer(e)||(e=r.from(e));for(var t=e.length/4|0,n=new Array(t),o=0;o>>24]^c[p>>>16&255]^f[m>>>8&255]^h[255&y]^t[v++],a=l[p>>>24]^c[m>>>16&255]^f[y>>>8&255]^h[255&d]^t[v++],s=l[m>>>24]^c[y>>>16&255]^f[d>>>8&255]^h[255&p]^t[v++],u=l[y>>>24]^c[d>>>16&255]^f[p>>>8&255]^h[255&m]^t[v++],d=i,p=a,m=s,y=u;return i=(r[d>>>24]<<24|r[p>>>16&255]<<16|r[m>>>8&255]<<8|r[255&y])^t[v++],a=(r[p>>>24]<<24|r[m>>>16&255]<<16|r[y>>>8&255]<<8|r[255&d])^t[v++],s=(r[m>>>24]<<24|r[y>>>16&255]<<16|r[d>>>8&255]<<8|r[255&p])^t[v++],u=(r[y>>>24]<<24|r[d>>>16&255]<<16|r[p>>>8&255]<<8|r[255&m])^t[v++],[i>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],r=[],o=[[],[],[],[]],i=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var l=s^s<<1^s<<2^s<<3^s<<4;l=l>>>8^255&l^99,n[a]=l,r[l]=a;var c=e[a],f=e[c],h=e[f],d=257*e[l]^16843008*l;o[0][a]=d<<24|d>>>8,o[1][a]=d<<16|d>>>16,o[2][a]=d<<8|d>>>24,o[3][a]=d,d=16843009*h^65537*f^257*c^16843008*a,i[0][l]=d<<24|d>>>8,i[1][l]=d<<16|d>>>16,i[2][l]=d<<8|d>>>24,i[3][l]=d,0===a?a=s=1:(a=c^e[e[e[h^c]]],s^=e[e[s]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:o,INV_SUB_MIX:i}}();function l(e){this._key=o(e),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,r=4*(n+1),o=[],i=0;i>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[i/t|0]<<24):t>6&&i%t==4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),o[i]=o[i-t]^a}for(var l=[],c=0;c>>24]]^u.INV_SUB_MIX[1][u.SBOX[h>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[h>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&h]]}this._nRounds=n,this._keySchedule=o,this._invKeySchedule=l},l.prototype.encryptBlockRaw=function(e){return a(e=o(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},l.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=r.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},l.prototype.decryptBlock=function(e){var t=(e=o(e))[1];e[1]=e[3],e[3]=t;var n=a(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),i=r.allocUnsafe(16);return i.writeUInt32BE(n[0],0),i.writeUInt32BE(n[3],4),i.writeUInt32BE(n[2],8),i.writeUInt32BE(n[1],12),i},l.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},e.exports.AES=l},2356:(e,t,n)=>{var r=n(462),o=n(2861).Buffer,i=n(6168),a=n(6698),s=n(5892),u=n(295),l=n(5122);function c(e,t,n,a){i.call(this);var u=o.alloc(4,0);this._cipher=new r.AES(t);var c=this._cipher.encryptBlock(u);this._ghash=new s(c),n=function(e,t,n){if(12===t.length)return e._finID=o.concat([t,o.from([0,0,0,1])]),o.concat([t,o.from([0,0,0,2])]);var r=new s(n),i=t.length,a=i%16;r.update(t),a&&(a=16-a,r.update(o.alloc(a,0))),r.update(o.alloc(8,0));var u=8*i,c=o.alloc(8);c.writeUIntBE(u,0,8),r.update(c),e._finID=r.state;var f=o.from(e._finID);return l(f),f}(this,n,c),this._prev=o.from(n),this._cache=o.allocUnsafe(0),this._secCache=o.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}a(c,i),c.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=o.alloc(t,0),this._ghash.update(t))}this._called=!0;var n=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(n),this._len+=e.length,n},c.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var n=0;e.length!==t.length&&n++;for(var r=Math.min(e.length,t.length),o=0;o{var r=n(5799),o=n(8552),i=n(3219);t.createCipher=t.Cipher=r.createCipher,t.createCipheriv=t.Cipheriv=r.createCipheriv,t.createDecipher=t.Decipher=o.createDecipher,t.createDecipheriv=t.Decipheriv=o.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(i)}},8552:(e,t,n)=>{var r=n(2356),o=n(2861).Buffer,i=n(530),a=n(650),s=n(6168),u=n(462),l=n(8078);function c(e,t,n){s.call(this),this._cache=new f,this._last=void 0,this._cipher=new u.AES(t),this._prev=o.from(n),this._mode=e,this._autopadding=!0}function f(){this.cache=o.allocUnsafe(0)}function h(e,t,n){var s=i[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof n&&(n=o.from(n)),"GCM"!==s.mode&&n.length!==s.iv)throw new TypeError("invalid iv length "+n.length);if("string"==typeof t&&(t=o.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,n,!0):"auth"===s.type?new r(s.module,t,n,!0):new c(s.module,t,n)}n(6698)(c,s),c.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get(this._autopadding);)n=this._mode.decrypt(this,t),r.push(n);return o.concat(r)},c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var n=-1;++n16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var n=i[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var r=l(t,!1,n.key,n.iv);return h(e,r.key,r.iv)},t.createDecipheriv=h},5799:(e,t,n)=>{var r=n(530),o=n(2356),i=n(2861).Buffer,a=n(650),s=n(6168),u=n(462),l=n(8078);function c(e,t,n){s.call(this),this._cache=new h,this._cipher=new u.AES(t),this._prev=i.from(n),this._mode=e,this._autopadding=!0}n(6698)(c,s),c.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get();)n=this._mode.encrypt(this,t),r.push(n);return i.concat(r)};var f=i.alloc(16,16);function h(){this.cache=i.allocUnsafe(0)}function d(e,t,n){var s=r[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof n&&(n=i.from(n)),"GCM"!==s.mode&&n.length!==s.iv)throw new TypeError("invalid iv length "+n.length);return"stream"===s.type?new a(s.module,t,n):"auth"===s.type?new o(s.module,t,n):new c(s.module,t,n)}c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=i.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){for(var e=16-this.cache.length,t=i.allocUnsafe(e),n=-1;++n{var r=n(2861).Buffer,o=r.alloc(16,0);function i(e){var t=r.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t0;t--)r[t]=r[t]>>>1|(1&r[t-1])<<31;r[0]=r[0]>>>1,n&&(r[0]=r[0]^225<<24)}this.state=i(o)},a.prototype.update=function(e){var t;for(this.cache=r.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(r.concat([this.cache,o],16)),this.ghash(i([0,e,0,t])),this.state},e.exports=a},5122:e=>{e.exports=function(e){for(var t,n=e.length;n--;){if(255!==(t=e.readUInt8(n))){t++,e.writeUInt8(t,n);break}e.writeUInt8(0,n)}}},2884:(e,t,n)=>{var r=n(295);t.encrypt=function(e,t){var n=r(t,e._prev);return e._prev=e._cipher.encryptBlock(n),e._prev},t.decrypt=function(e,t){var n=e._prev;e._prev=t;var o=e._cipher.decryptBlock(t);return r(o,n)}},6383:(e,t,n)=>{var r=n(2861).Buffer,o=n(295);function i(e,t,n){var i=t.length,a=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=r.concat([e._prev,n?t:a]),a}t.encrypt=function(e,t,n){for(var o,a=r.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=r.allocUnsafe(0)),!(e._cache.length<=t.length)){a=r.concat([a,i(e,t,n)]);break}o=e._cache.length,a=r.concat([a,i(e,t.slice(0,o),n)]),t=t.slice(o)}return a}},5264:(e,t,n)=>{var r=n(2861).Buffer;function o(e,t,n){for(var r,o,a=-1,s=0;++a<8;)r=t&1<<7-a?128:0,s+=(128&(o=e._cipher.encryptBlock(e._prev)[0]^r))>>a%8,e._prev=i(e._prev,n?r:o);return s}function i(e,t){var n=e.length,o=-1,i=r.allocUnsafe(e.length);for(e=r.concat([e,r.from([t])]);++o>7;return i}t.encrypt=function(e,t,n){for(var i=t.length,a=r.allocUnsafe(i),s=-1;++s{var r=n(2861).Buffer;function o(e,t,n){var o=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=r.concat([e._prev.slice(1),r.from([n?t:o])]),o}t.encrypt=function(e,t,n){for(var i=t.length,a=r.allocUnsafe(i),s=-1;++s{var r=n(295),o=n(2861).Buffer,i=n(5122);function a(e){var t=e._cipher.encryptBlockRaw(e._prev);return i(e._prev),t}t.encrypt=function(e,t){var n=Math.ceil(t.length/16),i=e._cache.length;e._cache=o.concat([e._cache,o.allocUnsafe(16*n)]);for(var s=0;s{t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},530:(e,t,n)=>{var r={ECB:n(2632),CBC:n(2884),CFB:n(6383),CFB8:n(6975),CFB1:n(5264),OFB:n(6843),CTR:n(3053),GCM:n(3053)},o=n(3219);for(var i in o)o[i].module=r[o[i].mode];e.exports=o},6843:(e,t,n)=>{var r=n(8287).Buffer,o=n(295);function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(e,t){for(;e._cache.length{var r=n(462),o=n(2861).Buffer,i=n(6168);function a(e,t,n,a){i.call(this),this._cipher=new r.AES(t),this._prev=o.from(n),this._cache=o.allocUnsafe(0),this._secCache=o.allocUnsafe(0),this._decrypt=a,this._mode=e}n(6698)(a,i),a.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},a.prototype._final=function(){this._cipher.scrub()},e.exports=a},125:(e,t,n)=>{var r=n(4050),o=n(1241),i=n(530),a=n(2438),s=n(8078);function u(e,t,n){if(e=e.toLowerCase(),i[e])return o.createCipheriv(e,t,n);if(a[e])return new r({key:t,iv:n,mode:e});throw new TypeError("invalid suite type")}function l(e,t,n){if(e=e.toLowerCase(),i[e])return o.createDecipheriv(e,t,n);if(a[e])return new r({key:t,iv:n,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var n,r;if(e=e.toLowerCase(),i[e])n=i[e].key,r=i[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");n=8*a[e].key,r=a[e].iv}var o=s(t,!1,n,r);return u(e,o.key,o.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var n,r;if(e=e.toLowerCase(),i[e])n=i[e].key,r=i[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");n=8*a[e].key,r=a[e].iv}var o=s(t,!1,n,r);return l(e,o.key,o.iv)},t.createDecipheriv=t.Decipheriv=l,t.listCiphers=t.getCiphers=function(){return Object.keys(a).concat(o.getCiphers())}},4050:(e,t,n)=>{var r=n(6168),o=n(9560),i=n(6698),a=n(2861).Buffer,s={"des-ede3-cbc":o.CBC.instantiate(o.EDE),"des-ede3":o.EDE,"des-ede-cbc":o.CBC.instantiate(o.EDE),"des-ede":o.EDE,"des-cbc":o.CBC.instantiate(o.DES),"des-ecb":o.DES};function u(e){r.call(this);var t,n=e.mode.toLowerCase(),o=s[n];t=e.decrypt?"decrypt":"encrypt";var i=e.key;a.isBuffer(i)||(i=a.from(i)),"des-ede"!==n&&"des-ede-cbc"!==n||(i=a.concat([i,i.slice(0,8)]));var u=e.iv;a.isBuffer(u)||(u=a.from(u)),this._des=o.create({key:i,iv:u,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=u,i(u,r),u.prototype._update=function(e){return a.from(this._des.update(e))},u.prototype._final=function(){return a.from(this._des.final())}},2438:(e,t)=>{t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},7332:(e,t,n)=>{"use strict";var r=n(9404),o=n(3209),i=n(2861).Buffer;function a(e){var t,n=e.modulus.byteLength();do{t=new r(o(n))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function s(e,t){var n=function(e){var t=a(e);return{blinder:t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),o=t.modulus.byteLength(),s=new r(e).mul(n.blinder).umod(t.modulus),u=s.toRed(r.mont(t.prime1)),l=s.toRed(r.mont(t.prime2)),c=t.coefficient,f=t.prime1,h=t.prime2,d=u.redPow(t.exponent1).fromRed(),p=l.redPow(t.exponent2).fromRed(),m=d.isub(p).imul(c).umod(f).imul(h);return p.iadd(m).imul(n.unblinder).umod(t.modulus).toArrayLike(i,"be",o)}s.getr=a,e.exports=s},5715:(e,t,n)=>{"use strict";e.exports=n(2951)},20:(e,t,n)=>{"use strict";var r=n(2861).Buffer,o=n(7108),i=n(8399),a=n(6698),s=n(5359),u=n(4847),l=n(2951);function c(e){i.Writable.call(this);var t=l[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=o(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){i.Writable.call(this);var t=l[e];if(!t)throw new Error("Unknown message digest");this._hash=o(t.hash),this._tag=t.id,this._signType=t.sign}function h(e){return new c(e)}function d(e){return new f(e)}Object.keys(l).forEach((function(e){l[e].id=r.from(l[e].id,"hex"),l[e.toLowerCase()]=l[e]})),a(c,i.Writable),c.prototype._write=function(e,t,n){this._hash.update(e),n()},c.prototype.update=function(e,t){return this._hash.update("string"==typeof e?r.from(e,t):e),this},c.prototype.sign=function(e,t){this.end();var n=this._hash.digest(),r=s(n,e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},a(f,i.Writable),f.prototype._write=function(e,t,n){this._hash.update(e),n()},f.prototype.update=function(e,t){return this._hash.update("string"==typeof e?r.from(e,t):e),this},f.prototype.verify=function(e,t,n){var o="string"==typeof t?r.from(t,n):t;this.end();var i=this._hash.digest();return u(o,i,e,this._signType,this._tag)},e.exports={Sign:h,Verify:d,createSign:h,createVerify:d}},5359:(e,t,n)=>{"use strict";var r=n(2861).Buffer,o=n(3507),i=n(7332),a=n(6729).ec,s=n(9404),u=n(8170),l=n(4589);function c(e,t,n,i){if((e=r.from(e.toArray())).length0&&n.ishrn(r),n}function h(e,t,n){var i,a;do{for(i=r.alloc(0);8*i.length{"use strict";var r=n(2861).Buffer,o=n(9404),i=n(6729).ec,a=n(8170),s=n(4589);function u(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=0)throw new Error("invalid sig")}e.exports=function(e,t,n,l,c){var f=a(n);if("ec"===f.type){if("ecdsa"!==l&&"ecdsa/rsa"!==l)throw new Error("wrong public key type");return function(e,t,n){var r=s[n.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+n.data.algorithm.curve.join("."));var o=new i(r),a=n.data.subjectPrivateKey.data;return o.verify(t,e,a)}(e,t,f)}if("dsa"===f.type){if("dsa"!==l)throw new Error("wrong public key type");return function(e,t,n){var r=n.data.p,i=n.data.q,s=n.data.g,l=n.data.pub_key,c=a.signature.decode(e,"der"),f=c.s,h=c.r;u(f,i),u(h,i);var d=o.mont(r),p=f.invm(i);return 0===s.toRed(d).redPow(new o(t).mul(p).mod(i)).fromRed().mul(l.toRed(d).redPow(h.mul(p).mod(i)).fromRed()).mod(r).mod(i).cmp(h)}(e,t,f)}if("rsa"!==l&&"ecdsa/rsa"!==l)throw new Error("wrong public key type");t=r.concat([c,t]);for(var h=f.modulus.byteLength(),d=[1],p=0;t.length+d.length+2{var r=n(8287).Buffer;e.exports=function(e,t){for(var n=Math.min(e.length,t.length),o=new r(n),i=0;i{"use strict";const r=n(7526),o=n(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|m(e,t);let r=s(n);const o=r.write(e,t);return o!==n&&(r=r.slice(0,o)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return d(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return d(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);const o=function(e){if(u.isBuffer(e)){const t=0|p(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?s(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return c(e),s(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),n=s(t);for(let r=0;r=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return K(e).length;default:if(o)return r?-1:W(e).length;t=(""+t).toLowerCase(),o=!0}}function y(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,n);case"utf8":case"utf-8":return M(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,o){let i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;is&&(n=s-u),i=n;i>=0;i--){let n=!0;for(let r=0;ro&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function M(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,r,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(u=(31&t)<<6|63&n,u>127&&(i=u));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(u=(15&t)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:n=e[o+1],r=e[o+2],s=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(u=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=a}return function(e){const t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,o){if(Q(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(i,a),l=this.slice(r,o),c=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let i=!1;for(;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return E(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function O(e,t,n){let r="";n=Math.min(e.length,n);for(let o=t;or)&&(n=r);let o="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function j(e,t,n,r,o){z(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function N(e,t,n,r,o){z(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function I(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(e,t,n,r,i){return t=+t,n>>>=0,i||I(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function F(e,t,n,r,i){return t=+t,n>>>=0,i||I(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){q(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(o)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],o=1,i=0;for(;++i=o&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){q(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||L(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);let o=1,i=0;for(this[t]=255&e;++i>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=J((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!r){const r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}let o=n-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=J((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,n){return R(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return R(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function z(e,t,n,r,o,i){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new U.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||G(t,e.length-(n+1))}(r,o,i)}function q(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,n){if(Math.floor(e)!==e)throw q(e,n),new U.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=H(String(n)):"bigint"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=H(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function W(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let a=0;a55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function K(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,n,r){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function J(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},6168:(e,t,n)=>{"use strict";var r=n(2861).Buffer,o=n(8310).Transform,i=n(3141).I;function a(e){o.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}n(6698)(a,o);var s="undefined"!=typeof Uint8Array,u="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&ArrayBuffer.isView&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);a.prototype.update=function(e,t,n){var o=function(e,t){if(e instanceof r)return e;if("string"==typeof e)return r.from(e,t);if(u&&ArrayBuffer.isView(e)){if(0===e.byteLength)return r.alloc(0);var n=r.from(e.buffer,e.byteOffset,e.byteLength);if(n.byteLength===e.byteLength)return n}if(s&&e instanceof Uint8Array)return r.from(e);if(r.isBuffer(e)&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))return r.from(e);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}(e,t),i=this._update(o);return this.hashMode?this:(n&&(i=this._toString(i,n)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){r=e}finally{n(r)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||r.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can’t switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r},e.exports=a},1508:e=>{function t(e){var n,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(n=0;n{function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(8287).Buffer.isBuffer},1324:(e,t,n)=>{var r=n(8287).Buffer,o=n(6729),i=n(2801);e.exports=function(e){return new s(e)};var a={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(e){this.curveType=a[e],this.curveType||(this.curveType={name:e}),this.curve=new o.ec(this.curveType.name),this.keys=void 0}function u(e,t,n){Array.isArray(e)||(e=e.toArray());var o=new r(e);if(n&&o.length=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,n,r){for(var o=0,i=Math.min(e.length,n),a=t;a=49?s-49+10:s>=17?s-17+10:s}return o}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=u(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,u=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var l=1;l>>26,f=67108863&u,h=Math.min(l,t.length-1),d=Math.max(0,l-e.length+1);d<=h;d++){var p=l-d|0;c+=(a=(o=0|e.words[p])*(i=0|t.words[d])+f)/67108864|0,f=67108863&a}n.words[l]=0|f,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),n=0!==i||a!==this.length-1?c[6-u.length]+u+n:u+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],d=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?m+n:c[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,l=new e(i),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),l[s]=a;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 8191&t||(n+=13,t>>>=13),127&t||(n+=7,t>>>=7),15&t||(n+=4,t>>>=4),3&t||(n+=2,t>>>=2),1&t||n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,y=0|a[2],v=8191&y,g=y>>>13,b=0|a[3],w=8191&b,E=b>>>13,S=0|a[4],_=8191&S,x=S>>>13,k=0|a[5],M=8191&k,C=k>>>13,O=0|a[6],T=8191&O,A=O>>>13,P=0|a[7],L=8191&P,D=P>>>13,j=0|a[8],N=8191&j,I=j>>>13,R=0|a[9],F=8191&R,U=R>>>13,B=0|s[0],H=8191&B,z=B>>>13,q=0|s[1],G=8191&q,V=q>>>13,W=0|s[2],K=8191&W,$=W>>>13,Q=0|s[3],Y=8191&Q,Z=Q>>>13,J=0|s[4],X=8191&J,ee=J>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],fe=8191&ce,he=ce>>>13,de=0|s[9],pe=8191&de,me=de>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(l+(r=Math.imul(f,H))|0)+((8191&(o=(o=Math.imul(f,z))+Math.imul(h,H)|0))<<13)|0;l=((i=Math.imul(h,z))+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(p,H),o=(o=Math.imul(p,z))+Math.imul(m,H)|0,i=Math.imul(m,z);var ve=(l+(r=r+Math.imul(f,G)|0)|0)+((8191&(o=(o=o+Math.imul(f,V)|0)+Math.imul(h,G)|0))<<13)|0;l=((i=i+Math.imul(h,V)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,H),o=(o=Math.imul(v,z))+Math.imul(g,H)|0,i=Math.imul(g,z),r=r+Math.imul(p,G)|0,o=(o=o+Math.imul(p,V)|0)+Math.imul(m,G)|0,i=i+Math.imul(m,V)|0;var ge=(l+(r=r+Math.imul(f,K)|0)|0)+((8191&(o=(o=o+Math.imul(f,$)|0)+Math.imul(h,K)|0))<<13)|0;l=((i=i+Math.imul(h,$)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(w,H),o=(o=Math.imul(w,z))+Math.imul(E,H)|0,i=Math.imul(E,z),r=r+Math.imul(v,G)|0,o=(o=o+Math.imul(v,V)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,V)|0,r=r+Math.imul(p,K)|0,o=(o=o+Math.imul(p,$)|0)+Math.imul(m,K)|0,i=i+Math.imul(m,$)|0;var be=(l+(r=r+Math.imul(f,Y)|0)|0)+((8191&(o=(o=o+Math.imul(f,Z)|0)+Math.imul(h,Y)|0))<<13)|0;l=((i=i+Math.imul(h,Z)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(_,H),o=(o=Math.imul(_,z))+Math.imul(x,H)|0,i=Math.imul(x,z),r=r+Math.imul(w,G)|0,o=(o=o+Math.imul(w,V)|0)+Math.imul(E,G)|0,i=i+Math.imul(E,V)|0,r=r+Math.imul(v,K)|0,o=(o=o+Math.imul(v,$)|0)+Math.imul(g,K)|0,i=i+Math.imul(g,$)|0,r=r+Math.imul(p,Y)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(m,Y)|0,i=i+Math.imul(m,Z)|0;var we=(l+(r=r+Math.imul(f,X)|0)|0)+((8191&(o=(o=o+Math.imul(f,ee)|0)+Math.imul(h,X)|0))<<13)|0;l=((i=i+Math.imul(h,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(M,H),o=(o=Math.imul(M,z))+Math.imul(C,H)|0,i=Math.imul(C,z),r=r+Math.imul(_,G)|0,o=(o=o+Math.imul(_,V)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,V)|0,r=r+Math.imul(w,K)|0,o=(o=o+Math.imul(w,$)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,$)|0,r=r+Math.imul(v,Y)|0,o=(o=o+Math.imul(v,Z)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(p,X)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,ee)|0;var Ee=(l+(r=r+Math.imul(f,ne)|0)|0)+((8191&(o=(o=o+Math.imul(f,re)|0)+Math.imul(h,ne)|0))<<13)|0;l=((i=i+Math.imul(h,re)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(T,H),o=(o=Math.imul(T,z))+Math.imul(A,H)|0,i=Math.imul(A,z),r=r+Math.imul(M,G)|0,o=(o=o+Math.imul(M,V)|0)+Math.imul(C,G)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(_,K)|0,o=(o=o+Math.imul(_,$)|0)+Math.imul(x,K)|0,i=i+Math.imul(x,$)|0,r=r+Math.imul(w,Y)|0,o=(o=o+Math.imul(w,Z)|0)+Math.imul(E,Y)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(v,X)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(g,X)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(m,ne)|0,i=i+Math.imul(m,re)|0;var Se=(l+(r=r+Math.imul(f,ie)|0)|0)+((8191&(o=(o=o+Math.imul(f,ae)|0)+Math.imul(h,ie)|0))<<13)|0;l=((i=i+Math.imul(h,ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,H),o=(o=Math.imul(L,z))+Math.imul(D,H)|0,i=Math.imul(D,z),r=r+Math.imul(T,G)|0,o=(o=o+Math.imul(T,V)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,V)|0,r=r+Math.imul(M,K)|0,o=(o=o+Math.imul(M,$)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,$)|0,r=r+Math.imul(_,Y)|0,o=(o=o+Math.imul(_,Z)|0)+Math.imul(x,Y)|0,i=i+Math.imul(x,Z)|0,r=r+Math.imul(w,X)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(E,X)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(v,ne)|0,o=(o=o+Math.imul(v,re)|0)+Math.imul(g,ne)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0;var _e=(l+(r=r+Math.imul(f,ue)|0)|0)+((8191&(o=(o=o+Math.imul(f,le)|0)+Math.imul(h,ue)|0))<<13)|0;l=((i=i+Math.imul(h,le)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,H),o=(o=Math.imul(N,z))+Math.imul(I,H)|0,i=Math.imul(I,z),r=r+Math.imul(L,G)|0,o=(o=o+Math.imul(L,V)|0)+Math.imul(D,G)|0,i=i+Math.imul(D,V)|0,r=r+Math.imul(T,K)|0,o=(o=o+Math.imul(T,$)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,$)|0,r=r+Math.imul(M,Y)|0,o=(o=o+Math.imul(M,Z)|0)+Math.imul(C,Y)|0,i=i+Math.imul(C,Z)|0,r=r+Math.imul(_,X)|0,o=(o=o+Math.imul(_,ee)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,ee)|0,r=r+Math.imul(w,ne)|0,o=(o=o+Math.imul(w,re)|0)+Math.imul(E,ne)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(v,ie)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,ae)|0,r=r+Math.imul(p,ue)|0,o=(o=o+Math.imul(p,le)|0)+Math.imul(m,ue)|0,i=i+Math.imul(m,le)|0;var xe=(l+(r=r+Math.imul(f,fe)|0)|0)+((8191&(o=(o=o+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;l=((i=i+Math.imul(h,he)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(F,H),o=(o=Math.imul(F,z))+Math.imul(U,H)|0,i=Math.imul(U,z),r=r+Math.imul(N,G)|0,o=(o=o+Math.imul(N,V)|0)+Math.imul(I,G)|0,i=i+Math.imul(I,V)|0,r=r+Math.imul(L,K)|0,o=(o=o+Math.imul(L,$)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,$)|0,r=r+Math.imul(T,Y)|0,o=(o=o+Math.imul(T,Z)|0)+Math.imul(A,Y)|0,i=i+Math.imul(A,Z)|0,r=r+Math.imul(M,X)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,ee)|0,r=r+Math.imul(_,ne)|0,o=(o=o+Math.imul(_,re)|0)+Math.imul(x,ne)|0,i=i+Math.imul(x,re)|0,r=r+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,ae)|0,r=r+Math.imul(v,ue)|0,o=(o=o+Math.imul(v,le)|0)+Math.imul(g,ue)|0,i=i+Math.imul(g,le)|0,r=r+Math.imul(p,fe)|0,o=(o=o+Math.imul(p,he)|0)+Math.imul(m,fe)|0,i=i+Math.imul(m,he)|0;var ke=(l+(r=r+Math.imul(f,pe)|0)|0)+((8191&(o=(o=o+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;l=((i=i+Math.imul(h,me)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(F,G),o=(o=Math.imul(F,V))+Math.imul(U,G)|0,i=Math.imul(U,V),r=r+Math.imul(N,K)|0,o=(o=o+Math.imul(N,$)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,$)|0,r=r+Math.imul(L,Y)|0,o=(o=o+Math.imul(L,Z)|0)+Math.imul(D,Y)|0,i=i+Math.imul(D,Z)|0,r=r+Math.imul(T,X)|0,o=(o=o+Math.imul(T,ee)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,ee)|0,r=r+Math.imul(M,ne)|0,o=(o=o+Math.imul(M,re)|0)+Math.imul(C,ne)|0,i=i+Math.imul(C,re)|0,r=r+Math.imul(_,ie)|0,o=(o=o+Math.imul(_,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,r=r+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,le)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,le)|0,r=r+Math.imul(v,fe)|0,o=(o=o+Math.imul(v,he)|0)+Math.imul(g,fe)|0,i=i+Math.imul(g,he)|0;var Me=(l+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(F,K),o=(o=Math.imul(F,$))+Math.imul(U,K)|0,i=Math.imul(U,$),r=r+Math.imul(N,Y)|0,o=(o=o+Math.imul(N,Z)|0)+Math.imul(I,Y)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(L,X)|0,o=(o=o+Math.imul(L,ee)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(T,ne)|0,o=(o=o+Math.imul(T,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0,r=r+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,ae)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,ae)|0,r=r+Math.imul(_,ue)|0,o=(o=o+Math.imul(_,le)|0)+Math.imul(x,ue)|0,i=i+Math.imul(x,le)|0,r=r+Math.imul(w,fe)|0,o=(o=o+Math.imul(w,he)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,he)|0;var Ce=(l+(r=r+Math.imul(v,pe)|0)|0)+((8191&(o=(o=o+Math.imul(v,me)|0)+Math.imul(g,pe)|0))<<13)|0;l=((i=i+Math.imul(g,me)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(F,Y),o=(o=Math.imul(F,Z))+Math.imul(U,Y)|0,i=Math.imul(U,Z),r=r+Math.imul(N,X)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(L,ne)|0,o=(o=o+Math.imul(L,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(T,ie)|0,o=(o=o+Math.imul(T,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,r=r+Math.imul(M,ue)|0,o=(o=o+Math.imul(M,le)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,le)|0,r=r+Math.imul(_,fe)|0,o=(o=o+Math.imul(_,he)|0)+Math.imul(x,fe)|0,i=i+Math.imul(x,he)|0;var Oe=(l+(r=r+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(E,pe)|0))<<13)|0;l=((i=i+Math.imul(E,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(F,X),o=(o=Math.imul(F,ee))+Math.imul(U,X)|0,i=Math.imul(U,ee),r=r+Math.imul(N,ne)|0,o=(o=o+Math.imul(N,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(L,ie)|0,o=(o=o+Math.imul(L,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(T,ue)|0,o=(o=o+Math.imul(T,le)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,le)|0,r=r+Math.imul(M,fe)|0,o=(o=o+Math.imul(M,he)|0)+Math.imul(C,fe)|0,i=i+Math.imul(C,he)|0;var Te=(l+(r=r+Math.imul(_,pe)|0)|0)+((8191&(o=(o=o+Math.imul(_,me)|0)+Math.imul(x,pe)|0))<<13)|0;l=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(F,ne),o=(o=Math.imul(F,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(N,ie)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(L,ue)|0,o=(o=o+Math.imul(L,le)|0)+Math.imul(D,ue)|0,i=i+Math.imul(D,le)|0,r=r+Math.imul(T,fe)|0,o=(o=o+Math.imul(T,he)|0)+Math.imul(A,fe)|0,i=i+Math.imul(A,he)|0;var Ae=(l+(r=r+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,me)|0)+Math.imul(C,pe)|0))<<13)|0;l=((i=i+Math.imul(C,me)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(F,ie),o=(o=Math.imul(F,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(N,ue)|0,o=(o=o+Math.imul(N,le)|0)+Math.imul(I,ue)|0,i=i+Math.imul(I,le)|0,r=r+Math.imul(L,fe)|0,o=(o=o+Math.imul(L,he)|0)+Math.imul(D,fe)|0,i=i+Math.imul(D,he)|0;var Pe=(l+(r=r+Math.imul(T,pe)|0)|0)+((8191&(o=(o=o+Math.imul(T,me)|0)+Math.imul(A,pe)|0))<<13)|0;l=((i=i+Math.imul(A,me)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(F,ue),o=(o=Math.imul(F,le))+Math.imul(U,ue)|0,i=Math.imul(U,le),r=r+Math.imul(N,fe)|0,o=(o=o+Math.imul(N,he)|0)+Math.imul(I,fe)|0,i=i+Math.imul(I,he)|0;var Le=(l+(r=r+Math.imul(L,pe)|0)|0)+((8191&(o=(o=o+Math.imul(L,me)|0)+Math.imul(D,pe)|0))<<13)|0;l=((i=i+Math.imul(D,me)|0)+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(F,fe),o=(o=Math.imul(F,he))+Math.imul(U,fe)|0,i=Math.imul(U,he);var De=(l+(r=r+Math.imul(N,pe)|0)|0)+((8191&(o=(o=o+Math.imul(N,me)|0)+Math.imul(I,pe)|0))<<13)|0;l=((i=i+Math.imul(I,me)|0)+(o>>>13)|0)+(De>>>26)|0,De&=67108863;var je=(l+(r=Math.imul(F,pe))|0)+((8191&(o=(o=Math.imul(F,me))+Math.imul(U,pe)|0))<<13)|0;return l=((i=Math.imul(U,me))+(o>>>13)|0)+(je>>>26)|0,je&=67108863,u[0]=ye,u[1]=ve,u[2]=ge,u[3]=be,u[4]=we,u[5]=Ee,u[6]=Se,u[7]=_e,u[8]=xe,u[9]=ke,u[10]=Me,u[11]=Ce,u[12]=Oe,u[13]=Te,u[14]=Ae,u[15]=Pe,u[16]=Le,u[17]=De,u[18]=je,0!==l&&(u[19]=l,n.length++),n};function m(e,t,n){return(new y).mulp(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(p=d),i.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):m(this,e,t),n},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=o/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,l=0;l=0&&(0!==c||l>=o);l--){var f=0|this.words[l];this.words[l]=c<<26-i|f>>>i,c=f&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[o+n]=67108863&i}for(;o>26,this.words[o+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l=0;f--){var h=67108864*(0|r.words[o.length+f])+(0|r.words[o.length+f-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,f);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):this.negative&e.negative?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(t*n+(0|this.words[o]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*t;this.words[n]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var c=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;!(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(c),a.isub(f)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;!(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(u)):(n.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:n.iushln(l)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,c=1;!(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;!(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new _(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(b,g),b.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),o=0;o>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new w;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},_.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},_.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,o),h=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=a;0!==d.cmp(s);){for(var m=d,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var l=t.words[r],c=u-1;c>=0;c--){var f=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==f||0!==a?(a<<=1,a|=f,(4==++s||0===r&&0===c)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},o(x,_),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},7108:(e,t,n)=>{"use strict";var r=n(6698),o=n(8276),i=n(6011),a=n(2802),s=n(6168);function u(e){s.call(this,"digest"),this._hash=e}r(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new o:"rmd160"===e||"ripemd160"===e?new i:new u(a(e))}},320:(e,t,n)=>{var r=n(8276);e.exports=function(e){return(new r).update(e).digest()}},3507:(e,t,n)=>{"use strict";var r=n(6698),o=n(1800),i=n(6168),a=n(2861).Buffer,s=n(320),u=n(6011),l=n(2802),c=a.alloc(128);function f(e,t){i.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var n="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>n?t=("rmd160"===e?new u:l(e)).update(t).digest():t.length{"use strict";var r=n(6698),o=n(2861).Buffer,i=n(6168),a=o.alloc(128),s=64;function u(e,t){i.call(this,"digest"),"string"==typeof t&&(t=o.from(t)),this._alg=e,this._key=t,t.length>s?t=e(t):t.length{var r="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n.g&&n.g,o=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var n=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==n&&n,r="URLSearchParams"in n,o="Symbol"in n&&"iterator"in Symbol,i="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in n,s="ArrayBuffer"in n;if(s)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&u.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function m(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function y(e){var t=new FileReader,n=m(t);return t.readAsArrayBuffer(e),n}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(y)}),this.text=function(){var e,t,n,r=p(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=m(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;i.test(this.url)?this.url=this.url.replace(i,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function E(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},g.call(w.prototype),g.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];S.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function x(e,r){return new Promise((function(o,a){var u=new w(e,r);if(u.signal&&u.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function c(){l.abort()}l.onload=function(){var e,t,n={status:l.status,statusText:l.statusText,headers:(e=l.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in l?l.responseURL:n.headers.get("X-Request-URL");var r="response"in l?l.response:l.responseText;setTimeout((function(){o(new S(r,n))}),0)},l.onerror=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},l.ontimeout=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},l.onabort=function(){setTimeout((function(){a(new t.DOMException("Aborted","AbortError"))}),0)},l.open(u.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(u.url),!0),"include"===u.credentials?l.withCredentials=!0:"omit"===u.credentials&&(l.withCredentials=!1),"responseType"in l&&(i?l.responseType="blob":s&&u.headers.get("Content-Type")&&-1!==u.headers.get("Content-Type").indexOf("application/octet-stream")&&(l.responseType="arraybuffer")),!r||"object"!=typeof r.headers||r.headers instanceof d?u.headers.forEach((function(e,t){l.setRequestHeader(t,e)})):Object.getOwnPropertyNames(r.headers).forEach((function(e){l.setRequestHeader(e,f(r.headers[e]))})),u.signal&&(u.signal.addEventListener("abort",c),l.onreadystatechange=function(){4===l.readyState&&u.signal.removeEventListener("abort",c)}),l.send(void 0===u._bodyInit?null:u._bodyInit)}))}x.polyfill=!0,n.fetch||(n.fetch=x,n.Headers=d,n.Request=w,n.Response=S),t.Headers=d,t.Request=w,t.Response=S,t.fetch=x}({})}(o),o.fetch.ponyfill=!0,delete o.fetch.polyfill;var i=r.fetch?r:o;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},1565:(e,t,n)=>{"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=n(3209),t.createHash=t.Hash=n(7108),t.createHmac=t.Hmac=n(3507);var r=n(5715),o=Object.keys(r),i=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(o);t.getHashes=function(){return i};var a=n(8396);t.pbkdf2=a.pbkdf2,t.pbkdf2Sync=a.pbkdf2Sync;var s=n(125);t.Cipher=s.Cipher,t.createCipher=s.createCipher,t.Cipheriv=s.Cipheriv,t.createCipheriv=s.createCipheriv,t.Decipher=s.Decipher,t.createDecipher=s.createDecipher,t.Decipheriv=s.Decipheriv,t.createDecipheriv=s.createDecipheriv,t.getCiphers=s.getCiphers,t.listCiphers=s.listCiphers;var u=n(5380);t.DiffieHellmanGroup=u.DiffieHellmanGroup,t.createDiffieHellmanGroup=u.createDiffieHellmanGroup,t.getDiffieHellman=u.getDiffieHellman,t.createDiffieHellman=u.createDiffieHellman,t.DiffieHellman=u.DiffieHellman;var l=n(20);t.createSign=l.createSign,t.Sign=l.Sign,t.createVerify=l.createVerify,t.Verify=l.Verify,t.createECDH=n(1324);var c=n(7168);t.publicEncrypt=c.publicEncrypt,t.privateEncrypt=c.privateEncrypt,t.publicDecrypt=c.publicDecrypt,t.privateDecrypt=c.privateDecrypt;var f=n(6983);t.randomFill=f.randomFill,t.randomFillSync=f.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},9560:(e,t,n)=>{"use strict";t.utils=n(7626),t.Cipher=n(2808),t.DES=n(2211),t.CBC=n(3389),t.EDE=n(5279)},3389:(e,t,n)=>{"use strict";var r=n(3349),o=n(6698),i={};function a(e){r.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t{"use strict";var r=n(3349);function o(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}e.exports=o,o.prototype._init=function(){},o.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},o.prototype._buffer=function(e,t){for(var n=Math.min(this.buffer.length-this.bufferOff,e.length-t),r=0;r0;r--)t+=this._buffer(e,t),n+=this._flushBuffer(o,n);return t+=this._buffer(e,t),o},o.prototype.final=function(e){var t,n;return e&&(t=this.update(e)),n="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(n):n},o.prototype._pad=function(e,t){if(0===t)return!1;for(;t{"use strict";var r=n(3349),o=n(6698),i=n(7626),a=n(2808);function s(){this.tmp=new Array(2),this.keys=null}function u(e){a.call(this,e);var t=new s;this._desState=t,this.deriveKeys(t,e.key)}o(u,a),e.exports=u,u.create=function(e){return new u(e)};var l=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(e,t){e.keys=new Array(32),r.equal(t.length,this.blockSize,"Invalid key length");var n=i.readUInt32BE(t,0),o=i.readUInt32BE(t,4);i.pc1(n,o,e.tmp,0),n=e.tmp[0],o=e.tmp[1];for(var a=0;a>>1];n=i.r28shl(n,s),o=i.r28shl(o,s),i.pc2(n,o,e.keys,a)}},u.prototype._update=function(e,t,n,r){var o=this._desState,a=i.readUInt32BE(e,t),s=i.readUInt32BE(e,t+4);i.ip(a,s,o.tmp,0),a=o.tmp[0],s=o.tmp[1],"encrypt"===this.type?this._encrypt(o,a,s,o.tmp,0):this._decrypt(o,a,s,o.tmp,0),a=o.tmp[0],s=o.tmp[1],i.writeUInt32BE(n,a,r),i.writeUInt32BE(n,s,r+4)},u.prototype._pad=function(e,t){if(!1===this.padding)return!1;for(var n=e.length-t,r=t;r>>0,a=h}i.rip(s,a,r,o)},u.prototype._decrypt=function(e,t,n,r,o){for(var a=n,s=t,u=e.keys.length-2;u>=0;u-=2){var l=e.keys[u],c=e.keys[u+1];i.expand(a,e.tmp,0),l^=e.tmp[0],c^=e.tmp[1];var f=i.substitute(l,c),h=a;a=(s^i.permute(f))>>>0,s=h}i.rip(a,s,r,o)}},5279:(e,t,n)=>{"use strict";var r=n(3349),o=n(6698),i=n(2808),a=n(2211);function s(e,t){r.equal(t.length,24,"Invalid key length");var n=t.slice(0,8),o=t.slice(8,16),i=t.slice(16,24);this.ciphers="encrypt"===e?[a.create({type:"encrypt",key:n}),a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:i})]:[a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:o}),a.create({type:"decrypt",key:n})]}function u(e){i.call(this,e);var t=new s(this.type,this.options.key);this._edeState=t}o(u,i),e.exports=u,u.create=function(e){return new u(e)},u.prototype._update=function(e,t,n,r){var o=this._edeState;o.ciphers[0]._update(e,t,n,r),o.ciphers[1]._update(n,r,n,r),o.ciphers[2]._update(n,r,n,r)},u.prototype._pad=a.prototype._pad,u.prototype._unpad=a.prototype._unpad},7626:(e,t)=>{"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=255&t},t.ip=function(e,t,n,r){for(var o=0,i=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)o<<=1,o|=t>>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)i<<=1,i|=t>>>s+a&1;for(s=1;s<=25;s+=8)i<<=1,i|=e>>>s+a&1}n[r+0]=o>>>0,n[r+1]=i>>>0},t.rip=function(e,t,n,r){for(var o=0,i=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;n[r+0]=o>>>0,n[r+1]=i>>>0},t.pc1=function(e,t,n,r){for(var o=0,i=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;n[r+0]=o>>>0,n[r+1]=i>>>0},t.r28shl=function(e,t){return e<>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,o){for(var i=0,a=0,s=n.length>>>1,u=0;u>>n[u]&1;for(u=s;u>>n[u]&1;r[o+0]=i>>>0,r[o+1]=a>>>0},t.expand=function(e,t,n){var r=0,o=0;r=(1&e)<<5|e>>>27;for(var i=23;i>=15;i-=4)r<<=6,r|=e>>>i&63;for(i=11;i>=3;i-=4)o|=e>>>i&63,o<<=6;o|=(31&e)<<1|e>>>31,t[n+0]=r>>>0,t[n+1]=o>>>0};var r=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var n=0,o=0;o<4;o++)n<<=4,n|=r[64*o+(e>>>18-6*o&63)];for(o=0;o<4;o++)n<<=4,n|=r[256+64*o+(t>>>18-6*o&63)];return n>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,n=0;n>>o[n]&1;return t>>>0},t.padSplit=function(e,t,n){for(var r=e.toString(2);r.length{var r=n(8287).Buffer,o=n(4934),i=n(3241),a=n(4910),s={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(e){var t=new r(i[e].prime,"hex"),n=new r(i[e].gen,"hex");return new a(t,n)},t.createDiffieHellman=t.DiffieHellman=function e(t,n,i,u){return r.isBuffer(n)||void 0===s[n]?e(t,"binary",n,i):(n=n||"binary",u=u||"binary",i=i||new r([2]),r.isBuffer(i)||(i=new r(i,u)),"number"==typeof t?new a(o(t,i),i,!0):(r.isBuffer(t)||(t=new r(t,n)),new a(t,i,!0)))}},4910:(e,t,n)=>{var r=n(8287).Buffer,o=n(6473),i=new(n(2244)),a=new o(24),s=new o(11),u=new o(10),l=new o(3),c=new o(7),f=n(4934),h=n(3209);function d(e,t){return t=t||"utf8",r.isBuffer(e)||(e=new r(e,t)),this._pub=new o(e),this}function p(e,t){return t=t||"utf8",r.isBuffer(e)||(e=new r(e,t)),this._priv=new o(e),this}e.exports=y;var m={};function y(e,t,n){this.setGenerator(t),this.__prime=new o(e),this._prime=o.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,n?(this.setPublicKey=d,this.setPrivateKey=p):this._primeCode=8}function v(e,t){var n=new r(e.toArray());return t?n.toString(t):n}Object.defineProperty(y.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var n=t.toString("hex"),r=[n,e.toString(16)].join("_");if(r in m)return m[r];var o,h=0;if(e.isEven()||!f.simpleSieve||!f.fermatTest(e)||!i.test(e))return h+=1,h+="02"===n||"05"===n?8:4,m[r]=h,h;switch(i.test(e.shrn(1))||(h+=2),n){case"02":e.mod(a).cmp(s)&&(h+=8);break;case"05":(o=e.mod(u)).cmp(l)&&o.cmp(c)&&(h+=8);break;default:h+=4}return m[r]=h,h}(this.__prime,this.__gen)),this._primeCode}}),y.prototype.generateKeys=function(){return this._priv||(this._priv=new o(h(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},y.prototype.computeSecret=function(e){var t=(e=(e=new o(e)).toRed(this._prime)).redPow(this._priv).fromRed(),n=new r(t.toArray()),i=this.getPrime();if(n.length{var r=n(3209);e.exports=g,g.simpleSieve=y,g.fermatTest=v;var o=n(6473),i=new o(24),a=new(n(2244)),s=new o(1),u=new o(2),l=new o(5),c=(new o(16),new o(8),new o(10)),f=new o(3),h=(new o(7),new o(11)),d=new o(4),p=(new o(12),null);function m(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,n=3;n<1048576;n+=2){for(var r=Math.ceil(Math.sqrt(n)),o=0;oe;)n.ishrn(1);if(n.isEven()&&n.iadd(s),n.testn(1)||n.iadd(u),t.cmp(u)){if(!t.cmp(l))for(;n.mod(c).cmp(f);)n.iadd(d)}else for(;n.mod(i).cmp(h);)n.iadd(d);if(y(p=n.shrn(1))&&y(n)&&v(p)&&v(n)&&a.test(p)&&a.test(n))return n}}},6473:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(6089).Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,n,r){for(var o=0,i=Math.min(e.length,n),a=t;a=49?s-49+10:s>=17?s-17+10:s}return o}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=u(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,u=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var l=1;l>>26,f=67108863&u,h=Math.min(l,t.length-1),d=Math.max(0,l-e.length+1);d<=h;d++){var p=l-d|0;c+=(a=(o=0|e.words[p])*(i=0|t.words[d])+f)/67108864|0,f=67108863&a}n.words[l]=0|f,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),n=0!==i||a!==this.length-1?c[6-u.length]+u+n:u+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],d=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?m+n:c[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,l=new e(i),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),l[s]=a;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 8191&t||(n+=13,t>>>=13),127&t||(n+=7,t>>>=7),15&t||(n+=4,t>>>=4),3&t||(n+=2,t>>>=2),1&t||n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,y=0|a[2],v=8191&y,g=y>>>13,b=0|a[3],w=8191&b,E=b>>>13,S=0|a[4],_=8191&S,x=S>>>13,k=0|a[5],M=8191&k,C=k>>>13,O=0|a[6],T=8191&O,A=O>>>13,P=0|a[7],L=8191&P,D=P>>>13,j=0|a[8],N=8191&j,I=j>>>13,R=0|a[9],F=8191&R,U=R>>>13,B=0|s[0],H=8191&B,z=B>>>13,q=0|s[1],G=8191&q,V=q>>>13,W=0|s[2],K=8191&W,$=W>>>13,Q=0|s[3],Y=8191&Q,Z=Q>>>13,J=0|s[4],X=8191&J,ee=J>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],fe=8191&ce,he=ce>>>13,de=0|s[9],pe=8191&de,me=de>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(l+(r=Math.imul(f,H))|0)+((8191&(o=(o=Math.imul(f,z))+Math.imul(h,H)|0))<<13)|0;l=((i=Math.imul(h,z))+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(p,H),o=(o=Math.imul(p,z))+Math.imul(m,H)|0,i=Math.imul(m,z);var ve=(l+(r=r+Math.imul(f,G)|0)|0)+((8191&(o=(o=o+Math.imul(f,V)|0)+Math.imul(h,G)|0))<<13)|0;l=((i=i+Math.imul(h,V)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,H),o=(o=Math.imul(v,z))+Math.imul(g,H)|0,i=Math.imul(g,z),r=r+Math.imul(p,G)|0,o=(o=o+Math.imul(p,V)|0)+Math.imul(m,G)|0,i=i+Math.imul(m,V)|0;var ge=(l+(r=r+Math.imul(f,K)|0)|0)+((8191&(o=(o=o+Math.imul(f,$)|0)+Math.imul(h,K)|0))<<13)|0;l=((i=i+Math.imul(h,$)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(w,H),o=(o=Math.imul(w,z))+Math.imul(E,H)|0,i=Math.imul(E,z),r=r+Math.imul(v,G)|0,o=(o=o+Math.imul(v,V)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,V)|0,r=r+Math.imul(p,K)|0,o=(o=o+Math.imul(p,$)|0)+Math.imul(m,K)|0,i=i+Math.imul(m,$)|0;var be=(l+(r=r+Math.imul(f,Y)|0)|0)+((8191&(o=(o=o+Math.imul(f,Z)|0)+Math.imul(h,Y)|0))<<13)|0;l=((i=i+Math.imul(h,Z)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(_,H),o=(o=Math.imul(_,z))+Math.imul(x,H)|0,i=Math.imul(x,z),r=r+Math.imul(w,G)|0,o=(o=o+Math.imul(w,V)|0)+Math.imul(E,G)|0,i=i+Math.imul(E,V)|0,r=r+Math.imul(v,K)|0,o=(o=o+Math.imul(v,$)|0)+Math.imul(g,K)|0,i=i+Math.imul(g,$)|0,r=r+Math.imul(p,Y)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(m,Y)|0,i=i+Math.imul(m,Z)|0;var we=(l+(r=r+Math.imul(f,X)|0)|0)+((8191&(o=(o=o+Math.imul(f,ee)|0)+Math.imul(h,X)|0))<<13)|0;l=((i=i+Math.imul(h,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(M,H),o=(o=Math.imul(M,z))+Math.imul(C,H)|0,i=Math.imul(C,z),r=r+Math.imul(_,G)|0,o=(o=o+Math.imul(_,V)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,V)|0,r=r+Math.imul(w,K)|0,o=(o=o+Math.imul(w,$)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,$)|0,r=r+Math.imul(v,Y)|0,o=(o=o+Math.imul(v,Z)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(p,X)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,ee)|0;var Ee=(l+(r=r+Math.imul(f,ne)|0)|0)+((8191&(o=(o=o+Math.imul(f,re)|0)+Math.imul(h,ne)|0))<<13)|0;l=((i=i+Math.imul(h,re)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(T,H),o=(o=Math.imul(T,z))+Math.imul(A,H)|0,i=Math.imul(A,z),r=r+Math.imul(M,G)|0,o=(o=o+Math.imul(M,V)|0)+Math.imul(C,G)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(_,K)|0,o=(o=o+Math.imul(_,$)|0)+Math.imul(x,K)|0,i=i+Math.imul(x,$)|0,r=r+Math.imul(w,Y)|0,o=(o=o+Math.imul(w,Z)|0)+Math.imul(E,Y)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(v,X)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(g,X)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(m,ne)|0,i=i+Math.imul(m,re)|0;var Se=(l+(r=r+Math.imul(f,ie)|0)|0)+((8191&(o=(o=o+Math.imul(f,ae)|0)+Math.imul(h,ie)|0))<<13)|0;l=((i=i+Math.imul(h,ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,H),o=(o=Math.imul(L,z))+Math.imul(D,H)|0,i=Math.imul(D,z),r=r+Math.imul(T,G)|0,o=(o=o+Math.imul(T,V)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,V)|0,r=r+Math.imul(M,K)|0,o=(o=o+Math.imul(M,$)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,$)|0,r=r+Math.imul(_,Y)|0,o=(o=o+Math.imul(_,Z)|0)+Math.imul(x,Y)|0,i=i+Math.imul(x,Z)|0,r=r+Math.imul(w,X)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(E,X)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(v,ne)|0,o=(o=o+Math.imul(v,re)|0)+Math.imul(g,ne)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0;var _e=(l+(r=r+Math.imul(f,ue)|0)|0)+((8191&(o=(o=o+Math.imul(f,le)|0)+Math.imul(h,ue)|0))<<13)|0;l=((i=i+Math.imul(h,le)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,H),o=(o=Math.imul(N,z))+Math.imul(I,H)|0,i=Math.imul(I,z),r=r+Math.imul(L,G)|0,o=(o=o+Math.imul(L,V)|0)+Math.imul(D,G)|0,i=i+Math.imul(D,V)|0,r=r+Math.imul(T,K)|0,o=(o=o+Math.imul(T,$)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,$)|0,r=r+Math.imul(M,Y)|0,o=(o=o+Math.imul(M,Z)|0)+Math.imul(C,Y)|0,i=i+Math.imul(C,Z)|0,r=r+Math.imul(_,X)|0,o=(o=o+Math.imul(_,ee)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,ee)|0,r=r+Math.imul(w,ne)|0,o=(o=o+Math.imul(w,re)|0)+Math.imul(E,ne)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(v,ie)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,ae)|0,r=r+Math.imul(p,ue)|0,o=(o=o+Math.imul(p,le)|0)+Math.imul(m,ue)|0,i=i+Math.imul(m,le)|0;var xe=(l+(r=r+Math.imul(f,fe)|0)|0)+((8191&(o=(o=o+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;l=((i=i+Math.imul(h,he)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(F,H),o=(o=Math.imul(F,z))+Math.imul(U,H)|0,i=Math.imul(U,z),r=r+Math.imul(N,G)|0,o=(o=o+Math.imul(N,V)|0)+Math.imul(I,G)|0,i=i+Math.imul(I,V)|0,r=r+Math.imul(L,K)|0,o=(o=o+Math.imul(L,$)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,$)|0,r=r+Math.imul(T,Y)|0,o=(o=o+Math.imul(T,Z)|0)+Math.imul(A,Y)|0,i=i+Math.imul(A,Z)|0,r=r+Math.imul(M,X)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,ee)|0,r=r+Math.imul(_,ne)|0,o=(o=o+Math.imul(_,re)|0)+Math.imul(x,ne)|0,i=i+Math.imul(x,re)|0,r=r+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,ae)|0,r=r+Math.imul(v,ue)|0,o=(o=o+Math.imul(v,le)|0)+Math.imul(g,ue)|0,i=i+Math.imul(g,le)|0,r=r+Math.imul(p,fe)|0,o=(o=o+Math.imul(p,he)|0)+Math.imul(m,fe)|0,i=i+Math.imul(m,he)|0;var ke=(l+(r=r+Math.imul(f,pe)|0)|0)+((8191&(o=(o=o+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;l=((i=i+Math.imul(h,me)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(F,G),o=(o=Math.imul(F,V))+Math.imul(U,G)|0,i=Math.imul(U,V),r=r+Math.imul(N,K)|0,o=(o=o+Math.imul(N,$)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,$)|0,r=r+Math.imul(L,Y)|0,o=(o=o+Math.imul(L,Z)|0)+Math.imul(D,Y)|0,i=i+Math.imul(D,Z)|0,r=r+Math.imul(T,X)|0,o=(o=o+Math.imul(T,ee)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,ee)|0,r=r+Math.imul(M,ne)|0,o=(o=o+Math.imul(M,re)|0)+Math.imul(C,ne)|0,i=i+Math.imul(C,re)|0,r=r+Math.imul(_,ie)|0,o=(o=o+Math.imul(_,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,r=r+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,le)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,le)|0,r=r+Math.imul(v,fe)|0,o=(o=o+Math.imul(v,he)|0)+Math.imul(g,fe)|0,i=i+Math.imul(g,he)|0;var Me=(l+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(F,K),o=(o=Math.imul(F,$))+Math.imul(U,K)|0,i=Math.imul(U,$),r=r+Math.imul(N,Y)|0,o=(o=o+Math.imul(N,Z)|0)+Math.imul(I,Y)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(L,X)|0,o=(o=o+Math.imul(L,ee)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(T,ne)|0,o=(o=o+Math.imul(T,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0,r=r+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,ae)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,ae)|0,r=r+Math.imul(_,ue)|0,o=(o=o+Math.imul(_,le)|0)+Math.imul(x,ue)|0,i=i+Math.imul(x,le)|0,r=r+Math.imul(w,fe)|0,o=(o=o+Math.imul(w,he)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,he)|0;var Ce=(l+(r=r+Math.imul(v,pe)|0)|0)+((8191&(o=(o=o+Math.imul(v,me)|0)+Math.imul(g,pe)|0))<<13)|0;l=((i=i+Math.imul(g,me)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(F,Y),o=(o=Math.imul(F,Z))+Math.imul(U,Y)|0,i=Math.imul(U,Z),r=r+Math.imul(N,X)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(L,ne)|0,o=(o=o+Math.imul(L,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(T,ie)|0,o=(o=o+Math.imul(T,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,r=r+Math.imul(M,ue)|0,o=(o=o+Math.imul(M,le)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,le)|0,r=r+Math.imul(_,fe)|0,o=(o=o+Math.imul(_,he)|0)+Math.imul(x,fe)|0,i=i+Math.imul(x,he)|0;var Oe=(l+(r=r+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(E,pe)|0))<<13)|0;l=((i=i+Math.imul(E,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(F,X),o=(o=Math.imul(F,ee))+Math.imul(U,X)|0,i=Math.imul(U,ee),r=r+Math.imul(N,ne)|0,o=(o=o+Math.imul(N,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(L,ie)|0,o=(o=o+Math.imul(L,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(T,ue)|0,o=(o=o+Math.imul(T,le)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,le)|0,r=r+Math.imul(M,fe)|0,o=(o=o+Math.imul(M,he)|0)+Math.imul(C,fe)|0,i=i+Math.imul(C,he)|0;var Te=(l+(r=r+Math.imul(_,pe)|0)|0)+((8191&(o=(o=o+Math.imul(_,me)|0)+Math.imul(x,pe)|0))<<13)|0;l=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(F,ne),o=(o=Math.imul(F,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(N,ie)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(L,ue)|0,o=(o=o+Math.imul(L,le)|0)+Math.imul(D,ue)|0,i=i+Math.imul(D,le)|0,r=r+Math.imul(T,fe)|0,o=(o=o+Math.imul(T,he)|0)+Math.imul(A,fe)|0,i=i+Math.imul(A,he)|0;var Ae=(l+(r=r+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,me)|0)+Math.imul(C,pe)|0))<<13)|0;l=((i=i+Math.imul(C,me)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(F,ie),o=(o=Math.imul(F,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(N,ue)|0,o=(o=o+Math.imul(N,le)|0)+Math.imul(I,ue)|0,i=i+Math.imul(I,le)|0,r=r+Math.imul(L,fe)|0,o=(o=o+Math.imul(L,he)|0)+Math.imul(D,fe)|0,i=i+Math.imul(D,he)|0;var Pe=(l+(r=r+Math.imul(T,pe)|0)|0)+((8191&(o=(o=o+Math.imul(T,me)|0)+Math.imul(A,pe)|0))<<13)|0;l=((i=i+Math.imul(A,me)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(F,ue),o=(o=Math.imul(F,le))+Math.imul(U,ue)|0,i=Math.imul(U,le),r=r+Math.imul(N,fe)|0,o=(o=o+Math.imul(N,he)|0)+Math.imul(I,fe)|0,i=i+Math.imul(I,he)|0;var Le=(l+(r=r+Math.imul(L,pe)|0)|0)+((8191&(o=(o=o+Math.imul(L,me)|0)+Math.imul(D,pe)|0))<<13)|0;l=((i=i+Math.imul(D,me)|0)+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(F,fe),o=(o=Math.imul(F,he))+Math.imul(U,fe)|0,i=Math.imul(U,he);var De=(l+(r=r+Math.imul(N,pe)|0)|0)+((8191&(o=(o=o+Math.imul(N,me)|0)+Math.imul(I,pe)|0))<<13)|0;l=((i=i+Math.imul(I,me)|0)+(o>>>13)|0)+(De>>>26)|0,De&=67108863;var je=(l+(r=Math.imul(F,pe))|0)+((8191&(o=(o=Math.imul(F,me))+Math.imul(U,pe)|0))<<13)|0;return l=((i=Math.imul(U,me))+(o>>>13)|0)+(je>>>26)|0,je&=67108863,u[0]=ye,u[1]=ve,u[2]=ge,u[3]=be,u[4]=we,u[5]=Ee,u[6]=Se,u[7]=_e,u[8]=xe,u[9]=ke,u[10]=Me,u[11]=Ce,u[12]=Oe,u[13]=Te,u[14]=Ae,u[15]=Pe,u[16]=Le,u[17]=De,u[18]=je,0!==l&&(u[19]=l,n.length++),n};function m(e,t,n){return(new y).mulp(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(p=d),i.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):m(this,e,t),n},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=o/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,l=0;l=0&&(0!==c||l>=o);l--){var f=0|this.words[l];this.words[l]=c<<26-i|f>>>i,c=f&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[o+n]=67108863&i}for(;o>26,this.words[o+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l=0;f--){var h=67108864*(0|r.words[o.length+f])+(0|r.words[o.length+f-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,f);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):this.negative&e.negative?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(t*n+(0|this.words[o]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*t;this.words[n]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var c=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;!(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(c),a.isub(f)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;!(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(u)):(n.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:n.iushln(l)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,c=1;!(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;!(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new _(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(b,g),b.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),o=0;o>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new w;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},_.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},_.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,o),h=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=a;0!==d.cmp(s);){for(var m=d,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var l=t.words[r],c=u-1;c>=0;c--){var f=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==f||0!==a?(a<<=1,a|=f,(4==++s||0===r&&0===c)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},o(x,_),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},6729:(e,t,n)=>{"use strict";var r=t;r.version=n(1636).rE,r.utils=n(7011),r.rand=n(5037),r.curve=n(894),r.curves=n(480),r.ec=n(7447),r.eddsa=n(8650)},6677:(e,t,n)=>{"use strict";var r=n(8490),o=n(7011),i=o.getNAF,a=o.getJSF,s=o.assert;function u(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function l(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var n=e._getDoubles(),r=i(t,1,this._bitLength),o=(1<=a;c--)u=(u<<1)+r[c];l.push(u)}for(var f=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=o;d>0;d--){for(a=0;a=0;l--){for(var c=0;l>=0&&0===a[l];l--)c++;if(l>=0&&c++,u=u.dblp(c),l<0)break;var f=a[l];s(0!==f),u="affine"===e.type?f>0?u.mixedAdd(o[f-1>>1]):u.mixedAdd(o[-f-1>>1].neg()):f>0?u.add(o[f-1>>1]):u.add(o[-f-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,n,r,o){var s,u,l,c=this._wnafT1,f=this._wnafT2,h=this._wnafT3,d=0;for(s=0;s=1;s-=2){var m=s-1,y=s;if(1===c[m]&&1===c[y]){var v=[t[m],null,null,t[y]];0===t[m].y.cmp(t[y].y)?(v[1]=t[m].add(t[y]),v[2]=t[m].toJ().mixedAdd(t[y].neg())):0===t[m].y.cmp(t[y].y.redNeg())?(v[1]=t[m].toJ().mixedAdd(t[y]),v[2]=t[m].add(t[y].neg())):(v[1]=t[m].toJ().mixedAdd(t[y]),v[2]=t[m].toJ().mixedAdd(t[y].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],b=a(n[m],n[y]);for(d=Math.max(b[0].length,d),h[m]=new Array(d),h[y]=new Array(d),u=0;u=0;s--){for(var x=0;s>=0;){var k=!0;for(u=0;u=0&&x++,S=S.dblp(x),s<0)break;for(u=0;u0?l=f[u][M-1>>1]:M<0&&(l=f[u][-M-1>>1].neg()),S="affine"===l.type?S.mixedAdd(l):S.add(l))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},l.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,o=0;o{"use strict";var r=n(7011),o=n(8490),i=n(6698),a=n(6677),s=r.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new o(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function l(e,t,n,r,i){a.BasePoint.call(this,e,"projective"),null===t&&null===n&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(t,16),this.y=new o(n,16),this.z=r?new o(r,16):this.curve.one,this.t=i&&new o(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}i(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,n,r){return this.point(e,t,n,r)},u.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=this.c2.redSub(this.a.redMul(n)),i=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=r.redMul(i.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=n.redSub(this.c2),i=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=r.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),r=t.redMul(this.a).redAdd(n),o=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return 0===r.cmp(o)},i(l,a.BasePoint),u.prototype.pointFromJSON=function(e){return l.fromJSON(this,e)},u.prototype.point=function(e,t,n,r){return new l(this,e,t,n,r)},l.fromJSON=function(e,t){return new l(e,t[0],t[1],t[2])},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=r.redAdd(t),a=i.redSub(n),s=r.redSub(t),u=o.redMul(a),l=i.redMul(s),c=o.redMul(s),f=a.redMul(i);return this.curve.point(u,l,f,c)},l.prototype._projDbl=function(){var e,t,n,r,o,i,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var l=(r=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(l.redSub(this.curve.two)),t=l.redMul(r.redSub(u)),n=l.redSqr().redSub(l).redSub(l)):(o=this.z.redSqr(),i=l.redSub(o).redISub(o),e=a.redSub(s).redISub(u).redMul(i),t=l.redMul(r.redSub(u)),n=l.redMul(i))}else r=s.redAdd(u),o=this.curve._mulC(this.z).redSqr(),i=r.redSub(o).redSub(o),e=this.curve._mulC(a.redISub(r)).redMul(i),t=this.curve._mulC(r).redMul(s.redISub(u)),n=r.redMul(i);return this.curve.point(e,t,n)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),i=n.redSub(t),a=o.redSub(r),s=o.redAdd(r),u=n.redAdd(t),l=i.redMul(a),c=s.redMul(u),f=i.redMul(u),h=a.redMul(s);return this.curve.point(l,c,h,f)},l.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),o=r.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(i).redMul(a),u=o.redSub(s),l=o.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),f=r.redMul(u).redMul(c);return this.curve.twisted?(t=r.redMul(l).redMul(a.redSub(this.curve._mulA(i))),n=u.redMul(l)):(t=r.redMul(l).redMul(a.redSub(i)),n=this.curve._mulC(u).redMul(l)),this.curve.point(f,t,n)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},l.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},894:(e,t,n)=>{"use strict";var r=t;r.base=n(6677),r.short=n(9188),r.mont=n(370),r.edwards=n(1298)},370:(e,t,n)=>{"use strict";var r=n(8490),o=n(6698),i=n(6677),a=n(7011);function s(e){i.call(this,"mont",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,n){i.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(t,16),this.z=new r(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(s,i),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},o(u,i.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),r=e.redMul(t),o=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,o)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),o=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(n),a=o.redMul(r),s=t.z.redMul(i.redAdd(a).redSqr()),u=t.x.redMul(i.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var i=o.length-1;i>=0;i--)0===o[i]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},9188:(e,t,n)=>{"use strict";var r=n(7011),o=n(8490),i=n(6698),a=n(6677),s=r.assert;function u(e){a.call(this,"short",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function l(e,t,n,r){a.BasePoint.call(this,e,"affine"),null===t&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(t,16),this.y=new o(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(e,t,n,r){a.BasePoint.call(this,e,"jacobian"),null===t&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(t,16),this.y=new o(n,16),this.z=new o(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,n;if(e.beta)t=new o(e.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);t=(t=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(e.lambda)n=new o(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?n=i[0]:(n=i[1],s(0===this.g.mul(n).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:n,basis:e.basis?e.basis.map((function(e){return{a:new o(e.a,16),b:new o(e.b,16)}})):this._getEndoBasis(n)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:o.mont(e),n=new o(2).toRed(t).redInvm(),r=n.redNeg(),i=new o(3).toRed(t).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,n,r,i,a,s,u,l,c,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,d=this.n.clone(),p=new o(1),m=new o(0),y=new o(0),v=new o(1),g=0;0!==h.cmpn(0);){var b=d.div(h);l=d.sub(b.mul(h)),c=y.sub(b.mul(p));var w=v.sub(b.mul(m));if(!r&&l.cmp(f)<0)t=u.neg(),n=p,r=l.neg(),i=c;else if(r&&2==++g)break;u=l,d=h,h=l,y=p,p=c,v=m,m=w}a=l.neg(),s=c;var E=r.sqr().add(i.sqr());return a.sqr().add(s.sqr()).cmp(E)>=0&&(a=t,s=n),r.negative&&(r=r.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:r,b:i},{a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],o=r.b.mul(e).divRound(this.n),i=n.b.neg().mul(e).divRound(this.n),a=o.mul(n.a),s=i.mul(r.a),u=o.mul(n.b),l=i.mul(r.b);return{k1:e.sub(a).sub(s),k2:u.add(l).neg()}},u.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(o).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,o=this._endoWnafT2,i=0;i":""},l.prototype.isInfinity=function(){return this.inf},l.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},l.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),o=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),i=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(e){return e=new o(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,n){var r=[this,t],o=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,o):this.curve._wnafMulAdd(1,r,o,2)},l.prototype.jmulAdd=function(e,t,n){var r=[this,t],o=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,o,!0):this.curve._wnafMulAdd(1,r,o,2,!0)},l.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},l.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},l.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},i(c,a.BasePoint),u.prototype.jpoint=function(e,t,n){return new c(this,e,t,n)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),o=e.x.redMul(n),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(o),u=i.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),c=l.redMul(s),f=r.redMul(l),h=u.redSqr().redIAdd(c).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(i.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=o.redSub(i);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),c=n.redMul(u),f=s.redSqr().redIAdd(l).redISub(c).redISub(c),h=s.redMul(c.redISub(f)).redISub(o.redMul(l)),d=this.z.redMul(a);return this.curve.jpoint(f,h,d)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t=0)return!1;if(n.redIAdd(o),0===this.x.cmp(n))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},480:(e,t,n)=>{"use strict";var r,o=t,i=n(7952),a=n(894),s=n(7011).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function l(e,t){Object.defineProperty(o,e,{configurable:!0,enumerable:!0,get:function(){var n=new u(t);return Object.defineProperty(o,e,{configurable:!0,enumerable:!0,value:n}),n}})}o.PresetCurve=u,l("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),l("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),l("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(4011)}catch(e){r=void 0}l("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},7447:(e,t,n)=>{"use strict";var r=n(8490),o=n(2723),i=n(7011),a=n(480),s=n(5037),u=i.assert,l=n(1200),c=n(8545);function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=f,f.prototype.keyPair=function(e){return new l(this,e)},f.prototype.keyFromPrivate=function(e,t){return l.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return l.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e||(e={});for(var t=new o({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new r(2));;){var a=new r(t.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}},f.prototype._truncateToN=function(e,t,n){var o;if(r.isBN(e)||"number"==typeof e)o=(e=new r(e,16)).byteLength();else if("object"==typeof e)o=e.length,e=new r(e,16);else{var i=e.toString();o=i.length+1>>>1,e=new r(i,16)}"number"!=typeof n&&(n=8*o);var a=n-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,n,i){"object"==typeof n&&(i=n,n=null),i||(i={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(e,!1,i.msgBitLength);for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),l=new o({hash:this.hash,entropy:s,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),f=this.n.sub(new r(1)),h=0;;h++){var d=i.k?i.k(h):new r(l.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(f)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var m=p.getX(),y=m.umod(this.n);if(0!==y.cmpn(0)){var v=d.invm(this.n).mul(y.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==m.cmp(y)?2:0);return i.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new c({r:y,s:v,recoveryParam:g})}}}}}},f.prototype.verify=function(e,t,n,r,o){o||(o={}),e=this._truncateToN(e,!1,o.msgBitLength),n=this.keyFromPublic(n,r);var i=(t=new c(t,"hex")).r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),l=u.mul(e).umod(this.n),f=u.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(l,n.getPublic(),f)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(l,n.getPublic(),f)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},f.prototype.recoverPubKey=function(e,t,n,o){u((3&n)===n,"The recovery param is more than two bits"),t=new c(t,o);var i=this.n,a=new r(e),s=t.r,l=t.s,f=1&n,h=n>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var d=t.r.invm(i),p=i.sub(a).mul(d).umod(i),m=l.mul(d).umod(i);return this.g.mulAdd(p,s,m)},f.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new c(t,r)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(n))return o}throw new Error("Unable to find valid recovery factor")}},1200:(e,t,n)=>{"use strict";var r=n(8490),o=n(7011).assert;function i(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=i,i.fromPublic=function(e,t,n){return t instanceof i?t:new i(e,{pub:t,pubEnc:n})},i.fromPrivate=function(e,t,n){return t instanceof i?t:new i(e,{priv:t,privEnc:n})},i.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},i.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(e,t){this.priv=new r(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?o(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||o(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},i.prototype.derive=function(e){return e.validate()||o(e.validate(),"public point not validated"),e.mul(this.priv).getX()},i.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},i.prototype.verify=function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},i.prototype.inspect=function(){return""}},8545:(e,t,n)=>{"use strict";var r=n(8490),o=n(7011),i=o.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;if(0===e[t.place])return!1;for(var o=0,i=0,a=t.place;i>>=0;return!(o<=127)&&(t.place=a,o)}function l(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=o.toArray(e,t);var n=new s;if(48!==e[n.place++])return!1;var i=u(e,n);if(!1===i)return!1;if(i+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var a=u(e,n);if(!1===a)return!1;if(128&e[n.place])return!1;var l=e.slice(n.place,a+n.place);if(n.place+=a,2!==e[n.place++])return!1;var c=u(e,n);if(!1===c)return!1;if(e.length!==c+n.place)return!1;if(128&e[n.place])return!1;var f=e.slice(n.place,c+n.place);if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new r(l),this.s=new r(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=l(t),n=l(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];c(r,t.length),(r=r.concat(t)).push(2),c(r,n.length);var i=r.concat(n),a=[48];return c(a,i.length),a=a.concat(i),o.encode(a,e)}},8650:(e,t,n)=>{"use strict";var r=n(7952),o=n(480),i=n(7011),a=i.assert,s=i.parseBytes,u=n(6661),l=n(220);function c(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=o[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}e.exports=c,c.prototype.sign=function(e,t){e=s(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),o=this.g.mul(r),i=this.encodePoint(o),a=this.hashInt(i,n.pubBytes(),e).mul(n.priv()),u=r.add(a).umod(this.curve.n);return this.makeSignature({R:o,S:u,Rencoded:i})},c.prototype.verify=function(e,t,n){if(e=s(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var r=this.keyFromPublic(n),o=this.hashInt(t.Rencoded(),r.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(r.pub().mul(o)).eq(i)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t{"use strict";var r=n(7011),o=r.assert,i=r.parseBytes,a=r.cachedProperty;function s(e,t){this.eddsa=e,this._secret=i(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=i(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,r=t.slice(0,e.encodingLength);return r[0]&=248,r[n]&=127,r[n]|=64,r})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(e){return o(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return o(this._secret,"KeyPair is public only"),r.encode(this.secret(),e)},s.prototype.getPublic=function(e){return r.encode(this.pubBytes(),e)},e.exports=s},220:(e,t,n)=>{"use strict";var r=n(8490),o=n(7011),i=o.assert,a=o.cachedProperty,s=o.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(i(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),i(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof r&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),a(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),a(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),a(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},4011:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},7011:(e,t,n)=>{"use strict";var r=t,o=n(8490),i=n(3349),a=n(4367);r.assert=i,r.toArray=a.toArray,r.zero2=a.zero2,r.toHex=a.toHex,r.encode=a.encode,r.getNAF=function(e,t,n){var r,o=new Array(Math.max(e.bitLength(),n)+1);for(r=0;r(i>>1)-1?(i>>1)-u:u,a.isubn(s)):s=0,o[r]=s,a.iushrn(1)}return o},r.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var a,s,u=e.andln(3)+o&3,l=t.andln(3)+i&3;3===u&&(u=-1),3===l&&(l=-1),a=1&u?3!=(r=e.andln(7)+o&7)&&5!==r||2!==l?u:-u:0,n[0].push(a),s=1&l?3!=(r=t.andln(7)+i&7)&&5!==r||2!==u?l:-l:0,n[1].push(s),2*o===a+1&&(o=1-o),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return n},r.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new o(e,"hex","le")}},8490:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(9368).Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,n,r){for(var o=0,i=Math.min(e.length,n),a=t;a=49?s-49+10:s>=17?s-17+10:s}return o}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=u(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,u=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var l=1;l>>26,f=67108863&u,h=Math.min(l,t.length-1),d=Math.max(0,l-e.length+1);d<=h;d++){var p=l-d|0;c+=(a=(o=0|e.words[p])*(i=0|t.words[d])+f)/67108864|0,f=67108863&a}n.words[l]=0|f,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),n=0!==i||a!==this.length-1?c[6-u.length]+u+n:u+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],d=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?m+n:c[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,l=new e(i),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),l[s]=a;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 8191&t||(n+=13,t>>>=13),127&t||(n+=7,t>>>=7),15&t||(n+=4,t>>>=4),3&t||(n+=2,t>>>=2),1&t||n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,y=0|a[2],v=8191&y,g=y>>>13,b=0|a[3],w=8191&b,E=b>>>13,S=0|a[4],_=8191&S,x=S>>>13,k=0|a[5],M=8191&k,C=k>>>13,O=0|a[6],T=8191&O,A=O>>>13,P=0|a[7],L=8191&P,D=P>>>13,j=0|a[8],N=8191&j,I=j>>>13,R=0|a[9],F=8191&R,U=R>>>13,B=0|s[0],H=8191&B,z=B>>>13,q=0|s[1],G=8191&q,V=q>>>13,W=0|s[2],K=8191&W,$=W>>>13,Q=0|s[3],Y=8191&Q,Z=Q>>>13,J=0|s[4],X=8191&J,ee=J>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],fe=8191&ce,he=ce>>>13,de=0|s[9],pe=8191&de,me=de>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(l+(r=Math.imul(f,H))|0)+((8191&(o=(o=Math.imul(f,z))+Math.imul(h,H)|0))<<13)|0;l=((i=Math.imul(h,z))+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(p,H),o=(o=Math.imul(p,z))+Math.imul(m,H)|0,i=Math.imul(m,z);var ve=(l+(r=r+Math.imul(f,G)|0)|0)+((8191&(o=(o=o+Math.imul(f,V)|0)+Math.imul(h,G)|0))<<13)|0;l=((i=i+Math.imul(h,V)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,H),o=(o=Math.imul(v,z))+Math.imul(g,H)|0,i=Math.imul(g,z),r=r+Math.imul(p,G)|0,o=(o=o+Math.imul(p,V)|0)+Math.imul(m,G)|0,i=i+Math.imul(m,V)|0;var ge=(l+(r=r+Math.imul(f,K)|0)|0)+((8191&(o=(o=o+Math.imul(f,$)|0)+Math.imul(h,K)|0))<<13)|0;l=((i=i+Math.imul(h,$)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(w,H),o=(o=Math.imul(w,z))+Math.imul(E,H)|0,i=Math.imul(E,z),r=r+Math.imul(v,G)|0,o=(o=o+Math.imul(v,V)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,V)|0,r=r+Math.imul(p,K)|0,o=(o=o+Math.imul(p,$)|0)+Math.imul(m,K)|0,i=i+Math.imul(m,$)|0;var be=(l+(r=r+Math.imul(f,Y)|0)|0)+((8191&(o=(o=o+Math.imul(f,Z)|0)+Math.imul(h,Y)|0))<<13)|0;l=((i=i+Math.imul(h,Z)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(_,H),o=(o=Math.imul(_,z))+Math.imul(x,H)|0,i=Math.imul(x,z),r=r+Math.imul(w,G)|0,o=(o=o+Math.imul(w,V)|0)+Math.imul(E,G)|0,i=i+Math.imul(E,V)|0,r=r+Math.imul(v,K)|0,o=(o=o+Math.imul(v,$)|0)+Math.imul(g,K)|0,i=i+Math.imul(g,$)|0,r=r+Math.imul(p,Y)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(m,Y)|0,i=i+Math.imul(m,Z)|0;var we=(l+(r=r+Math.imul(f,X)|0)|0)+((8191&(o=(o=o+Math.imul(f,ee)|0)+Math.imul(h,X)|0))<<13)|0;l=((i=i+Math.imul(h,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(M,H),o=(o=Math.imul(M,z))+Math.imul(C,H)|0,i=Math.imul(C,z),r=r+Math.imul(_,G)|0,o=(o=o+Math.imul(_,V)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,V)|0,r=r+Math.imul(w,K)|0,o=(o=o+Math.imul(w,$)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,$)|0,r=r+Math.imul(v,Y)|0,o=(o=o+Math.imul(v,Z)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(p,X)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,ee)|0;var Ee=(l+(r=r+Math.imul(f,ne)|0)|0)+((8191&(o=(o=o+Math.imul(f,re)|0)+Math.imul(h,ne)|0))<<13)|0;l=((i=i+Math.imul(h,re)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(T,H),o=(o=Math.imul(T,z))+Math.imul(A,H)|0,i=Math.imul(A,z),r=r+Math.imul(M,G)|0,o=(o=o+Math.imul(M,V)|0)+Math.imul(C,G)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(_,K)|0,o=(o=o+Math.imul(_,$)|0)+Math.imul(x,K)|0,i=i+Math.imul(x,$)|0,r=r+Math.imul(w,Y)|0,o=(o=o+Math.imul(w,Z)|0)+Math.imul(E,Y)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(v,X)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(g,X)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(m,ne)|0,i=i+Math.imul(m,re)|0;var Se=(l+(r=r+Math.imul(f,ie)|0)|0)+((8191&(o=(o=o+Math.imul(f,ae)|0)+Math.imul(h,ie)|0))<<13)|0;l=((i=i+Math.imul(h,ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,H),o=(o=Math.imul(L,z))+Math.imul(D,H)|0,i=Math.imul(D,z),r=r+Math.imul(T,G)|0,o=(o=o+Math.imul(T,V)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,V)|0,r=r+Math.imul(M,K)|0,o=(o=o+Math.imul(M,$)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,$)|0,r=r+Math.imul(_,Y)|0,o=(o=o+Math.imul(_,Z)|0)+Math.imul(x,Y)|0,i=i+Math.imul(x,Z)|0,r=r+Math.imul(w,X)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(E,X)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(v,ne)|0,o=(o=o+Math.imul(v,re)|0)+Math.imul(g,ne)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0;var _e=(l+(r=r+Math.imul(f,ue)|0)|0)+((8191&(o=(o=o+Math.imul(f,le)|0)+Math.imul(h,ue)|0))<<13)|0;l=((i=i+Math.imul(h,le)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,H),o=(o=Math.imul(N,z))+Math.imul(I,H)|0,i=Math.imul(I,z),r=r+Math.imul(L,G)|0,o=(o=o+Math.imul(L,V)|0)+Math.imul(D,G)|0,i=i+Math.imul(D,V)|0,r=r+Math.imul(T,K)|0,o=(o=o+Math.imul(T,$)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,$)|0,r=r+Math.imul(M,Y)|0,o=(o=o+Math.imul(M,Z)|0)+Math.imul(C,Y)|0,i=i+Math.imul(C,Z)|0,r=r+Math.imul(_,X)|0,o=(o=o+Math.imul(_,ee)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,ee)|0,r=r+Math.imul(w,ne)|0,o=(o=o+Math.imul(w,re)|0)+Math.imul(E,ne)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(v,ie)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,ae)|0,r=r+Math.imul(p,ue)|0,o=(o=o+Math.imul(p,le)|0)+Math.imul(m,ue)|0,i=i+Math.imul(m,le)|0;var xe=(l+(r=r+Math.imul(f,fe)|0)|0)+((8191&(o=(o=o+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;l=((i=i+Math.imul(h,he)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(F,H),o=(o=Math.imul(F,z))+Math.imul(U,H)|0,i=Math.imul(U,z),r=r+Math.imul(N,G)|0,o=(o=o+Math.imul(N,V)|0)+Math.imul(I,G)|0,i=i+Math.imul(I,V)|0,r=r+Math.imul(L,K)|0,o=(o=o+Math.imul(L,$)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,$)|0,r=r+Math.imul(T,Y)|0,o=(o=o+Math.imul(T,Z)|0)+Math.imul(A,Y)|0,i=i+Math.imul(A,Z)|0,r=r+Math.imul(M,X)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,ee)|0,r=r+Math.imul(_,ne)|0,o=(o=o+Math.imul(_,re)|0)+Math.imul(x,ne)|0,i=i+Math.imul(x,re)|0,r=r+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,ae)|0,r=r+Math.imul(v,ue)|0,o=(o=o+Math.imul(v,le)|0)+Math.imul(g,ue)|0,i=i+Math.imul(g,le)|0,r=r+Math.imul(p,fe)|0,o=(o=o+Math.imul(p,he)|0)+Math.imul(m,fe)|0,i=i+Math.imul(m,he)|0;var ke=(l+(r=r+Math.imul(f,pe)|0)|0)+((8191&(o=(o=o+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;l=((i=i+Math.imul(h,me)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(F,G),o=(o=Math.imul(F,V))+Math.imul(U,G)|0,i=Math.imul(U,V),r=r+Math.imul(N,K)|0,o=(o=o+Math.imul(N,$)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,$)|0,r=r+Math.imul(L,Y)|0,o=(o=o+Math.imul(L,Z)|0)+Math.imul(D,Y)|0,i=i+Math.imul(D,Z)|0,r=r+Math.imul(T,X)|0,o=(o=o+Math.imul(T,ee)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,ee)|0,r=r+Math.imul(M,ne)|0,o=(o=o+Math.imul(M,re)|0)+Math.imul(C,ne)|0,i=i+Math.imul(C,re)|0,r=r+Math.imul(_,ie)|0,o=(o=o+Math.imul(_,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,r=r+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,le)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,le)|0,r=r+Math.imul(v,fe)|0,o=(o=o+Math.imul(v,he)|0)+Math.imul(g,fe)|0,i=i+Math.imul(g,he)|0;var Me=(l+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(F,K),o=(o=Math.imul(F,$))+Math.imul(U,K)|0,i=Math.imul(U,$),r=r+Math.imul(N,Y)|0,o=(o=o+Math.imul(N,Z)|0)+Math.imul(I,Y)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(L,X)|0,o=(o=o+Math.imul(L,ee)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(T,ne)|0,o=(o=o+Math.imul(T,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0,r=r+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,ae)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,ae)|0,r=r+Math.imul(_,ue)|0,o=(o=o+Math.imul(_,le)|0)+Math.imul(x,ue)|0,i=i+Math.imul(x,le)|0,r=r+Math.imul(w,fe)|0,o=(o=o+Math.imul(w,he)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,he)|0;var Ce=(l+(r=r+Math.imul(v,pe)|0)|0)+((8191&(o=(o=o+Math.imul(v,me)|0)+Math.imul(g,pe)|0))<<13)|0;l=((i=i+Math.imul(g,me)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(F,Y),o=(o=Math.imul(F,Z))+Math.imul(U,Y)|0,i=Math.imul(U,Z),r=r+Math.imul(N,X)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(L,ne)|0,o=(o=o+Math.imul(L,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(T,ie)|0,o=(o=o+Math.imul(T,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,r=r+Math.imul(M,ue)|0,o=(o=o+Math.imul(M,le)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,le)|0,r=r+Math.imul(_,fe)|0,o=(o=o+Math.imul(_,he)|0)+Math.imul(x,fe)|0,i=i+Math.imul(x,he)|0;var Oe=(l+(r=r+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(E,pe)|0))<<13)|0;l=((i=i+Math.imul(E,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(F,X),o=(o=Math.imul(F,ee))+Math.imul(U,X)|0,i=Math.imul(U,ee),r=r+Math.imul(N,ne)|0,o=(o=o+Math.imul(N,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(L,ie)|0,o=(o=o+Math.imul(L,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(T,ue)|0,o=(o=o+Math.imul(T,le)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,le)|0,r=r+Math.imul(M,fe)|0,o=(o=o+Math.imul(M,he)|0)+Math.imul(C,fe)|0,i=i+Math.imul(C,he)|0;var Te=(l+(r=r+Math.imul(_,pe)|0)|0)+((8191&(o=(o=o+Math.imul(_,me)|0)+Math.imul(x,pe)|0))<<13)|0;l=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(F,ne),o=(o=Math.imul(F,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(N,ie)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(L,ue)|0,o=(o=o+Math.imul(L,le)|0)+Math.imul(D,ue)|0,i=i+Math.imul(D,le)|0,r=r+Math.imul(T,fe)|0,o=(o=o+Math.imul(T,he)|0)+Math.imul(A,fe)|0,i=i+Math.imul(A,he)|0;var Ae=(l+(r=r+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,me)|0)+Math.imul(C,pe)|0))<<13)|0;l=((i=i+Math.imul(C,me)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(F,ie),o=(o=Math.imul(F,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(N,ue)|0,o=(o=o+Math.imul(N,le)|0)+Math.imul(I,ue)|0,i=i+Math.imul(I,le)|0,r=r+Math.imul(L,fe)|0,o=(o=o+Math.imul(L,he)|0)+Math.imul(D,fe)|0,i=i+Math.imul(D,he)|0;var Pe=(l+(r=r+Math.imul(T,pe)|0)|0)+((8191&(o=(o=o+Math.imul(T,me)|0)+Math.imul(A,pe)|0))<<13)|0;l=((i=i+Math.imul(A,me)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(F,ue),o=(o=Math.imul(F,le))+Math.imul(U,ue)|0,i=Math.imul(U,le),r=r+Math.imul(N,fe)|0,o=(o=o+Math.imul(N,he)|0)+Math.imul(I,fe)|0,i=i+Math.imul(I,he)|0;var Le=(l+(r=r+Math.imul(L,pe)|0)|0)+((8191&(o=(o=o+Math.imul(L,me)|0)+Math.imul(D,pe)|0))<<13)|0;l=((i=i+Math.imul(D,me)|0)+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(F,fe),o=(o=Math.imul(F,he))+Math.imul(U,fe)|0,i=Math.imul(U,he);var De=(l+(r=r+Math.imul(N,pe)|0)|0)+((8191&(o=(o=o+Math.imul(N,me)|0)+Math.imul(I,pe)|0))<<13)|0;l=((i=i+Math.imul(I,me)|0)+(o>>>13)|0)+(De>>>26)|0,De&=67108863;var je=(l+(r=Math.imul(F,pe))|0)+((8191&(o=(o=Math.imul(F,me))+Math.imul(U,pe)|0))<<13)|0;return l=((i=Math.imul(U,me))+(o>>>13)|0)+(je>>>26)|0,je&=67108863,u[0]=ye,u[1]=ve,u[2]=ge,u[3]=be,u[4]=we,u[5]=Ee,u[6]=Se,u[7]=_e,u[8]=xe,u[9]=ke,u[10]=Me,u[11]=Ce,u[12]=Oe,u[13]=Te,u[14]=Ae,u[15]=Pe,u[16]=Le,u[17]=De,u[18]=je,0!==l&&(u[19]=l,n.length++),n};function m(e,t,n){return(new y).mulp(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(p=d),i.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):m(this,e,t),n},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=o/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,l=0;l=0&&(0!==c||l>=o);l--){var f=0|this.words[l];this.words[l]=c<<26-i|f>>>i,c=f&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[o+n]=67108863&i}for(;o>26,this.words[o+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l=0;f--){var h=67108864*(0|r.words[o.length+f])+(0|r.words[o.length+f-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,f);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):this.negative&e.negative?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(t*n+(0|this.words[o]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*t;this.words[n]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var c=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;!(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(c),a.isub(f)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;!(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(u)):(n.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:n.iushln(l)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,c=1;!(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;!(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new _(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(b,g),b.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),o=0;o>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new w;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},_.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},_.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,o),h=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=a;0!==d.cmp(s);){for(var m=d,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var l=t.words[r],c=u-1;c>=0;c--){var f=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==f||0!==a?(a<<=1,a|=f,(4==++s||0===r&&0===c)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},o(x,_),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},7007:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}m(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var o,i,a,l;if(s(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=u(e))>0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,l=c,console&&console.warn&&console.warn(l)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=c.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var l=u.length,c=p(u,l);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},i.prototype.listenerCount=d,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},8078:(e,t,n)=>{var r=n(2861).Buffer,o=n(8276);e.exports=function(e,t,n,i){if(r.isBuffer(e)||(e=r.from(e,"binary")),t&&(r.isBuffer(t)||(t=r.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=n/8,s=r.alloc(a),u=r.alloc(i||0),l=r.alloc(0);a>0||i>0;){var c=new o;c.update(l),c.update(e),t&&c.update(t),l=c.digest();var f=0;if(a>0){var h=s.length-a;f=Math.min(a,l.length),l.copy(s,h,0,f),a-=f}if(f0){var d=u.length-i,p=Math.min(i,l.length-f);l.copy(u,d,f,f+p),i-=p}}return l.fill(0),{key:s,iv:u}}},411:(e,t,n)=>{var r;!function(){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},7593:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;e.exports=function(e,r,o){if("[object Function]"!==n.call(r))throw new TypeError("iterator must be a function");var i=e.length;if(i===+i)for(var a=0;a{var r,o=n(8499);"undefined"!=typeof window&&(r=window.AudioContext||window.webkitAudioContext);var i=null;e.exports=function(e,t){var n=new o;if(!r)return n;var a,s,u,l=(t=t||{}).smoothing||.1,c=t.interval||50,f=t.threshold,h=t.play,d=t.history||10,p=!0;i=t.audioContext||i||new r,(u=i.createAnalyser()).fftSize=512,u.smoothingTimeConstant=l,s=new Float32Array(u.frequencyBinCount),e.jquery&&(e=e[0]),e instanceof HTMLAudioElement||e instanceof HTMLVideoElement?(a=i.createMediaElementSource(e),void 0===h&&(h=!0),f=f||-50):(a=i.createMediaStreamSource(e),f=f||-50),a.connect(u),h&&u.connect(i.destination),n.speaking=!1,n.suspend=function(){return i.suspend()},n.resume=function(){return i.resume()},Object.defineProperty(n,"state",{get:function(){return i.state}}),i.onstatechange=function(){n.emit("state_change",i.state)},n.setThreshold=function(e){f=e},n.setInterval=function(e){c=e},n.stop=function(){p=!1,n.emit("volume_change",-100,f),n.speaking&&(n.speaking=!1,n.emit("stopped_speaking")),u.disconnect(),a.disconnect()},n.speakingHistory=[];for(var m=0;mn&&t[r]<0&&(n=t[r]);return n}(u,s);n.emit("volume_change",e,f);var t=0;if(e>f&&!n.speaking){for(var r=n.speakingHistory.length-3;r=2&&(n.speaking=!0,n.emit("speaking"))}else if(ef)),y()}}),c)};return y(),n}},4729:(e,t,n)=>{"use strict";var r=n(2861).Buffer,o=n(8310).Transform;function i(e){o.call(this),this._block=r.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}n(6698)(i,o),i.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(e){r=e}n(r)},i.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)};var a="undefined"!=typeof Uint8Array,s="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&ArrayBuffer.isView&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);i.prototype.update=function(e,t){if(this._finalized)throw new Error("Digest already called");e=function(e,t){if(e instanceof r)return e;if("string"==typeof e)return r.from(e,t);if(s&&ArrayBuffer.isView(e)){if(0===e.byteLength)return r.alloc(0);var n=r.from(e.buffer,e.byteOffset,e.byteLength);if(n.byteLength===e.byteLength)return n}if(a&&e instanceof Uint8Array)return r.from(e);if(r.isBuffer(e)&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))return r.from(e);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}(e,t);for(var n=this._block,o=0;this._blockOffset+e.length-o>=this._blockSize;){for(var i=this._blockOffset;i0;++u)this._length[u]+=l,(l=this._length[u]/4294967296|0)>0&&(this._length[u]-=4294967296*l);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i},7952:(e,t,n)=>{var r=t;r.utils=n(7426),r.common=n(6166),r.sha=n(6229),r.ripemd=n(6784),r.hmac=n(8948),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},6166:(e,t,n)=>{"use strict";var r=n(7426),o=n(3349);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=i,i.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var o=0;o>>24&255,r[o++]=e>>>16&255,r[o++]=e>>>8&255,r[o++]=255&e}else for(r[o++]=255&e,r[o++]=e>>>8&255,r[o++]=e>>>16&255,r[o++]=e>>>24&255,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,i=8;i{"use strict";var r=n(7426),o=n(3349);function i(e,t,n){if(!(this instanceof i))return new i(e,t,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(t,n))}e.exports=i,i.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),o(e.length<=this.blockSize);for(var t=e.length;t{"use strict";var r=n(7426),o=n(6166),i=r.rotl32,a=r.sum32,s=r.sum32_3,u=r.sum32_4,l=o.BlockHash;function c(){if(!(this instanceof c))return new c;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function d(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}r.inherits(c,l),t.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(e,t){for(var n=this.h[0],r=this.h[1],o=this.h[2],l=this.h[3],c=this.h[4],g=n,b=r,w=o,E=l,S=c,_=0;_<80;_++){var x=a(i(u(n,f(_,r,o,l),e[p[_]+t],h(_)),y[_]),c);n=c,c=l,l=i(o,10),o=r,r=x,x=a(i(u(g,f(79-_,b,w,E),e[m[_]+t],d(_)),v[_]),S),g=S,S=E,E=i(w,10),w=b,b=x}x=s(this.h[1],o,E),this.h[1]=s(this.h[2],l,S),this.h[2]=s(this.h[3],c,g),this.h[3]=s(this.h[4],n,b),this.h[4]=s(this.h[0],r,w),this.h[0]=x},c.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"little"):r.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],v=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},6229:(e,t,n)=>{"use strict";t.sha1=n(3917),t.sha224=n(7714),t.sha256=n(2287),t.sha384=n(1911),t.sha512=n(7766)},3917:(e,t,n)=>{"use strict";var r=n(7426),o=n(6166),i=n(6225),a=r.rotl32,s=r.sum32,u=r.sum32_5,l=i.ft_1,c=o.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}r.inherits(h,c),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r{"use strict";var r=n(7426),o=n(2287);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}r.inherits(i,o),e.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")}},2287:(e,t,n)=>{"use strict";var r=n(7426),o=n(6166),i=n(6225),a=n(3349),s=r.sum32,u=r.sum32_4,l=r.sum32_5,c=i.ch32,f=i.maj32,h=i.s0_256,d=i.s1_256,p=i.g0_256,m=i.g1_256,y=o.BlockHash,v=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function g(){if(!(this instanceof g))return new g;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}r.inherits(g,y),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r{"use strict";var r=n(7426),o=n(7766);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}r.inherits(i,o),e.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")}},7766:(e,t,n)=>{"use strict";var r=n(7426),o=n(6166),i=n(3349),a=r.rotr64_hi,s=r.rotr64_lo,u=r.shr64_hi,l=r.shr64_lo,c=r.sum64,f=r.sum64_hi,h=r.sum64_lo,d=r.sum64_4_hi,p=r.sum64_4_lo,m=r.sum64_5_hi,y=r.sum64_5_lo,v=o.BlockHash,g=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;v.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(e,t,n,r,o){var i=e&n^~e&o;return i<0&&(i+=4294967296),i}function E(e,t,n,r,o,i){var a=t&r^~t&i;return a<0&&(a+=4294967296),a}function S(e,t,n,r,o){var i=e&n^e&o^n&o;return i<0&&(i+=4294967296),i}function _(e,t,n,r,o,i){var a=t&r^t&i^r&i;return a<0&&(a+=4294967296),a}function x(e,t){var n=a(e,t,28)^a(t,e,2)^a(t,e,7);return n<0&&(n+=4294967296),n}function k(e,t){var n=s(e,t,28)^s(t,e,2)^s(t,e,7);return n<0&&(n+=4294967296),n}function M(e,t){var n=s(e,t,14)^s(e,t,18)^s(t,e,9);return n<0&&(n+=4294967296),n}function C(e,t){var n=a(e,t,1)^a(e,t,8)^u(e,t,7);return n<0&&(n+=4294967296),n}function O(e,t){var n=s(e,t,1)^s(e,t,8)^l(e,t,7);return n<0&&(n+=4294967296),n}function T(e,t){var n=s(e,t,19)^s(t,e,29)^l(e,t,6);return n<0&&(n+=4294967296),n}r.inherits(b,v),e.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r{"use strict";var r=n(7426).rotr32;function o(e,t,n){return e&t^~e&n}function i(e,t,n){return e&t^e&n^t&n}function a(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?o(t,n,r):1===e||3===e?a(t,n,r):2===e?i(t,n,r):void 0},t.ch32=o,t.maj32=i,t.p32=a,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},7426:(e,t,n)=>{"use strict";var r=n(3349),o=n(6698);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o>6|192,n[r++]=63&a|128):i(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128):(n[r++]=a>>12|224,n[r++]=a>>6&63|128,n[r++]=63&a|128)}else for(o=0;o>>0}return a},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,o=0;r>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,o){return e+t+n+r+o>>>0},t.sum64=function(e,t,n,r){var o=e[t],i=r+e[t+1]>>>0,a=(i>>0,e[t+1]=i},t.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,o,i,a,s){var u=0,l=t;return u+=(l=l+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,o,i,a,s){return t+r+i+s>>>0},t.sum64_5_hi=function(e,t,n,r,o,i,a,s,u,l){var c=0,f=t;return c+=(f=f+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,o,i,a,s,u,l){return t+r+i+s+l>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},2723:(e,t,n)=>{"use strict";var r=n(7952),o=n(4367),i=n(3349);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),n=o.toArray(e.nonce,e.nonceEnc||"hex"),r=o.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}e.exports=a,a.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},a.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=o.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length{"use strict";var r=n(3404),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,c=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var o=d(n);o&&o!==p&&e(t,o,r)}var a=c(n);f&&(a=a.concat(f(n)));for(var s=u(t),m=u(n),y=0;y{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,g=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function E(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case f:case i:case s:case a:case d:return e;default:switch(e=e&&e.$$typeof){case l:case h:case y:case m:case u:return e;default:return t}}case o:return t}}}function S(e){return E(e)===f}t.AsyncMode=c,t.ConcurrentMode=f,t.ContextConsumer=l,t.ContextProvider=u,t.Element=r,t.ForwardRef=h,t.Fragment=i,t.Lazy=y,t.Memo=m,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=d,t.isAsyncMode=function(e){return S(e)||E(e)===c},t.isConcurrentMode=S,t.isContextConsumer=function(e){return E(e)===l},t.isContextProvider=function(e){return E(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return E(e)===h},t.isFragment=function(e){return E(e)===i},t.isLazy=function(e){return E(e)===y},t.isMemo=function(e){return E(e)===m},t.isPortal=function(e){return E(e)===o},t.isProfiler=function(e){return E(e)===s},t.isStrictMode=function(e){return E(e)===a},t.isSuspense=function(e){return E(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===s||e===a||e===d||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===u||e.$$typeof===l||e.$$typeof===h||e.$$typeof===g||e.$$typeof===b||e.$$typeof===w||e.$$typeof===v)},t.typeOf=E},3404:(e,t,n)=>{"use strict";e.exports=n(3072)},251:(e,t)=>{t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<>1,c=-7,f=n?o-1:0,h=n?-1:1,d=e[t+f];for(f+=h,i=d&(1<<-c)-1,d>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=h,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=h,c-=8);if(0===i)i=1-l;else{if(i===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=l}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,l=8*i-o-1,c=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&s,d+=p,s/=256,o-=8);for(a=a<0;e[n+d]=255&a,d+=p,a/=256,l-=8);e[n+d-p]|=128*m}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},4634:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},169:(e,t,n)=>{var r=null;"undefined"!=typeof WebSocket?r=WebSocket:"undefined"!=typeof MozWebSocket?r=MozWebSocket:void 0!==n.g?r=n.g.WebSocket||n.g.MozWebSocket:"undefined"!=typeof window?r=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(r=self.WebSocket||self.MozWebSocket),e.exports=r},4692:function(e,t){var n;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(r,o){"use strict";var i=[],a=Object.getPrototypeOf,s=i.slice,u=i.flat?function(e){return i.flat.call(e)}:function(e){return i.concat.apply([],e)},l=i.push,c=i.indexOf,f={},h=f.toString,d=f.hasOwnProperty,p=d.toString,m=p.call(Object),y={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},g=function(e){return null!=e&&e===e.window},b=r.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function E(e,t,n){var r,o,i=(n=n||b).createElement("script");if(i.text=e,t)for(r in w)(o=t[r]||t.getAttribute&&t.getAttribute(r))&&i.setAttribute(r,o);n.head.appendChild(i).parentNode.removeChild(i)}function S(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[h.call(e)]||"object":typeof e}var _="3.6.4",x=function(e,t){return new x.fn.init(e,t)};function k(e){var t=!!e&&"length"in e&&e.length,n=S(e);return!v(e)&&!g(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}x.fn=x.prototype={jquery:_,constructor:x,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return x.each(this,e)},map:function(e){return this.pushStack(x.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(x.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(x.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+R+")"+R+"*"),V=new RegExp(R+"|>"),W=new RegExp(B),K=new RegExp("^"+F+"$"),$={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},Q=/HTML$/i,Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+R+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,oe=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ie=function(){h()},ae=we((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{D.apply(A=j.call(E.childNodes),E.childNodes),A[E.childNodes.length].nodeType}catch(e){D={apply:A.length?function(e,t){L.apply(e,j.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,o){var i,s,l,c,f,p,v,g=t&&t.ownerDocument,E=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==E&&9!==E&&11!==E)return r;if(!o&&(h(t),t=t||d,m)){if(11!==E&&(f=X.exec(e)))if(i=f[1]){if(9===E){if(!(l=t.getElementById(i)))return r;if(l.id===i)return r.push(l),r}else if(g&&(l=g.getElementById(i))&&b(t,l)&&l.id===i)return r.push(l),r}else{if(f[2])return D.apply(r,t.getElementsByTagName(e)),r;if((i=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return D.apply(r,t.getElementsByClassName(i)),r}if(n.qsa&&!C[e+" "]&&(!y||!y.test(e))&&(1!==E||"object"!==t.nodeName.toLowerCase())){if(v=e,g=t,1===E&&(V.test(e)||G.test(e))){for((g=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,oe):t.setAttribute("id",c=w)),s=(p=a(e)).length;s--;)p[s]=(c?"#"+c:":scope")+" "+be(p[s]);v=p.join(",")}try{return D.apply(r,g.querySelectorAll(v)),r}catch(t){C(e,!0)}finally{c===w&&t.removeAttribute("id")}}}return u(e.replace(z,"$1"),t,r,o)}function ue(){var e=[];return function t(n,o){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=o}}function le(e){return e[w]=!0,e}function ce(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var n=e.split("|"),o=n.length;o--;)r.attrHandle[n[o]]=t}function he(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ye(e){return le((function(t){return t=+t,le((function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Q.test(t||n&&n.nodeName||"HTML")},h=se.setDocument=function(e){var t,o,a=e?e.ownerDocument||e:E;return a!=d&&9===a.nodeType&&a.documentElement?(p=(d=a).documentElement,m=!i(d),E!=d&&(o=d.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",ie,!1):o.attachEvent&&o.attachEvent("onunload",ie)),n.scope=ce((function(e){return p.appendChild(e).appendChild(d.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.cssHas=ce((function(){try{return d.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=J.test(d.getElementsByClassName),n.getById=ce((function(e){return p.appendChild(e).id=w,!d.getElementsByName||!d.getElementsByName(w).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,o,i=t.getElementById(e);if(i){if((n=i.getAttributeNode("id"))&&n.value===e)return[i];for(o=t.getElementsByName(e),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===e)return[i]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=J.test(d.querySelectorAll))&&(ce((function(e){var t;p.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+R+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+R+"*(?:value|"+I+")"),e.querySelectorAll("[id~="+w+"-]").length||y.push("~="),(t=d.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+R+"*name"+R+"*="+R+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")})),ce((function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+R+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")}))),(n.matchesSelector=J.test(g=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ce((function(e){n.disconnectedMatch=g.call(e,"*"),g.call(e,"[s!='']:x"),v.push("!=",B)})),n.cssHas||y.push(":has"),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=J.test(p.compareDocumentPosition),b=t||J.test(p.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},O=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==d||e.ownerDocument==E&&b(E,e)?-1:t==d||t.ownerDocument==E&&b(E,t)?1:c?N(c,e)-N(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],s=[t];if(!o||!i)return e==d?-1:t==d?1:o?-1:i?1:c?N(c,e)-N(c,t):0;if(o===i)return he(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?he(a[r],s[r]):a[r]==E?-1:s[r]==E?1:0},d):d},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(h(e),n.matchesSelector&&m&&!C[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=g.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){C(t,!0)}return se(t,d,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=d&&h(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=d&&h(e);var o=r.attrHandle[t.toLowerCase()],i=o&&T.call(r.attrHandle,t.toLowerCase())?o(e,t,!m):void 0;return void 0!==i?i:n.attributes||!m?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},se.escape=function(e){return(e+"").replace(re,oe)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],o=0,i=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(O),f){for(;t=e[i++];)t===e[i]&&(o=r.push(i));for(;o--;)e.splice(r[o],1)}return c=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=o(t);return n},r=se.selectors={cacheLength:50,createPseudo:le,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&W.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=x[e+" "];return t||(t=new RegExp("(^|"+R+")"+e+"("+R+"|$)"))&&x(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var o=se.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(H," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,h,d,p,m=i!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),g=!u&&!s,b=!1;if(y){if(i){for(;m;){for(h=t;h=h[m];)if(s?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?y.firstChild:y.lastChild],a&&g){for(b=(d=(l=(c=(f=(h=y)[w]||(h[w]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]||[])[0]===S&&l[1])&&l[2],h=d&&y.childNodes[d];h=++d&&h&&h[m]||(b=d=0)||p.pop();)if(1===h.nodeType&&++b&&h===t){c[e]=[S,d,b];break}}else if(g&&(b=d=(l=(c=(f=(h=t)[w]||(h[w]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]||[])[0]===S&&l[1]),!1===b)for(;(h=++d&&h&&h[m]||(b=d=0)||p.pop())&&((s?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++b||(g&&((c=(f=h[w]||(h[w]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]=[S,b]),h!==t)););return(b-=o)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,o=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return o[w]?o(t):o.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?le((function(e,n){for(var r,i=o(e,t),a=i.length;a--;)e[r=N(e,i[a])]=!(n[r]=i[a])})):function(e){return o(e,0,n)}):o}},pseudos:{not:le((function(e){var t=[],n=[],r=s(e.replace(z,"$1"));return r[w]?le((function(e,t,n,o){for(var i,a=r(e,null,o,[]),s=e.length;s--;)(i=a[s])&&(e[s]=!(t[s]=i))})):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}})),has:le((function(e){return function(t){return se(e,t).length>0}})),contains:le((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||o(t)).indexOf(e)>-1}})),lang:le((function(e){return K.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ye((function(){return[0]})),last:ye((function(e,t){return[t-1]})),eq:ye((function(e,t,n){return[n<0?n+t:n]})),even:ye((function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e})),gt:ye((function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function Se(e,t,n,r,o){for(var i,a=[],s=0,u=e.length,l=null!=t;s-1&&(i[l]=!(a[l]=f))}}else v=Se(v===a?v.splice(p,v.length):v),o?o(null,a,v,u):D.apply(a,v)}))}function xe(e){for(var t,n,o,i=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=we((function(e){return e===t}),s,!0),f=we((function(e){return N(t,e)>-1}),s,!0),h=[function(e,n,r){var o=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,o}];u1&&Ee(h),u>1&&be(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(z,"$1"),n,u0,o=e.length>0,i=function(i,a,s,u,c){var f,p,y,v=0,g="0",b=i&&[],w=[],E=l,_=i||o&&r.find.TAG("*",c),x=S+=null==E?1:Math.random()||.1,k=_.length;for(c&&(l=a==d||a||c);g!==k&&null!=(f=_[g]);g++){if(o&&f){for(p=0,a||f.ownerDocument==d||(h(f),s=!m);y=e[p++];)if(y(f,a||d,s)){u.push(f);break}c&&(S=x)}n&&((f=!y&&f)&&v--,i&&b.push(f))}if(v+=g,n&&g!==v){for(p=0;y=t[p++];)y(b,w,a,s);if(i){if(v>0)for(;g--;)b[g]||w[g]||(w[g]=P.call(u));w=Se(w)}D.apply(u,w),c&&!i&&w.length>0&&v+t.length>1&&se.uniqueSort(u)}return c&&(S=x,l=E),b};return n?le(i):i}(i,o)),s.selector=e}return s},u=se.select=function(e,t,n,o){var i,u,l,c,f,h="function"==typeof e&&e,d=!o&&a(e=h.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&m&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(te,ne),t)||[])[0]))return n;h&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(i=$.needsContext.test(e)?0:u.length;i--&&(l=u[i],!r.relative[c=l.type]);)if((f=r.find[c])&&(o=f(l.matches[0].replace(te,ne),ee.test(u[0].type)&&ve(t.parentNode)||t))){if(u.splice(i,1),!(e=o.length&&be(u)))return D.apply(n,o),n;break}}return(h||s(e,d))(o,t,!m,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=w.split("").sort(O).join("")===w,n.detectDuplicates=!!f,h(),n.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))})),ce((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||fe("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ce((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||fe("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||fe(I,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),se}(r);x.find=M,x.expr=M.selectors,x.expr[":"]=x.expr.pseudos,x.uniqueSort=x.unique=M.uniqueSort,x.text=M.getText,x.isXMLDoc=M.isXML,x.contains=M.contains,x.escapeSelector=M.escape;var C=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&x(e).is(n))break;r.push(e)}return r},O=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},T=x.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var P=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function L(e,t,n){return v(t)?x.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?x.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?x.grep(e,(function(e){return c.call(t,e)>-1!==n})):x.filter(t,e,n)}x.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,(function(e){return 1===e.nodeType})))},x.fn.extend({find:function(e){var t,n,r=this.length,o=this;if("string"!=typeof e)return this.pushStack(x(e).filter((function(){for(t=0;t1?x.uniqueSort(n):n},filter:function(e){return this.pushStack(L(this,e||[],!1))},not:function(e){return this.pushStack(L(this,e||[],!0))},is:function(e){return!!L(this,"string"==typeof e&&T.test(e)?x(e):e||[],!1).length}});var D,j=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(x.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:j.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:b,!0)),P.test(r[1])&&x.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(o=b.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(x):x.makeArray(e,this)}).prototype=x.fn,D=x(b);var N=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};function R(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}x.fn.extend({has:function(e){var t=x(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&x.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?x.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?c.call(x(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(x.uniqueSort(x.merge(this.get(),x(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return C(e,"parentNode")},parentsUntil:function(e,t,n){return C(e,"parentNode",n)},next:function(e){return R(e,"nextSibling")},prev:function(e){return R(e,"previousSibling")},nextAll:function(e){return C(e,"nextSibling")},prevAll:function(e){return C(e,"previousSibling")},nextUntil:function(e,t,n){return C(e,"nextSibling",n)},prevUntil:function(e,t,n){return C(e,"previousSibling",n)},siblings:function(e){return O((e.parentNode||{}).firstChild,e)},children:function(e){return O(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),x.merge([],e.childNodes))}},(function(e,t){x.fn[e]=function(n,r){var o=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=x.filter(r,o)),this.length>1&&(I[e]||x.uniqueSort(o),N.test(e)&&o.reverse()),this.pushStack(o)}}));var F=/[^\x20\t\r\n\f]+/g;function U(e){return e}function B(e){throw e}function H(e,t,n,r){var o;try{e&&v(o=e.promise)?o.call(e).done(t).fail(n):e&&v(o=e.then)?o.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}x.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return x.each(e.match(F)||[],(function(e,n){t[n]=!0})),t}(e):x.extend({},e);var t,n,r,o,i=[],a=[],s=-1,u=function(){for(o=o||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s-1;)i.splice(n,1),n<=s&&s--})),this},has:function(e){return e?x.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=a=[],n||t||(i=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},x.extend({Deferred:function(e){var t=[["notify","progress",x.Callbacks("memory"),x.Callbacks("memory"),2],["resolve","done",x.Callbacks("once memory"),x.Callbacks("once memory"),0,"resolved"],["reject","fail",x.Callbacks("once memory"),x.Callbacks("once memory"),1,"rejected"]],n="pending",o={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return o.then(null,e)},pipe:function(){var e=arguments;return x.Deferred((function(n){x.each(t,(function(t,r){var o=v(e[r[4]])&&e[r[4]];i[r[1]]((function(){var e=o&&o.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,o?[e]:arguments)}))})),e=null})).promise()},then:function(e,n,o){var i=0;function a(e,t,n,o){return function(){var s=this,u=arguments,l=function(){var r,l;if(!(e=i&&(n!==B&&(s=void 0,u=[r]),t.rejectWith(s,u))}};e?c():(x.Deferred.getStackHook&&(c.stackTrace=x.Deferred.getStackHook()),r.setTimeout(c))}}return x.Deferred((function(r){t[0][3].add(a(0,r,v(o)?o:U,r.notifyWith)),t[1][3].add(a(0,r,v(e)?e:U)),t[2][3].add(a(0,r,v(n)?n:B))})).promise()},promise:function(e){return null!=e?x.extend(e,o):o}},i={};return x.each(t,(function(e,r){var a=r[2],s=r[5];o[r[1]]=a.add,s&&a.add((function(){n=s}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(r[3].fire),i[r[0]]=function(){return i[r[0]+"With"](this===i?void 0:this,arguments),this},i[r[0]+"With"]=a.fireWith})),o.promise(i),e&&e.call(i,i),i},when:function(e){var t=arguments.length,n=t,r=Array(n),o=s.call(arguments),i=x.Deferred(),a=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?s.call(arguments):n,--t||i.resolveWith(r,o)}};if(t<=1&&(H(e,i.done(a(n)).resolve,i.reject,!t),"pending"===i.state()||v(o[n]&&o[n].then)))return i.then();for(;n--;)H(o[n],a(n),i.reject);return i.promise()}});var z=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;x.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&z.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},x.readyException=function(e){r.setTimeout((function(){throw e}))};var q=x.Deferred();function G(){b.removeEventListener("DOMContentLoaded",G),r.removeEventListener("load",G),x.ready()}x.fn.ready=function(e){return q.then(e).catch((function(e){x.readyException(e)})),this},x.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--x.readyWait:x.isReady)||(x.isReady=!0,!0!==e&&--x.readyWait>0||q.resolveWith(b,[x]))}}),x.ready.then=q.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?r.setTimeout(x.ready):(b.addEventListener("DOMContentLoaded",G),r.addEventListener("load",G));var V=function(e,t,n,r,o,i,a){var s=0,u=e.length,l=null==n;if("object"===S(n))for(s in o=!0,n)V(e,t,s,n[s],!0,i,a);else if(void 0!==r&&(o=!0,v(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(x(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each((function(){X.remove(this,e)}))}}),x.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,x.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,o=n.shift(),i=x._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,(function(){x.dequeue(e,t)}),i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:x.Callbacks("once memory").add((function(){J.remove(e,[t+"queue",n])}))})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ge=/^$|^module$|\/(?:java|ecma)script/i;pe=b.createDocumentFragment().appendChild(b.createElement("div")),(me=b.createElement("input")).setAttribute("type","radio"),me.setAttribute("checked","checked"),me.setAttribute("name","t"),pe.appendChild(me),y.checkClone=pe.cloneNode(!0).cloneNode(!0).lastChild.checked,pe.innerHTML="",y.noCloneChecked=!!pe.cloneNode(!0).lastChild.defaultValue,pe.innerHTML="",y.option=!!pe.lastChild;var be={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function we(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?x.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var Se=/<|&#?\w+;/;function _e(e,t,n,r,o){for(var i,a,s,u,l,c,f=t.createDocumentFragment(),h=[],d=0,p=e.length;d-1)o&&o.push(i);else if(l=se(i),a=we(f.appendChild(i),"script"),l&&Ee(a),n)for(c=0;i=a[c++];)ge.test(i.type||"")&&n.push(i);return f}var xe=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Me(){return!1}function Ce(e,t){return e===function(){try{return b.activeElement}catch(e){}}()==("focus"===t)}function Oe(e,t,n,r,o,i){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Oe(e,s,n,r,t[s],i);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=Me;else if(!o)return e;return 1===i&&(a=o,o=function(e){return x().off(e),a.apply(this,arguments)},o.guid=a.guid||(a.guid=x.guid++)),e.each((function(){x.event.add(this,t,o,r,n)}))}function Te(e,t,n){n?(J.set(e,t,!1),x.event.add(e,t,{namespace:!1,handler:function(e){var r,o,i=J.get(this,t);if(1&e.isTrigger&&this[t]){if(i.length)(x.event.special[t]||{}).delegateType&&e.stopPropagation();else if(i=s.call(arguments),J.set(this,t,i),r=n(this,t),this[t](),i!==(o=J.get(this,t))||r?J.set(this,t,!1):o={},i!==o)return e.stopImmediatePropagation(),e.preventDefault(),o&&o.value}else i.length&&(J.set(this,t,{value:x.event.trigger(x.extend(i[0],x.Event.prototype),i.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===J.get(e,t)&&x.event.add(e,t,ke)}x.event={global:{},add:function(e,t,n,r,o){var i,a,s,u,l,c,f,h,d,p,m,y=J.get(e);if(Y(e))for(n.handler&&(n=(i=n).handler,o=i.selector),o&&x.find.matchesSelector(ae,o),n.guid||(n.guid=x.guid++),(u=y.events)||(u=y.events=Object.create(null)),(a=y.handle)||(a=y.handle=function(t){return void 0!==x&&x.event.triggered!==t.type?x.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(F)||[""]).length;l--;)d=m=(s=xe.exec(t[l])||[])[1],p=(s[2]||"").split(".").sort(),d&&(f=x.event.special[d]||{},d=(o?f.delegateType:f.bindType)||d,f=x.event.special[d]||{},c=x.extend({type:d,origType:m,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&x.expr.match.needsContext.test(o),namespace:p.join(".")},i),(h=u[d])||((h=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,p,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),o?h.splice(h.delegateCount++,0,c):h.push(c),x.event.global[d]=!0)},remove:function(e,t,n,r,o){var i,a,s,u,l,c,f,h,d,p,m,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){for(l=(t=(t||"").match(F)||[""]).length;l--;)if(d=m=(s=xe.exec(t[l])||[])[1],p=(s[2]||"").split(".").sort(),d){for(f=x.event.special[d]||{},h=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=h.length;i--;)c=h[i],!o&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(h.splice(i,1),c.selector&&h.delegateCount--,f.remove&&f.remove.call(e,c));a&&!h.length&&(f.teardown&&!1!==f.teardown.call(e,p,y.handle)||x.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)x.event.remove(e,d+t[l],n,r,!0);x.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t,n,r,o,i,a,s=new Array(arguments.length),u=x.event.fix(e),l=(J.get(this,"events")||Object.create(null))[u.type]||[],c=x.event.special[u.type]||{};for(s[0]=u,t=1;t=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(i=[],a={},n=0;n-1:x.find(o,this,null,[l]).length),a[o]&&i.push(r);i.length&&s.push({elem:l,handlers:i})}return l=this,u\s*$/g;function De(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&x(e).children("tbody")[0]||e}function je(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ne(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ie(e,t){var n,r,o,i,a,s;if(1===t.nodeType){if(J.hasData(e)&&(s=J.get(e).events))for(o in J.remove(t,"handle events"),s)for(n=0,r=s[o].length;n1&&"string"==typeof p&&!y.checkClone&&Pe.test(p))return e.each((function(o){var i=e.eq(o);m&&(t[0]=p.call(this,o,i.html())),Fe(i,t,n,r)}));if(h&&(i=(o=_e(t,e[0].ownerDocument,!1,e,r)).firstChild,1===o.childNodes.length&&(o=i),i||r)){for(s=(a=x.map(we(o,"script"),je)).length;f0&&Ee(a,!u&&we(e,"script")),s},cleanData:function(e){for(var t,n,r,o=x.event.special,i=0;void 0!==(n=e[i]);i++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)o[r]?x.event.remove(n,r):x.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[X.expando]&&(n[X.expando]=void 0)}}}),x.fn.extend({detach:function(e){return Ue(this,e,!0)},remove:function(e){return Ue(this,e)},text:function(e){return V(this,(function(e){return void 0===e?x.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Fe(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||De(this,e).appendChild(e)}))},prepend:function(){return Fe(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=De(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Fe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Fe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(we(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return x.clone(this,e,t)}))},html:function(e){return V(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!be[(ve.exec(e)||["",""])[1].toLowerCase()]){e=x.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-i-u-s-.5))||0),u}function ot(e,t,n){var r=ze(e),o=(!y.boxSizingReliable()||n)&&"border-box"===x.css(e,"boxSizing",!1,r),i=o,a=Ke(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Be.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&o||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===x.css(e,"display",!1,r))&&e.getClientRects().length&&(o="border-box"===x.css(e,"boxSizing",!1,r),(i=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+rt(e,t,n||(o?"border":"content"),i,r,a)+"px"}function it(e,t,n,r,o){return new it.prototype.init(e,t,n,r,o)}x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ke(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,i,a,s=Q(t),u=He.test(t),l=e.style;if(u||(t=Je(s)),a=x.cssHooks[t]||x.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(o=a.get(e,!1,r))?o:l[t];"string"==(i=typeof n)&&(o=oe.exec(n))&&o[1]&&(n=ce(e,t,o),i="number"),null!=n&&n==n&&("number"!==i||u||(n+=o&&o[3]||(x.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var o,i,a,s=Q(t);return He.test(t)||(t=Je(s)),(a=x.cssHooks[t]||x.cssHooks[s])&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=Ke(e,t,r)),"normal"===o&&t in tt&&(o=tt[t]),""===n||n?(i=parseFloat(o),!0===n||isFinite(i)?i||0:o):o}}),x.each(["height","width"],(function(e,t){x.cssHooks[t]={get:function(e,n,r){if(n)return!Xe.test(x.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,t,r):qe(e,et,(function(){return ot(e,t,r)}))},set:function(e,n,r){var o,i=ze(e),a=!y.scrollboxSize()&&"absolute"===i.position,s=(a||r)&&"border-box"===x.css(e,"boxSizing",!1,i),u=r?rt(e,t,r,s,i):0;return s&&a&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(i[t])-rt(e,t,"border",!1,i)-.5)),u&&(o=oe.exec(n))&&"px"!==(o[3]||"px")&&(e.style[t]=n,n=x.css(e,t)),nt(0,n,u)}}})),x.cssHooks.marginLeft=$e(y.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ke(e,"marginLeft"))||e.getBoundingClientRect().left-qe(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),x.each({margin:"",padding:"",border:"Width"},(function(e,t){x.cssHooks[e+t]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];r<4;r++)o[e+ie[r]+t]=i[r]||i[r-2]||i[0];return o}},"margin"!==e&&(x.cssHooks[e+t].set=nt)})),x.fn.extend({css:function(e,t){return V(this,(function(e,t,n){var r,o,i={},a=0;if(Array.isArray(t)){for(r=ze(e),o=t.length;a1)}}),x.Tween=it,it.prototype={constructor:it,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||x.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(x.cssNumber[n]?"":"px")},cur:function(){var e=it.propHooks[this.prop];return e&&e.get?e.get(this):it.propHooks._default.get(this)},run:function(e){var t,n=it.propHooks[this.prop];return this.options.duration?this.pos=t=x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):it.propHooks._default.set(this),this}},it.prototype.init.prototype=it.prototype,it.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=x.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):1!==e.elem.nodeType||!x.cssHooks[e.prop]&&null==e.elem.style[Je(e.prop)]?e.elem[e.prop]=e.now:x.style(e.elem,e.prop,e.now+e.unit)}}},it.propHooks.scrollTop=it.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},x.fx=it.prototype.init,x.fx.step={};var at,st,ut=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function ct(){st&&(!1===b.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ct):r.setTimeout(ct,x.fx.interval),x.fx.tick())}function ft(){return r.setTimeout((function(){at=void 0})),at=Date.now()}function ht(e,t){var n,r=0,o={height:e};for(t=t?1:0;r<4;r+=2-t)o["margin"+(n=ie[r])]=o["padding"+n]=e;return t&&(o.opacity=o.width=e),o}function dt(e,t,n){for(var r,o=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),i=0,a=o.length;i1)},removeAttr:function(e){return this.each((function(){x.removeAttr(this,e)}))}}),x.extend({attr:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?x.prop(e,t,n):(1===i&&x.isXMLDoc(e)||(o=x.attrHooks[t.toLowerCase()]||(x.expr.match.bool.test(t)?mt:void 0)),void 0!==n?null===n?void x.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:null==(r=x.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,o=t&&t.match(F);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)}}),mt={set:function(e,t,n){return!1===t?x.removeAttr(e,n):e.setAttribute(n,n),n}},x.each(x.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=yt[t]||x.find.attr;yt[t]=function(e,t,r){var o,i,a=t.toLowerCase();return r||(i=yt[a],yt[a]=o,o=null!=n(e,t,r)?a:null,yt[a]=i),o}}));var vt=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function bt(e){return(e.match(F)||[]).join(" ")}function wt(e){return e.getAttribute&&e.getAttribute("class")||""}function Et(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(F)||[]}x.fn.extend({prop:function(e,t){return V(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[x.propFix[e]||e]}))}}),x.extend({prop:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&x.isXMLDoc(e)||(t=x.propFix[t]||t,o=x.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),y.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){x.propFix[this.toLowerCase()]=this})),x.fn.extend({addClass:function(e){var t,n,r,o,i,a;return v(e)?this.each((function(t){x(this).addClass(e.call(this,t,wt(this)))})):(t=Et(e)).length?this.each((function(){if(r=wt(this),n=1===this.nodeType&&" "+bt(r)+" "){for(i=0;i-1;)n=n.replace(" "+o+" "," ");a=bt(n),r!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,o,i,a=typeof e,s="string"===a||Array.isArray(e);return v(e)?this.each((function(n){x(this).toggleClass(e.call(this,n,wt(this),t),t)})):"boolean"==typeof t&&s?t?this.addClass(e):this.removeClass(e):(n=Et(e),this.each((function(){if(s)for(i=x(this),o=0;o-1)return!0;return!1}});var St=/\r/g;x.fn.extend({val:function(e){var t,n,r,o=this[0];return arguments.length?(r=v(e),this.each((function(n){var o;1===this.nodeType&&(null==(o=r?e.call(this,n,x(this).val()):e)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=x.map(o,(function(e){return null==e?"":e+""}))),(t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))}))):o?(t=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(St,""):null==n?"":n:void 0}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:bt(x.text(e))}},select:{get:function(e){var t,n,r,o=e.options,i=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?i+1:o.length;for(r=i<0?u:a?i:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),x.each(["radio","checkbox"],(function(){x.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=x.inArray(x(e).val(),t)>-1}},y.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),y.focusin="onfocusin"in r;var _t=/^(?:focusinfocus|focusoutblur)$/,xt=function(e){e.stopPropagation()};x.extend(x.event,{trigger:function(e,t,n,o){var i,a,s,u,l,c,f,h,p=[n||b],m=d.call(e,"type")?e.type:e,y=d.call(e,"namespace")?e.namespace.split("."):[];if(a=h=s=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!_t.test(m+x.event.triggered)&&(m.indexOf(".")>-1&&(y=m.split("."),m=y.shift(),y.sort()),l=m.indexOf(":")<0&&"on"+m,(e=e[x.expando]?e:new x.Event(m,"object"==typeof e&&e)).isTrigger=o?2:3,e.namespace=y.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:x.makeArray(t,[e]),f=x.event.special[m]||{},o||!f.trigger||!1!==f.trigger.apply(n,t))){if(!o&&!f.noBubble&&!g(n)){for(u=f.delegateType||m,_t.test(u+m)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(n.ownerDocument||b)&&p.push(s.defaultView||s.parentWindow||r)}for(i=0;(a=p[i++])&&!e.isPropagationStopped();)h=a,e.type=i>1?u:f.bindType||m,(c=(J.get(a,"events")||Object.create(null))[e.type]&&J.get(a,"handle"))&&c.apply(a,t),(c=l&&a[l])&&c.apply&&Y(a)&&(e.result=c.apply(a,t),!1===e.result&&e.preventDefault());return e.type=m,o||e.isDefaultPrevented()||f._default&&!1!==f._default.apply(p.pop(),t)||!Y(n)||l&&v(n[m])&&!g(n)&&((s=n[l])&&(n[l]=null),x.event.triggered=m,e.isPropagationStopped()&&h.addEventListener(m,xt),n[m](),e.isPropagationStopped()&&h.removeEventListener(m,xt),x.event.triggered=void 0,s&&(n[l]=s)),e.result}},simulate:function(e,t,n){var r=x.extend(new x.Event,n,{type:e,isSimulated:!0});x.event.trigger(r,null,t)}}),x.fn.extend({trigger:function(e,t){return this.each((function(){x.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return x.event.trigger(e,t,n,!0)}}),y.focusin||x.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){x.event.simulate(t,e.target,x.event.fix(e))};x.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,o=J.access(r,t);o||r.addEventListener(e,n,!0),J.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,o=J.access(r,t)-1;o?J.access(r,t,o):(r.removeEventListener(e,n,!0),J.remove(r,t))}}}));var kt=r.location,Mt={guid:Date.now()},Ct=/\?/;x.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||x.error("Invalid XML: "+(n?x.map(n.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var Ot=/\[\]$/,Tt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Pt=/^(?:input|select|textarea|keygen)/i;function Lt(e,t,n,r){var o;if(Array.isArray(t))x.each(t,(function(t,o){n||Ot.test(e)?r(e,o):Lt(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,r)}));else if(n||"object"!==S(t))r(e,t);else for(o in t)Lt(e+"["+o+"]",t[o],n,r)}x.param=function(e,t){var n,r=[],o=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,(function(){o(this.name,this.value)}));else for(n in e)Lt(n,e[n],t,o);return r.join("&")},x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&Pt.test(this.nodeName)&&!At.test(e)&&(this.checked||!ye.test(e))})).map((function(e,t){var n=x(this).val();return null==n?null:Array.isArray(n)?x.map(n,(function(e){return{name:t.name,value:e.replace(Tt,"\r\n")}})):{name:t.name,value:n.replace(Tt,"\r\n")}})).get()}});var Dt=/%20/g,jt=/#.*$/,Nt=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,Ft=/^\/\//,Ut={},Bt={},Ht="*/".concat("*"),zt=b.createElement("a");function qt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o=0,i=t.toLowerCase().match(F)||[];if(v(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Gt(e,t,n,r){var o={},i=e===Bt;function a(s){var u;return o[s]=!0,x.each(e[s]||[],(function(e,s){var l=s(t,n,r);return"string"!=typeof l||i||o[l]?i?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)})),u}return a(t.dataTypes[0])||!o["*"]&&a("*")}function Vt(e,t){var n,r,o=x.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);return r&&x.extend(!0,e,r),e}zt.href=kt.href,x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:kt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(kt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ht,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Vt(Vt(e,x.ajaxSettings),t):Vt(x.ajaxSettings,e)},ajaxPrefilter:qt(Ut),ajaxTransport:qt(Bt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,o,i,a,s,u,l,c,f,h,d=x.ajaxSetup({},t),p=d.context||d,m=d.context&&(p.nodeType||p.jquery)?x(p):x.event,y=x.Deferred(),v=x.Callbacks("once memory"),g=d.statusCode||{},w={},E={},S="canceled",_={readyState:0,getResponseHeader:function(e){var t;if(l){if(!a)for(a={};t=It.exec(i);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?i:null},setRequestHeader:function(e,t){return null==l&&(e=E[e.toLowerCase()]=E[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==l&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)_.always(e[_.status]);else for(t in e)g[t]=[g[t],e[t]];return this},abort:function(e){var t=e||S;return n&&n.abort(t),k(0,t),this}};if(y.promise(_),d.url=((e||d.url||kt.href)+"").replace(Ft,kt.protocol+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(F)||[""],null==d.crossDomain){u=b.createElement("a");try{u.href=d.url,u.href=u.href,d.crossDomain=zt.protocol+"//"+zt.host!=u.protocol+"//"+u.host}catch(e){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=x.param(d.data,d.traditional)),Gt(Ut,d,t,_),l)return _;for(f in(c=x.event&&d.global)&&0==x.active++&&x.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Rt.test(d.type),o=d.url.replace(jt,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Dt,"+")):(h=d.url.slice(o.length),d.data&&(d.processData||"string"==typeof d.data)&&(o+=(Ct.test(o)?"&":"?")+d.data,delete d.data),!1===d.cache&&(o=o.replace(Nt,"$1"),h=(Ct.test(o)?"&":"?")+"_="+Mt.guid+++h),d.url=o+h),d.ifModified&&(x.lastModified[o]&&_.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&_.setRequestHeader("If-None-Match",x.etag[o])),(d.data&&d.hasContent&&!1!==d.contentType||t.contentType)&&_.setRequestHeader("Content-Type",d.contentType),_.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Ht+"; q=0.01":""):d.accepts["*"]),d.headers)_.setRequestHeader(f,d.headers[f]);if(d.beforeSend&&(!1===d.beforeSend.call(p,_,d)||l))return _.abort();if(S="abort",v.add(d.complete),_.done(d.success),_.fail(d.error),n=Gt(Bt,d,t,_)){if(_.readyState=1,c&&m.trigger("ajaxSend",[_,d]),l)return _;d.async&&d.timeout>0&&(s=r.setTimeout((function(){_.abort("timeout")}),d.timeout));try{l=!1,n.send(w,k)}catch(e){if(l)throw e;k(-1,e)}}else k(-1,"No Transport");function k(e,t,a,u){var f,h,b,w,E,S=t;l||(l=!0,s&&r.clearTimeout(s),n=void 0,i=u||"",_.readyState=e>0?4:0,f=e>=200&&e<300||304===e,a&&(w=function(e,t,n){for(var r,o,i,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in s)if(s[o]&&s[o].test(r)){u.unshift(o);break}if(u[0]in n)i=u[0];else{for(o in n){if(!u[0]||e.converters[o+" "+u[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==u[0]&&u.unshift(i),n[i]}(d,_,a)),!f&&x.inArray("script",d.dataTypes)>-1&&x.inArray("json",d.dataTypes)<0&&(d.converters["text script"]=function(){}),w=function(e,t,n,r){var o,i,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(i=c.shift();i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=i,i=c.shift())if("*"===i)i=u;else if("*"!==u&&u!==i){if(!(a=l[u+" "+i]||l["* "+i]))for(o in l)if((s=o.split(" "))[1]===i&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[o]:!0!==l[o]&&(i=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+i}}}return{state:"success",data:t}}(d,w,_,f),f?(d.ifModified&&((E=_.getResponseHeader("Last-Modified"))&&(x.lastModified[o]=E),(E=_.getResponseHeader("etag"))&&(x.etag[o]=E)),204===e||"HEAD"===d.type?S="nocontent":304===e?S="notmodified":(S=w.state,h=w.data,f=!(b=w.error))):(b=S,!e&&S||(S="error",e<0&&(e=0))),_.status=e,_.statusText=(t||S)+"",f?y.resolveWith(p,[h,S,_]):y.rejectWith(p,[_,S,b]),_.statusCode(g),g=void 0,c&&m.trigger(f?"ajaxSuccess":"ajaxError",[_,d,f?h:b]),v.fireWith(p,[_,S]),c&&(m.trigger("ajaxComplete",[_,d]),--x.active||x.event.trigger("ajaxStop")))}return _},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,t){return x.get(e,void 0,t,"script")}}),x.each(["get","post"],(function(e,t){x[t]=function(e,n,r,o){return v(n)&&(o=o||r,r=n,n=void 0),x.ajax(x.extend({url:e,type:t,dataType:o,data:n,success:r},x.isPlainObject(e)&&e))}})),x.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),x._evalUrl=function(e,t,n){return x.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){x.globalEval(e,t,n)}})},x.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=x(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v(e)?this.each((function(t){x(this).wrapInner(e.call(this,t))})):this.each((function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v(e);return this.each((function(n){x(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){x(this).replaceWith(this.childNodes)})),this}}),x.expr.pseudos.hidden=function(e){return!x.expr.pseudos.visible(e)},x.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},x.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},Kt=x.ajaxSettings.xhr();y.cors=!!Kt&&"withCredentials"in Kt,y.ajax=Kt=!!Kt,x.ajaxTransport((function(e){var t,n;if(y.cors||Kt&&!e.crossDomain)return{send:function(o,i){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)s.setRequestHeader(a,o[a]);t=function(e){return function(){t&&(t=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?i(0,"error"):i(s.status,s.statusText):i(Wt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),n=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&r.setTimeout((function(){t&&n()}))},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),x.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),x.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,o){t=x(" + + -
- +
+
diff --git a/assets/scripts/EasePack.min.js b/assets/scripts/EasePack.min.js new file mode 100644 index 00000000..59859a46 --- /dev/null +++ b/assets/scripts/EasePack.min.js @@ -0,0 +1,12 @@ +/*! + * VERSION: beta 1.15.2 + * DATE: 2015-01-27 + * UPDATES AND DOCS AT: http://greensock.com + * + * @license Copyright (c) 2008-2015, GreenSock. All rights reserved. + * This work is subject to the terms at http://greensock.com/standard-license or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + **/ +var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("easing.Back",["easing.Ease"],function(t){var e,i,s,r=_gsScope.GreenSockGlobals||_gsScope,n=r.com.greensock,a=2*Math.PI,o=Math.PI/2,h=n._class,l=function(e,i){var s=h("easing."+e,function(){},!0),r=s.prototype=new t;return r.constructor=s,r.getRatio=i,s},_=t.register||function(){},u=function(t,e,i,s){var r=h("easing."+t,{easeOut:new e,easeIn:new i,easeInOut:new s},!0);return _(r,t),r},c=function(t,e,i){this.t=t,this.v=e,i&&(this.next=i,i.prev=this,this.c=i.v-e,this.gap=i.t-t)},p=function(e,i){var s=h("easing."+e,function(t){this._p1=t||0===t?t:1.70158,this._p2=1.525*this._p1},!0),r=s.prototype=new t;return r.constructor=s,r.getRatio=i,r.config=function(t){return new s(t)},s},f=u("Back",p("BackOut",function(t){return(t-=1)*t*((this._p1+1)*t+this._p1)+1}),p("BackIn",function(t){return t*t*((this._p1+1)*t-this._p1)}),p("BackInOut",function(t){return 1>(t*=2)?.5*t*t*((this._p2+1)*t-this._p2):.5*((t-=2)*t*((this._p2+1)*t+this._p2)+2)})),m=h("easing.SlowMo",function(t,e,i){e=e||0===e?e:.7,null==t?t=.7:t>1&&(t=1),this._p=1!==t?e:0,this._p1=(1-t)/2,this._p2=t,this._p3=this._p1+this._p2,this._calcEnd=i===!0},!0),d=m.prototype=new t;return d.constructor=m,d.getRatio=function(t){var e=t+(.5-t)*this._p;return this._p1>t?this._calcEnd?1-(t=1-t/this._p1)*t:e-(t=1-t/this._p1)*t*t*t*e:t>this._p3?this._calcEnd?1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},m.ease=new m(.7,.7),d.config=m.config=function(t,e,i){return new m(t,e,i)},e=h("easing.SteppedEase",function(t){t=t||1,this._p1=1/t,this._p2=t+1},!0),d=e.prototype=new t,d.constructor=e,d.getRatio=function(t){return 0>t?t=0:t>=1&&(t=.999999999),(this._p2*t>>0)*this._p1},d.config=e.config=function(t){return new e(t)},i=h("easing.RoughEase",function(e){e=e||{};for(var i,s,r,n,a,o,h=e.taper||"none",l=[],_=0,u=0|(e.points||20),p=u,f=e.randomize!==!1,m=e.clamp===!0,d=e.template instanceof t?e.template:null,g="number"==typeof e.strength?.4*e.strength:.4;--p>-1;)i=f?Math.random():1/u*p,s=d?d.getRatio(i):i,"none"===h?r=g:"out"===h?(n=1-i,r=n*n*g):"in"===h?r=i*i*g:.5>i?(n=2*i,r=.5*n*n*g):(n=2*(1-i),r=.5*n*n*g),f?s+=Math.random()*r-.5*r:p%2?s+=.5*r:s-=.5*r,m&&(s>1?s=1:0>s&&(s=0)),l[_++]={x:i,y:s};for(l.sort(function(t,e){return t.x-e.x}),o=new c(1,1,null),p=u;--p>-1;)a=l[p],o=new c(a.x,a.y,o);this._prev=new c(0,0,0!==o.t?o:o.next)},!0),d=i.prototype=new t,d.constructor=i,d.getRatio=function(t){var e=this._prev;if(t>e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&e.t>=t;)e=e.prev;return this._prev=e,e.v+(t-e.t)/e.gap*e.c},d.config=function(t){return new i(t)},i.ease=new i,u("Bounce",l("BounceOut",function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),l("BounceIn",function(t){return 1/2.75>(t=1-t)?1-7.5625*t*t:2/2.75>t?1-(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),l("BounceInOut",function(t){var e=.5>t;return t=e?1-2*t:2*t-1,t=1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),u("Circ",l("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),l("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),l("CircInOut",function(t){return 1>(t*=2)?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),s=function(e,i,s){var r=h("easing."+e,function(t,e){this._p1=t>=1?t:1,this._p2=(e||s)/(1>t?t:1),this._p3=this._p2/a*(Math.asin(1/this._p1)||0),this._p2=a/this._p2},!0),n=r.prototype=new t;return n.constructor=r,n.getRatio=i,n.config=function(t,e){return new r(t,e)},r},u("Elastic",s("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*this._p2)+1},.3),s("ElasticIn",function(t){return-(this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2))},.3),s("ElasticInOut",function(t){return 1>(t*=2)?-.5*this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2):.5*this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*this._p2)+1},.45)),u("Expo",l("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),l("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),l("ExpoInOut",function(t){return 1>(t*=2)?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),u("Sine",l("SineOut",function(t){return Math.sin(t*o)}),l("SineIn",function(t){return-Math.cos(t*o)+1}),l("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),h("easing.EaseLookup",{find:function(e){return t.map[e]}},!0),_(r.SlowMo,"SlowMo","ease,"),_(i,"RoughEase","ease,"),_(e,"SteppedEase","ease,"),f},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(); \ No newline at end of file diff --git a/assets/scripts/TweenLite.min.js b/assets/scripts/TweenLite.min.js new file mode 100644 index 00000000..c6164f9c --- /dev/null +++ b/assets/scripts/TweenLite.min.js @@ -0,0 +1,12 @@ +/*! + * VERSION: 1.16.1 + * DATE: 2015-03-13 + * UPDATES AND DOCS AT: http://greensock.com + * + * @license Copyright (c) 2008-2015, GreenSock. All rights reserved. + * This work is subject to the terms at http://greensock.com/standard-license or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + */ +(function(t,e){"use strict";var i=t.GreenSockGlobals=t.GreenSockGlobals||t;if(!i.TweenLite){var s,r,n,a,o,l=function(t){var e,s=t.split("."),r=i;for(e=0;s.length>e;e++)r[s[e]]=r=r[s[e]]||{};return r},h=l("com.greensock"),_=1e-10,u=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},m=function(){},f=function(){var t=Object.prototype.toString,e=t.call([]);return function(i){return null!=i&&(i instanceof Array||"object"==typeof i&&!!i.push&&t.call(i)===e)}}(),c={},p=function(s,r,n,a){this.sc=c[s]?c[s].sc:[],c[s]=this,this.gsClass=null,this.func=n;var o=[];this.check=function(h){for(var _,u,m,f,d=r.length,v=d;--d>-1;)(_=c[r[d]]||new p(r[d],[])).gsClass?(o[d]=_.gsClass,v--):h&&_.sc.push(this);if(0===v&&n)for(u=("com.greensock."+s).split("."),m=u.pop(),f=l(u.join("."))[m]=this.gsClass=n.apply(n,o),a&&(i[m]=f,"function"==typeof define&&define.amd?define((t.GreenSockAMDPath?t.GreenSockAMDPath+"/":"")+s.split(".").pop(),[],function(){return f}):s===e&&"undefined"!=typeof module&&module.exports&&(module.exports=f)),d=0;this.sc.length>d;d++)this.sc[d].check()},this.check(!0)},d=t._gsDefine=function(t,e,i,s){return new p(t,e,i,s)},v=h._class=function(t,e,i){return e=e||function(){},d(t,[],function(){return e},i),e};d.globals=i;var g=[0,0,1,1],T=[],y=v("easing.Ease",function(t,e,i,s){this._func=t,this._type=i||0,this._power=s||0,this._params=e?g.concat(e):g},!0),w=y.map={},P=y.register=function(t,e,i,s){for(var r,n,a,o,l=e.split(","),_=l.length,u=(i||"easeIn,easeOut,easeInOut").split(",");--_>-1;)for(n=l[_],r=s?v("easing."+n,null,!0):h.easing[n]||{},a=u.length;--a>-1;)o=u[a],w[n+"."+o]=w[o+n]=r[o]=t.getRatio?t:t[o]||new t};for(n=y.prototype,n._calcEnd=!1,n.getRatio=function(t){if(this._func)return this._params[0]=t,this._func.apply(null,this._params);var e=this._type,i=this._power,s=1===e?1-t:2===e?t:.5>t?2*t:2*(1-t);return 1===i?s*=s:2===i?s*=s*s:3===i?s*=s*s*s:4===i&&(s*=s*s*s*s),1===e?1-s:2===e?s:.5>t?s/2:1-s/2},s=["Linear","Quad","Cubic","Quart","Quint,Strong"],r=s.length;--r>-1;)n=s[r]+",Power"+r,P(new y(null,null,1,r),n,"easeOut",!0),P(new y(null,null,2,r),n,"easeIn"+(0===r?",easeNone":"")),P(new y(null,null,3,r),n,"easeInOut");w.linear=h.easing.Linear.easeIn,w.swing=h.easing.Quad.easeInOut;var b=v("events.EventDispatcher",function(t){this._listeners={},this._eventTarget=t||this});n=b.prototype,n.addEventListener=function(t,e,i,s,r){r=r||0;var n,l,h=this._listeners[t],_=0;for(null==h&&(this._listeners[t]=h=[]),l=h.length;--l>-1;)n=h[l],n.c===e&&n.s===i?h.splice(l,1):0===_&&r>n.pr&&(_=l+1);h.splice(_,0,{c:e,s:i,up:s,pr:r}),this!==a||o||a.wake()},n.removeEventListener=function(t,e){var i,s=this._listeners[t];if(s)for(i=s.length;--i>-1;)if(s[i].c===e)return s.splice(i,1),void 0},n.dispatchEvent=function(t){var e,i,s,r=this._listeners[t];if(r)for(e=r.length,i=this._eventTarget;--e>-1;)s=r[e],s&&(s.up?s.c.call(s.s||i,{type:t,target:i}):s.c.call(s.s||i))};var k=t.requestAnimationFrame,S=t.cancelAnimationFrame,A=Date.now||function(){return(new Date).getTime()},x=A();for(s=["ms","moz","webkit","o"],r=s.length;--r>-1&&!k;)k=t[s[r]+"RequestAnimationFrame"],S=t[s[r]+"CancelAnimationFrame"]||t[s[r]+"CancelRequestAnimationFrame"];v("Ticker",function(t,e){var i,s,r,n,l,h=this,u=A(),f=e!==!1&&k,c=500,p=33,d="tick",v=function(t){var e,a,o=A()-x;o>c&&(u+=o-p),x+=o,h.time=(x-u)/1e3,e=h.time-l,(!i||e>0||t===!0)&&(h.frame++,l+=e+(e>=n?.004:n-e),a=!0),t!==!0&&(r=s(v)),a&&h.dispatchEvent(d)};b.call(h),h.time=h.frame=0,h.tick=function(){v(!0)},h.lagSmoothing=function(t,e){c=t||1/_,p=Math.min(e,c,0)},h.sleep=function(){null!=r&&(f&&S?S(r):clearTimeout(r),s=m,r=null,h===a&&(o=!1))},h.wake=function(){null!==r?h.sleep():h.frame>10&&(x=A()-c+5),s=0===i?m:f&&k?k:function(t){return setTimeout(t,0|1e3*(l-h.time)+1)},h===a&&(o=!0),v(2)},h.fps=function(t){return arguments.length?(i=t,n=1/(i||60),l=this.time+n,h.wake(),void 0):i},h.useRAF=function(t){return arguments.length?(h.sleep(),f=t,h.fps(i),void 0):f},h.fps(t),setTimeout(function(){f&&5>h.frame&&h.useRAF(!1)},1500)}),n=h.Ticker.prototype=new h.events.EventDispatcher,n.constructor=h.Ticker;var R=v("core.Animation",function(t,e){if(this.vars=e=e||{},this._duration=this._totalDuration=t||0,this._delay=Number(e.delay)||0,this._timeScale=1,this._active=e.immediateRender===!0,this.data=e.data,this._reversed=e.reversed===!0,B){o||a.wake();var i=this.vars.useFrames?q:B;i.add(this,i._time),this.vars.paused&&this.paused(!0)}});a=R.ticker=new h.Ticker,n=R.prototype,n._dirty=n._gc=n._initted=n._paused=!1,n._totalTime=n._time=0,n._rawPrevTime=-1,n._next=n._last=n._onUpdate=n._timeline=n.timeline=null,n._paused=!1;var C=function(){o&&A()-x>2e3&&a.wake(),setTimeout(C,2e3)};C(),n.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},n.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},n.resume=function(t,e){return null!=t&&this.seek(t,e),this.paused(!1)},n.seek=function(t,e){return this.totalTime(Number(t),e!==!1)},n.restart=function(t,e){return this.reversed(!1).paused(!1).totalTime(t?-this._delay:0,e!==!1,!0)},n.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},n.render=function(){},n.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,(this._gc||!this.timeline)&&this._enabled(!0),this},n.isActive=function(){var t,e=this._timeline,i=this._startTime;return!e||!this._gc&&!this._paused&&e.isActive()&&(t=e.rawTime())>=i&&i+this.totalDuration()/this._timeScale>t},n._enabled=function(t,e){return o||a.wake(),this._gc=!t,this._active=this.isActive(),e!==!0&&(t&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!t&&this.timeline&&this._timeline._remove(this,!0)),!1},n._kill=function(){return this._enabled(!1,!1)},n.kill=function(t,e){return this._kill(t,e),this},n._uncache=function(t){for(var e=t?this:this.timeline;e;)e._dirty=!0,e=e.timeline;return this},n._swapSelfInParams=function(t){for(var e=t.length,i=t.concat();--e>-1;)"{self}"===t[e]&&(i[e]=this);return i},n.eventCallback=function(t,e,i,s){if("on"===(t||"").substr(0,2)){var r=this.vars;if(1===arguments.length)return r[t];null==e?delete r[t]:(r[t]=e,r[t+"Params"]=f(i)&&-1!==i.join("").indexOf("{self}")?this._swapSelfInParams(i):i,r[t+"Scope"]=s),"onUpdate"===t&&(this._onUpdate=e)}return this},n.delay=function(t){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+t-this._delay),this._delay=t,this):this._delay},n.duration=function(t){return arguments.length?(this._duration=this._totalDuration=t,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._timethis._duration?this._duration:t,e)):this._time},n.totalTime=function(t,e,i){if(o||a.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(0>t&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var s=this._totalDuration,r=this._timeline;if(t>s&&!i&&(t=s),this._startTime=(this._paused?this._pauseTime:r._time)-(this._reversed?s-t:t)/this._timeScale,r._dirty||this._uncache(!1),r._timeline)for(;r._timeline;)r._timeline._time!==(r._startTime+r._totalTime)/r._timeScale&&r.totalTime(r._totalTime,!0),r=r._timeline}this._gc&&this._enabled(!0,!1),(this._totalTime!==t||0===this._duration)&&(this.render(t,e,!1),z.length&&$())}return this},n.progress=n.totalProgress=function(t,e){return arguments.length?this.totalTime(this.duration()*t,e):this._time/this.duration()},n.startTime=function(t){return arguments.length?(t!==this._startTime&&(this._startTime=t,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,t-this._delay)),this):this._startTime},n.endTime=function(t){return this._startTime+(0!=t?this.totalDuration():this.duration())/this._timeScale},n.timeScale=function(t){if(!arguments.length)return this._timeScale;if(t=t||_,this._timeline&&this._timeline.smoothChildTiming){var e=this._pauseTime,i=e||0===e?e:this._timeline.totalTime();this._startTime=i-(i-this._startTime)*this._timeScale/t}return this._timeScale=t,this._uncache(!1)},n.reversed=function(t){return arguments.length?(t!=this._reversed&&(this._reversed=t,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},n.paused=function(t){if(!arguments.length)return this._paused;var e,i,s=this._timeline;return t!=this._paused&&s&&(o||t||a.wake(),e=s.rawTime(),i=e-this._pauseTime,!t&&s.smoothChildTiming&&(this._startTime+=i,this._uncache(!1)),this._pauseTime=t?e:null,this._paused=t,this._active=this.isActive(),!t&&0!==i&&this._initted&&this.duration()&&this.render(s.smoothChildTiming?this._totalTime:(e-this._startTime)/this._timeScale,!0,!0)),this._gc&&!t&&this._enabled(!0,!1),this};var D=v("core.SimpleTimeline",function(t){R.call(this,0,t),this.autoRemoveChildren=this.smoothChildTiming=!0});n=D.prototype=new R,n.constructor=D,n.kill()._gc=!1,n._first=n._last=n._recent=null,n._sortChildren=!1,n.add=n.insert=function(t,e){var i,s;if(t._startTime=Number(e||0)+t._delay,t._paused&&this!==t._timeline&&(t._pauseTime=t._startTime+(this.rawTime()-t._startTime)/t._timeScale),t.timeline&&t.timeline._remove(t,!0),t.timeline=t._timeline=this,t._gc&&t._enabled(!0,!0),i=this._last,this._sortChildren)for(s=t._startTime;i&&i._startTime>s;)i=i._prev;return i?(t._next=i._next,i._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=i,this._recent=t,this._timeline&&this._uncache(!0),this},n._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(t,e,i){var s,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;r;)s=r._next,(r._active||t>=r._startTime&&!r._paused)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=s},n.rawTime=function(){return o||a.wake(),this._totalTime};var I=v("TweenLite",function(e,i,s){if(R.call(this,i,s),this.render=I.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:I.selector(e)||e;var r,n,a,o=e.jquery||e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType),l=this.vars.overwrite;if(this._overwrite=l=null==l?Q[I.defaultOverwrite]:"number"==typeof l?l>>0:Q[l],(o||e instanceof Array||e.push&&f(e))&&"number"!=typeof e[0])for(this._targets=a=u(e),this._propLookup=[],this._siblings=[],r=0;a.length>r;r++)n=a[r],n?"string"!=typeof n?n.length&&n!==t&&n[0]&&(n[0]===t||n[0].nodeType&&n[0].style&&!n.nodeType)?(a.splice(r--,1),this._targets=a=a.concat(u(n))):(this._siblings[r]=K(n,this,!1),1===l&&this._siblings[r].length>1&&J(n,this,null,1,this._siblings[r])):(n=a[r--]=I.selector(n),"string"==typeof n&&a.splice(r+1,1)):a.splice(r--,1);else this._propLookup={},this._siblings=K(e,this,!1),1===l&&this._siblings.length>1&&J(e,this,null,1,this._siblings);(this.vars.immediateRender||0===i&&0===this._delay&&this.vars.immediateRender!==!1)&&(this._time=-_,this.render(-this._delay))},!0),E=function(e){return e&&e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType)},O=function(t,e){var i,s={};for(i in t)G[i]||i in e&&"transform"!==i&&"x"!==i&&"y"!==i&&"width"!==i&&"height"!==i&&"className"!==i&&"border"!==i||!(!U[i]||U[i]&&U[i]._autoCSS)||(s[i]=t[i],delete t[i]);t.css=s};n=I.prototype=new R,n.constructor=I,n.kill()._gc=!1,n.ratio=0,n._firstPT=n._targets=n._overwrittenProps=n._startAt=null,n._notifyPluginsOfEnabled=n._lazy=!1,I.version="1.16.1",I.defaultEase=n._ease=new y(null,null,1,1),I.defaultOverwrite="auto",I.ticker=a,I.autoSleep=120,I.lagSmoothing=function(t,e){a.lagSmoothing(t,e)},I.selector=t.$||t.jQuery||function(e){var i=t.$||t.jQuery;return i?(I.selector=i,i(e)):"undefined"==typeof document?e:document.querySelectorAll?document.querySelectorAll(e):document.getElementById("#"===e.charAt(0)?e.substr(1):e)};var z=[],L={},N=I._internals={isArray:f,isSelector:E,lazyTweens:z},U=I._plugins={},F=N.tweenLookup={},j=0,G=N.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1},Q={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,"true":1,"false":0},q=R._rootFramesTimeline=new D,B=R._rootTimeline=new D,M=30,$=N.lazyRender=function(){var t,e=z.length;for(L={};--e>-1;)t=z[e],t&&t._lazy!==!1&&(t.render(t._lazy[0],t._lazy[1],!0),t._lazy=!1);z.length=0};B._startTime=a.time,q._startTime=a.frame,B._active=q._active=!0,setTimeout($,1),R._updateRoot=I.render=function(){var t,e,i;if(z.length&&$(),B.render((a.time-B._startTime)*B._timeScale,!1,!1),q.render((a.frame-q._startTime)*q._timeScale,!1,!1),z.length&&$(),a.frame>=M){M=a.frame+(parseInt(I.autoSleep,10)||120);for(i in F){for(e=F[i].tweens,t=e.length;--t>-1;)e[t]._gc&&e.splice(t,1);0===e.length&&delete F[i]}if(i=B._first,(!i||i._paused)&&I.autoSleep&&!q._first&&1===a._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||a.sleep()}}},a.addEventListener("tick",R._updateRoot);var K=function(t,e,i){var s,r,n=t._gsTweenID;if(F[n||(t._gsTweenID=n="t"+j++)]||(F[n]={target:t,tweens:[]}),e&&(s=F[n].tweens,s[r=s.length]=e,i))for(;--r>-1;)s[r]===e&&s.splice(r,1);return F[n].tweens},H=function(t,e,i,s){var r,n,a=t.vars.onOverwrite;return a&&(r=a(t,e,i,s)),a=I.onOverwrite,a&&(n=a(t,e,i,s)),r!==!1&&n!==!1},J=function(t,e,i,s,r){var n,a,o,l;if(1===s||s>=4){for(l=r.length,n=0;l>n;n++)if((o=r[n])!==e)o._gc||H(o,e)&&o._enabled(!1,!1)&&(a=!0);else if(5===s)break;return a}var h,u=e._startTime+_,m=[],f=0,c=0===e._duration;for(n=r.length;--n>-1;)(o=r[n])===e||o._gc||o._paused||(o._timeline!==e._timeline?(h=h||V(e,0,c),0===V(o,h,c)&&(m[f++]=o)):u>=o._startTime&&o._startTime+o.totalDuration()/o._timeScale>u&&((c||!o._initted)&&2e-10>=u-o._startTime||(m[f++]=o)));for(n=f;--n>-1;)if(o=m[n],2===s&&o._kill(i,t,e)&&(a=!0),2!==s||!o._firstPT&&o._initted){if(2!==s&&!H(o,e))continue;o._enabled(!1,!1)&&(a=!0)}return a},V=function(t,e,i){for(var s=t._timeline,r=s._timeScale,n=t._startTime;s._timeline;){if(n+=s._startTime,r*=s._timeScale,s._paused)return-100;s=s._timeline}return n/=r,n>e?n-e:i&&n===e||!t._initted&&2*_>n-e?_:(n+=t.totalDuration()/t._timeScale/r)>e+_?0:n-e-_};n._init=function(){var t,e,i,s,r,n=this.vars,a=this._overwrittenProps,o=this._duration,l=!!n.immediateRender,h=n.ease;if(n.startAt){this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),r={};for(s in n.startAt)r[s]=n.startAt[s];if(r.overwrite=!1,r.immediateRender=!0,r.lazy=l&&n.lazy!==!1,r.startAt=r.delay=null,this._startAt=I.to(this.target,0,r),l)if(this._time>0)this._startAt=null;else if(0!==o)return}else if(n.runBackwards&&0!==o)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{0!==this._time&&(l=!1),i={};for(s in n)G[s]&&"autoCSS"!==s||(i[s]=n[s]);if(i.overwrite=0,i.data="isFromStart",i.lazy=l&&n.lazy!==!1,i.immediateRender=l,this._startAt=I.to(this.target,0,i),l){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=h=h?h instanceof y?h:"function"==typeof h?new y(h,n.easeParams):w[h]||I.defaultEase:I.defaultEase,n.easeParams instanceof Array&&h.config&&(this._ease=h.config.apply(h,n.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(t=this._targets.length;--t>-1;)this._initProps(this._targets[t],this._propLookup[t]={},this._siblings[t],a?a[t]:null)&&(e=!0);else e=this._initProps(this.target,this._propLookup,this._siblings,a);if(e&&I._onPluginEvent("_onInitAllProps",this),a&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),n.runBackwards)for(i=this._firstPT;i;)i.s+=i.c,i.c=-i.c,i=i._next;this._onUpdate=n.onUpdate,this._initted=!0},n._initProps=function(e,i,s,r){var n,a,o,l,h,_;if(null==e)return!1;L[e._gsTweenID]&&$(),this.vars.css||e.style&&e!==t&&e.nodeType&&U.css&&this.vars.autoCSS!==!1&&O(this.vars,e);for(n in this.vars){if(_=this.vars[n],G[n])_&&(_ instanceof Array||_.push&&f(_))&&-1!==_.join("").indexOf("{self}")&&(this.vars[n]=_=this._swapSelfInParams(_,this));else if(U[n]&&(l=new U[n])._onInitTween(e,this.vars[n],this)){for(this._firstPT=h={_next:this._firstPT,t:l,p:"setRatio",s:0,c:1,f:!0,n:n,pg:!0,pr:l._priority},a=l._overwriteProps.length;--a>-1;)i[l._overwriteProps[a]]=this._firstPT;(l._priority||l._onInitAllProps)&&(o=!0),(l._onDisable||l._onEnable)&&(this._notifyPluginsOfEnabled=!0)}else this._firstPT=i[n]=h={_next:this._firstPT,t:e,p:n,f:"function"==typeof e[n],n:n,pg:!1,pr:0},h.s=h.f?e[n.indexOf("set")||"function"!=typeof e["get"+n.substr(3)]?n:"get"+n.substr(3)]():parseFloat(e[n]),h.c="string"==typeof _&&"="===_.charAt(1)?parseInt(_.charAt(0)+"1",10)*Number(_.substr(2)):Number(_)-h.s||0;h&&h._next&&(h._next._prev=h)}return r&&this._kill(r,e)?this._initProps(e,i,s,r):this._overwrite>1&&this._firstPT&&s.length>1&&J(e,this,i,this._overwrite,s)?(this._kill(i,e),this._initProps(e,i,s,r)):(this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration)&&(L[e._gsTweenID]=!0),o)},n.render=function(t,e,i){var s,r,n,a,o=this._time,l=this._duration,h=this._rawPrevTime;if(t>=l)this._totalTime=this._time=l,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(s=!0,r="onComplete",i=i||this._timeline.autoRemoveChildren),0===l&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0===t||0>h||h===_&&"isPause"!==this.data)&&h!==t&&(i=!0,h>_&&(r="onReverseComplete")),this._rawPrevTime=a=!e||t||h===t?t:_);else if(1e-7>t)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==o||0===l&&h>0)&&(r="onReverseComplete",s=this._reversed),0>t&&(this._active=!1,0===l&&(this._initted||!this.vars.lazy||i)&&(h>=0&&(h!==_||"isPause"!==this.data)&&(i=!0),this._rawPrevTime=a=!e||t||h===t?t:_)),this._initted||(i=!0);else if(this._totalTime=this._time=t,this._easeType){var u=t/l,m=this._easeType,f=this._easePower;(1===m||3===m&&u>=.5)&&(u=1-u),3===m&&(u*=2),1===f?u*=u:2===f?u*=u*u:3===f?u*=u*u*u:4===f&&(u*=u*u*u*u),this.ratio=1===m?1-u:2===m?u:.5>t/l?u/2:1-u/2}else this.ratio=this._ease.getRatio(t/l);if(this._time!==o||i){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=o,this._rawPrevTime=h,z.push(this),this._lazy=[t,e],void 0;this._time&&!s?this.ratio=this._ease.getRatio(this._time/l):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==o&&t>=0&&(this._active=!0),0===o&&(this._startAt&&(t>=0?this._startAt.render(t,e,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._time||0===l)&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||T))),n=this._firstPT;n;)n.f?n.t[n.p](n.c*this.ratio+n.s):n.t[n.p]=n.c*this.ratio+n.s,n=n._next;this._onUpdate&&(0>t&&this._startAt&&t!==-1e-4&&this._startAt.render(t,e,i),e||(this._time!==o||s)&&this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||T)),r&&(!this._gc||i)&&(0>t&&this._startAt&&!this._onUpdate&&t!==-1e-4&&this._startAt.render(t,e,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this.vars[r].apply(this.vars[r+"Scope"]||this,this.vars[r+"Params"]||T),0===l&&this._rawPrevTime===_&&a!==_&&(this._rawPrevTime=0))}},n._kill=function(t,e,i){if("all"===t&&(t=null),null==t&&(null==e||e===this.target))return this._lazy=!1,this._enabled(!1,!1);e="string"!=typeof e?e||this._targets||this.target:I.selector(e)||e;var s,r,n,a,o,l,h,_,u;if((f(e)||E(e))&&"number"!=typeof e[0])for(s=e.length;--s>-1;)this._kill(t,e[s])&&(l=!0);else{if(this._targets){for(s=this._targets.length;--s>-1;)if(e===this._targets[s]){o=this._propLookup[s]||{},this._overwrittenProps=this._overwrittenProps||[],r=this._overwrittenProps[s]=t?this._overwrittenProps[s]||{}:"all";break}}else{if(e!==this.target)return!1;o=this._propLookup,r=this._overwrittenProps=t?this._overwrittenProps||{}:"all"}if(o){if(h=t||o,_=t!==r&&"all"!==r&&t!==o&&("object"!=typeof t||!t._tempKill),i&&(I.onOverwrite||this.vars.onOverwrite)){for(n in h)o[n]&&(u||(u=[]),u.push(n));if(!H(this,i,e,u))return!1}for(n in h)(a=o[n])&&(a.pg&&a.t._kill(h)&&(l=!0),a.pg&&0!==a.t._overwriteProps.length||(a._prev?a._prev._next=a._next:a===this._firstPT&&(this._firstPT=a._next),a._next&&(a._next._prev=a._prev),a._next=a._prev=null),delete o[n]),_&&(r[n]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return l},n.invalidate=function(){return this._notifyPluginsOfEnabled&&I._onPluginEvent("_onDisable",this),this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],R.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-_,this.render(-this._delay)),this},n._enabled=function(t,e){if(o||a.wake(),t&&this._gc){var i,s=this._targets;if(s)for(i=s.length;--i>-1;)this._siblings[i]=K(s[i],this,!0);else this._siblings=K(this.target,this,!0)}return R.prototype._enabled.call(this,t,e),this._notifyPluginsOfEnabled&&this._firstPT?I._onPluginEvent(t?"_onEnable":"_onDisable",this):!1},I.to=function(t,e,i){return new I(t,e,i)},I.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new I(t,e,i)},I.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new I(t,e,s)},I.delayedCall=function(t,e,i,s,r){return new I(e,0,{delay:t,onComplete:e,onCompleteParams:i,onCompleteScope:s,onReverseComplete:e,onReverseCompleteParams:i,onReverseCompleteScope:s,immediateRender:!1,lazy:!1,useFrames:r,overwrite:0})},I.set=function(t,e){return new I(t,0,e)},I.getTweensOf=function(t,e){if(null==t)return[];t="string"!=typeof t?t:I.selector(t)||t;var i,s,r,n;if((f(t)||E(t))&&"number"!=typeof t[0]){for(i=t.length,s=[];--i>-1;)s=s.concat(I.getTweensOf(t[i],e));for(i=s.length;--i>-1;)for(n=s[i],r=i;--r>-1;)n===s[r]&&s.splice(i,1)}else for(s=K(t).concat(),i=s.length;--i>-1;)(s[i]._gc||e&&!s[i].isActive())&&s.splice(i,1);return s},I.killTweensOf=I.killDelayedCallsTo=function(t,e,i){"object"==typeof e&&(i=e,e=!1);for(var s=I.getTweensOf(t,e),r=s.length;--r>-1;)s[r]._kill(i,t)};var W=v("plugins.TweenPlugin",function(t,e){this._overwriteProps=(t||"").split(","),this._propName=this._overwriteProps[0],this._priority=e||0,this._super=W.prototype},!0);if(n=W.prototype,W.version="1.10.1",W.API=2,n._firstPT=null,n._addTween=function(t,e,i,s,r,n){var a,o;return null!=s&&(a="number"==typeof s||"="!==s.charAt(1)?Number(s)-i:parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)))?(this._firstPT=o={_next:this._firstPT,t:t,p:e,s:i,c:a,f:"function"==typeof t[e],n:r||e,r:n},o._next&&(o._next._prev=o),o):void 0},n.setRatio=function(t){for(var e,i=this._firstPT,s=1e-6;i;)e=i.c*t+i.s,i.r?e=Math.round(e):s>e&&e>-s&&(e=0),i.f?i.t[i.p](e):i.t[i.p]=e,i=i._next},n._kill=function(t){var e,i=this._overwriteProps,s=this._firstPT;if(null!=t[this._propName])this._overwriteProps=[];else for(e=i.length;--e>-1;)null!=t[i[e]]&&i.splice(e,1);for(;s;)null!=t[s.n]&&(s._next&&(s._next._prev=s._prev),s._prev?(s._prev._next=s._next,s._prev=null):this._firstPT===s&&(this._firstPT=s._next)),s=s._next;return!1},n._roundProps=function(t,e){for(var i=this._firstPT;i;)(t[this._propName]||null!=i.n&&t[i.n.split(this._propName+"_").join("")])&&(i.r=e),i=i._next},I._onPluginEvent=function(t,e){var i,s,r,n,a,o=e._firstPT;if("_onInitAllProps"===t){for(;o;){for(a=o._next,s=r;s&&s.pr>o.pr;)s=s._next;(o._prev=s?s._prev:n)?o._prev._next=o:r=o,(o._next=s)?s._prev=o:n=o,o=a}o=e._firstPT=r}for(;o;)o.pg&&"function"==typeof o.t[t]&&o.t[t]()&&(i=!0),o=o._next;return i},W.activate=function(t){for(var e=t.length;--e>-1;)t[e].API===W.API&&(U[(new t[e])._propName]=t[e]);return!0},d.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,s=t.priority||0,r=t.overwriteProps,n={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_roundProps",initAll:"_onInitAllProps"},a=v("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){W.call(this,i,s),this._overwriteProps=r||[]},t.global===!0),o=a.prototype=new W(i);o.constructor=a,a.API=t.API;for(e in n)"function"==typeof t[e]&&(o[n[e]]=t[e]);return a.version=t.version,W.activate([a]),a},s=t._gsQueue){for(r=0;s.length>r;r++)s[r]();for(n in c)c[n].func||t.console.log("GSAP encountered missing dependency: com.greensock."+n)}o=!1}})("undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,"TweenLite"); \ No newline at end of file diff --git a/assets/scripts/animation.js b/assets/scripts/animation.js new file mode 100644 index 00000000..05a16ba2 --- /dev/null +++ b/assets/scripts/animation.js @@ -0,0 +1,183 @@ +// TODO: generalize +(function () { + let width, height, container, canvas, ctx, points, target, animateHeader = true; + + // Core Flow + initHeader(); + initAnimation(); + addListeners(); + + // Functions + function initHeader () { + width = window.innerWidth; + height = window.innerHeight; + target = { + x: width / 2, + y: height / 2 + }; + + container = document.querySelector('.fabric-site.body'); + console.debug('container:', container); + + container.style.height = height + 'px'; + canvas = document.getElementById('video-background'); + canvas.width = width; + canvas.height = height; + ctx = canvas.getContext('2d'); + points = []; + + for (let x = 0; x < width; x = x + width / 20) { + for (let y = 0; y < height; y = y + height / 20) { + let px = x + Math.random() * width / 20; + let py = y + Math.random() * height / 20; + let p = { + x: px, + originX: px, + y: py, + originY: py + }; + points.push(p); + } + } + for (let i = 0; i < points.length; i++) { + let closest = []; + let p1 = points[i]; + + for (let j = 0; j < points.length; j++) { + let p2 = points[j] + if (!(p1 == p2)) { + let placed = false; + for (let k = 0; k < 5; k++) { + if (!placed) { + if (closest[k] == undefined) { + closest[k] = p2; + placed = true; + } + } + } + for (let k = 0; k < 5; k++) { + if (!placed) { + if (getDistance(p1, p2) < getDistance(p1, closest[k])) { + closest[k] = p2; + placed = true; + } + } + } + } + } + p1.closest = closest; + } + for (let i in points) { + let c = new Circle(points[i], 2 + Math.random() * 2.1, 'rgba(255, 255, 255, 0.3)'); + points[i].circle = c; + } + } + + function addListeners () { + if (!('ontouchstart' in window)) window.addEventListener('mousemove', mouseMove); + window.addEventListener('scroll', scrollCheck); + window.addEventListener('resize', resize); + } + + function mouseMove (e) { + let posx = posy = 0; + + if (e.pageX || e.pageY) { + posx = e.pageX; + posy = e.pageY - document.body.scrollTop; + } else if (e.clientX || e.clientY) { + posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; + posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; + } + + target.x = posx; + target.y = posy; + } + + function scrollCheck () { + /* if (document.body.scrollTop > height) animateHeader = false; + else animateHeader = true; */ + animateHeader = true; + } + + function resize () { + width = window.innerWidth; + height = window.innerHeight; + container.style.height = height + 'px'; + canvas.width = width; + canvas.height = height; + } + + function initAnimation () { + animate(); + for (let i in points) { + shiftPoint(points[i]); + } + } + + function animate () { + if (animateHeader) { + ctx.clearRect(0, 0, width, height); + for (let i in points) { + if (Math.abs(getDistance(target, points[i])) < 4000) { + points[i].active = 0.3; + points[i].circle.active = 0.6; + } else if (Math.abs(getDistance(target, points[i])) < 20000) { + points[i].active = 0.1; + points[i].circle.active = 0.3; + } else if (Math.abs(getDistance(target, points[i])) < 40000) { + points[i].active = 0.02; + points[i].circle.active = 0.1; + } else { + points[i].active = 0; + points[i].circle.active = 0; + } + drawLines(points[i]); + points[i].circle.draw(); + } + } + requestAnimationFrame(animate); + } + + function shiftPoint (p) { + TweenLite.to(p, 1 + 1 * Math.random(), { + x: p.originX - 50 + Math.random() * 100, + y: p.originY - 50 + Math.random() * 100, + ease: Circ.easeInOut, + onComplete: function() { + shiftPoint(p); + } + }); + } + + function drawLines (p) { + if (!p.active) return; + for (let i in p.closest) { + ctx.beginPath(); + ctx.moveTo(p.x, p.y); + ctx.lineTo(p.closest[i].x, p.closest[i].y); + ctx.strokeStyle = 'rgba(156, 217, 249, ' + p.active + ')'; + ctx.stroke(); + } + } + + function Circle (pos, rad, color) { + let _this = this; + (function() { + _this.pos = pos || null; + _this.radius = rad || null; + _this.color = color || null; + })(); + this.draw = function() { + if (!_this.active) return; + ctx.beginPath(); + ctx.arc(_this.pos.x, _this.pos.y, _this.radius, 0, 2 * Math.PI, false); + ctx.fillStyle = 'rgba(156, 217, 249, ' + _this.active + ')'; + ctx.fill(); + }; + } + + function getDistance (p1, p2) { + return Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2); + } +})(); diff --git a/assets/styles/screen.css b/assets/styles/screen.css index e4814567..4b1f60b3 100644 --- a/assets/styles/screen.css +++ b/assets/styles/screen.css @@ -160,7 +160,6 @@ } /* HELP CHAT CSS */ - #help-box { position: fixed; bottom: 80px; @@ -815,33 +814,12 @@ fabric-motd { .settings-container { margin-top: 2em; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - align-content: center; } .settings-container .ui.table { width: 40%; } -.subscription-container { - margin-top: 1em; - display: flex; - flex-wrap: wrap; - flex-direction: row; - align-items: center; - justify-content: center; - gap: 2em; -} - -.subscription-container div { - padding-right: 2em; - padding-left: 2em; - -} - .ui.card.info-file-card { margin-top: 3em !important; } @@ -1035,10 +1013,25 @@ fabric-motd { width: '100%'; } +.brand span.brand { + font-size: 1.5em; +} + .splash-page .buttons { margin-top: 2em; } -.splash-page section { +.splash-page section:not(.lead) { + font-size: 1.1em; margin-bottom: 4em; + clear: both; +} + +.ui.video.background { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + pointer-events: none; } diff --git a/components/AdminSettingsUsers.js b/components/AdminSettingsUsers.js index 2b77480b..b2587a4e 100644 --- a/components/AdminSettingsUsers.js +++ b/components/AdminSettingsUsers.js @@ -89,7 +89,7 @@ class AdminUsers extends React.Component { } renderConfirmResetModal = () => { - const { users } = this.props; + const { accounts, users } = this.props; const { confirmResetOpen, emailReseting } = this.state; return ( @@ -181,7 +181,7 @@ class AdminUsers extends React.Component { - {users && users.users && users.users + {accounts && accounts.users && accounts.users .filter(instance => (instance.email ? (instance.email.toLowerCase().includes(searchQuery.toLowerCase())) : (searchQuery ? false : true)) || (instance.username.toLowerCase().includes(searchQuery.toLowerCase())) diff --git a/components/Changelog.js b/components/Changelog.js index 432a70e8..15150596 100644 --- a/components/Changelog.js +++ b/components/Changelog.js @@ -22,7 +22,7 @@ class Changelog extends React.Component { }; return ( -
+

The Changelog

Stay up-to-date with the latest changes.

Announcements

@@ -55,7 +55,8 @@ class Changelog extends React.Component { {/* TODO: populate from GitHub releases */}

Releases

    -
  • 1.0.0-RC1: Exclusive access!
  • +
  • 0.2.0-RC2: Improved support for tasking, simplified UI, reduced attack surface.
  • +
  • 0.2.0-RC1: Exclusive access!
); diff --git a/components/ChatBox.js b/components/ChatBox.js index f13aa7aa..f74ed36c 100644 --- a/components/ChatBox.js +++ b/components/ChatBox.js @@ -82,17 +82,18 @@ class ChatBox extends React.Component { if (this.props.conversationID) { this.startPolling(this.props.conversationID); } + window.addEventListener('resize', this.handleResize); } componentDidUpdate (prevProps, prevState) { const { messages } = this.props.chat; - //here we store the last message from prevProps and current messages const prevLastMessage = prevProps.chat.messages[prevProps.chat.messages.length - 1]; const currentLastMessage = messages[messages.length - 1]; if (this.props.conversationID) if (this.props.conversationID !== prevProps.conversationID) { + // TODO: when available, use WebSocket instead of polling this.stopPolling(); this.startPolling(this.props.conversationID); } @@ -110,11 +111,9 @@ class ChatBox extends React.Component { this.setState({ generatingResponse: false }); this.setState({ reGeneratingResponse: false }); this.props.getMessageInformation(lastMessage.content); - } else { //this is to add generating reponse after an user submitted message but not when you are in a historic conversation with last message from user this.setState({ generatingResponse: true }); - // if (!this.props.previousChat || (this.state.previousFlag && this.props.previousChat)) { // this.setState({ generatingResponse: true }); // } @@ -122,7 +121,6 @@ class ChatBox extends React.Component { } this.scrollToBottom(); } - } componentWillUnmount () { @@ -246,13 +244,10 @@ class ChatBox extends React.Component { } } - const fileFabricID = documentChat ? (this.props.documentInfo ? this.props.documentInfo.fabric_id : null) : null; + console.debug('submitting:', message); + // dispatch submitMessage - this.props.submitMessage( - dataToSubmit, - null, - fileFabricID - ).then((output) => { + this.props.submitMessage(dataToSubmit).then((output) => { // dispatch getMessages this.props.getMessages({ conversation_id: message?.conversation }); @@ -750,7 +745,7 @@ class ChatBox extends React.Component { } /> {/* the regenerate answer button only shows in the last answer */} - {group === this.state.groupedMessages[this.state.groupedMessages.length - 1] && + {/* group === this.state.groupedMessages[this.state.groupedMessages.length - 1] && message.role === "assistant" && !reGeneratingResponse && !generatingResponse && ( } /> - )} + ) */} {message.role === "assistant" && ( {this.props.includeAttachments && ( - diff --git a/components/Dashboard.js b/components/Dashboard.js index 642e90ca..4e39855b 100644 --- a/components/Dashboard.js +++ b/components/Dashboard.js @@ -43,6 +43,7 @@ const { ENABLE_CHANGELOG, ENABLE_DOCUMENTS, ENABLE_FEEDBACK_BUTTON, + ENABLE_GROUPS, ENABLE_NETWORK, ENABLE_SOURCES, ENABLE_TASKS, @@ -55,6 +56,8 @@ const { // Components const Home = require('./Home'); const ContractHome = require('./ContractHome'); +const GroupHome = require('./GroupHome'); +const GroupView = require('./GroupView'); const NetworkHome = require('./NetworkHome'); const Library = require('./Library'); const DocumentHome = require('./DocumentHome'); @@ -81,6 +84,7 @@ const HelpBox = require('./HelpBox'); // Fabric Bridge const Bridge = require('./Bridge'); +const FeaturesHome = require('./FeaturesHome.js'); /** * The main dashboard component. @@ -536,6 +540,12 @@ class Dashboard extends React.Component {

Network

)} + {ENABLE_GROUPS && (USER_IS_ALPHA || USER_IS_ADMIN) && ( + + +

Groups

+
+ )} {ENABLE_SOURCES && USER_IS_ADMIN && ( @@ -668,36 +678,38 @@ class Dashboard extends React.Component { /> } /> } /> - } /> - } uploadDocument={this.props.uploadDocument} /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> + } /> + } uploadDocument={this.props.uploadDocument} /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> {/* TODO: fix these routes */} {/* /settings/admin should render the overview */} {/* /settings/admin#users should load the user tab */} - this.setState({ helpConversationUpdate: 0 })} />} /> - this.setState({ helpConversationUpdate: 0 })} />} /> - this.setState({ helpConversationUpdate: 0 })} />} /> - this.setState({ helpConversationUpdate: 0 })} />} /> - this.setState({ helpConversationUpdate: 0 })} />} /> - this.setState({ helpConversationUpdate: 0 })} />} /> - this.setState({ helpConversationUpdate: 0 })} />} /> - this.setState({ helpConversationUpdate: 0 })} />} /> + this.setState({ helpConversationUpdate: 0 })} />} /> + this.setState({ helpConversationUpdate: 0 })} />} /> + this.setState({ helpConversationUpdate: 0 })} />} /> + this.setState({ helpConversationUpdate: 0 })} />} /> + this.setState({ helpConversationUpdate: 0 })} />} /> + this.setState({ helpConversationUpdate: 0 })} />} /> + this.setState({ helpConversationUpdate: 0 })} />} /> + this.setState({ helpConversationUpdate: 0 })} />} /> {/* END TODO */} - this.setState({ helpConversationUpdate: 0 })} />} /> - } /> - } /> - } /> - } /> - } /> + this.setState({ helpConversationUpdate: 0 })} />} /> + } /> + } /> + } /> + } /> + } /> )} diff --git a/components/DocumentHome.js b/components/DocumentHome.js index 44a2f6ba..4360a1a9 100644 --- a/components/DocumentHome.js +++ b/components/DocumentHome.js @@ -77,6 +77,7 @@ class DocumentHome extends React.Component {

Library

+
diff --git a/components/FeaturesHome.js b/components/FeaturesHome.js new file mode 100644 index 00000000..ff27d3fc --- /dev/null +++ b/components/FeaturesHome.js @@ -0,0 +1,47 @@ +'use strict'; + +const React = require('react'); + +const { + Header, + Segment +} = require('semantic-ui-react'); + +const HeaderBar = require('./HeaderBar'); + +class FeaturesHome extends React.Component { + constructor (props) { + super(props); + } + + render () { + return ( + + + +
Features
+

+

+
+
Local Intelligence
+

Keep your data local, manage your costs, and ensure reliability with Sensemaker's offline-first design.

+
+
+
Network Analysis
+

Consume data streams from a variety of sources, including a robust peer-to-peer network of other users.

+
+
+
Earn for Insights
+

Get rewarded for valuable contributions to the network.

+
+
+
+ ); + } + + toHTML () { + + } +} + +module.exports = FeaturesHome; diff --git a/components/FrontPage.js b/components/FrontPage.js index cdac0f2b..d742b5f6 100644 --- a/components/FrontPage.js +++ b/components/FrontPage.js @@ -8,6 +8,7 @@ const { Link } = require('react-router-dom'); // Semantic UI const { Button, + Card, Icon, Header } = require('semantic-ui-react'); @@ -41,7 +42,7 @@ class FrontPage extends React.Component { return ( -
+
{BRAND_NAME}

{BRAND_TAGLINE}

{PITCH_CTA_TEXT}

@@ -51,6 +52,35 @@ class FrontPage extends React.Component {
+ {/* +
+ + + Local Intelligence + +

Sensemaker's offline-first design ensures reliability under adversarial conditions.

+ +
+
+
+ + + Global Awareness + +

Robust connectivity with a variety of networks empowers Sensemaker with real-time analytics and powerful data visualizations.

+
+
+
+ + + Your Data, Your Rules + +

Retain control over your most important information. Sensemaker keeps all data locally, letting you choose what to share with the network.

+
+
+
+
+ */} ); } diff --git a/components/GroupHome.js b/components/GroupHome.js new file mode 100644 index 00000000..6b28b783 --- /dev/null +++ b/components/GroupHome.js @@ -0,0 +1,93 @@ +'use strict'; + +const React = require('react'); +const ReactDOMServer = require('react-dom/server'); +const { Link } = require('react-router-dom'); + +const { + Button, + Card, + Form, + Header, + Icon, + Input, + List, + Segment +} = require('semantic-ui-react'); + +class GroupHome extends React.Component { + constructor (settings = {}) { + super(settings); + this.state = {}; + } + + componentDidMount () { + this.props.fetchGroups(); + } + + handleGroupCompletionChange = (e) => { + console.debug('group completion changed, target:', e.target); + console.debug('group completion changed, value:', e.target.value); + const now = new Date(); + // TODO: mark completion + this.setState({ groupCompletion: e.target.value }); + } + + handleGroupInputChange = (e) => { + this.setState({ groupName: e.target.value }); + } + + handleGroupSubmit = async (e) => { + this.setState({ loading: true }) + const group = await this.props.createGroup({ name: this.state.groupName }); + this.setState({ groupName: '', loading: false }); + this.props.fetchGroups(); + } + + render () { + const { groups } = this.props; + return ( + +
GROUPS
+

Sensemaker utilizes groups to manage sharing and alert distribution. Create a group here to begin syncing.

+
+
+ + + Create Group} /> + +
+ + {groups && groups.groups && groups.groups.map((group) => ( + + + {group.name} + Members: {group?.members?.length} + + + {group.members && group.members.map((member) => ( + + + + {member.name} + {member.email} + + + ))} + + + + + ))} + +
+
+ ); + } + + toHTML () { + return ReactDOMServer.renderToString(this.render()); + } +} + +module.exports = GroupHome; diff --git a/components/GroupView.js b/components/GroupView.js new file mode 100644 index 00000000..1c31d585 --- /dev/null +++ b/components/GroupView.js @@ -0,0 +1,95 @@ +'use strict'; + +const React = require('react'); +const ReactDOMServer = require('react-dom/server'); +const { Link } = require('react-router-dom'); + +const { + Breadcrumb, + Button, + Card, + Form, + Header, + Icon, + Input, + List, + Segment +} = require('semantic-ui-react'); + +class GroupView extends React.Component { + constructor (settings = {}) { + super(settings); + this.state = {}; + } + + componentDidMount () { + this.props.fetchGroup(); + } + + handleGroupMemberCompletionChange = (e) => { + console.debug('group completion changed, target:', e.target); + console.debug('group completion changed, value:', e.target.value); + const now = new Date(); + // TODO: mark completion + this.setState({ groupCompletion: e.target.value }); + } + + handleGroupMemberInputChange = (e) => { + this.setState({ groupMemberName: e.target.value }); + } + + handleGroupMemberSubmit = async (e) => { + this.setState({ loading: true }) + const group = await this.props.addMemberToGroup({ name: this.state.groupMemberName }); + this.setState({ groupMemberName: '', loading: false }); + this.props.fetchGroups(); + } + + render () { + const { groups } = this.props; + return ( +
+
+ + + Groups + + {groups.current.name} + +
+ +
{groups.current.name}
+

foo

+

Members

+
+ + + + + +
+ + {groups.current && groups.current.members && groups.current.members.map((member) => ( + + + {member.name} + {member.email} + + + ))} + +
+
+ ); + } + + toHTML () { + return ReactDOMServer.renderToString(this.render()); + } +} + +module.exports = GroupView; diff --git a/components/HeaderBar.js b/components/HeaderBar.js index e0b02e3e..89077453 100644 --- a/components/HeaderBar.js +++ b/components/HeaderBar.js @@ -46,8 +46,8 @@ class HeaderBar extends React.Component { render () { const { showBrand, showButtons } = this.props; return ( -
- {(showBrand) && {BRAND_NAME}} + + {(showBrand) && {BRAND_NAME}} {(showButtons) && ( @@ -56,7 +56,7 @@ class HeaderBar extends React.Component { )}
-
+ ); } } diff --git a/components/Home.js b/components/Home.js index 15eea607..f11cc77e 100644 --- a/components/Home.js +++ b/components/Home.js @@ -8,6 +8,7 @@ const { Button, Card, Header, + List, Segment } = require('semantic-ui-react'); @@ -62,28 +63,37 @@ class Home extends React.Component { uploadFile={this.props.uploadFile} /> {(conversations && conversations.length) ? ( - -

Recently

- - {conversations.slice(0, 2).map((conversation, index) => ( - - - {conversation.title} - {conversation.summary} - - - - - - ))} - + + {conversations.slice(0, 2).map((conversation, index) => ( + - Explore History » - + {conversation.title} + {conversation.summary} + + + - -
+ ))} + + + Recently... + + {conversations.slice(2, 5).map((conversation, index) => ( + + + + {conversation.title} + + + ))} + + + + + + + ) : null} diff --git a/components/LoginForm.js b/components/LoginForm.js index 36c32b2c..504d423f 100644 --- a/components/LoginForm.js +++ b/components/LoginForm.js @@ -83,7 +83,7 @@ class LoginForm extends React.Component {
- {ENABLE_DISCORD_LOGIN && ( Discord )} + {ENABLE_DISCORD_LOGIN && ( Discord )}
diff --git a/components/Room.js b/components/Room.js index c5db3ae0..ebb2f60f 100644 --- a/components/Room.js +++ b/components/Room.js @@ -21,7 +21,6 @@ class Conversation extends React.Component { actualConversation: null, recoveryFlag: false, recovering: false, - file_fabric_id: null, documentInfo: null, documentSections: null, }; @@ -57,14 +56,6 @@ class Conversation extends React.Component { const actual = this.props.conversations.find(conversation => conversation.slug == id); this.setState({ actualConversation: actual }); await this.props.resetChat(); - this.setState({ file_fabric_id: actual.file_fabric_id ? actual.file_fabric_id : null }); - //if the conversation is related to a document, it fetchs for that document info - if (actual.file_fabric_id) { - await this.props.fetchDocument(actual.file_fabric_id); - await this.props.fetchDocumentSections(actual.file_fabric_id); - } else { - this.setState({documentInfo: null}); - } // Fetch new conversation details and messages await this.props.getMessages({ conversation_id: id }); } @@ -109,6 +100,7 @@ class Conversation extends React.Component { documentSections={this.state.documentSections} documentInfoSidebar={this.props.documentInfoSidebar} fetchData={this.fetchData} + takeFocus={true} /> diff --git a/components/SensemakerUI.js b/components/SensemakerUI.js index ff52b7d1..c963a5af 100644 --- a/components/SensemakerUI.js +++ b/components/SensemakerUI.js @@ -159,6 +159,14 @@ class SensemakerUI extends React.Component { dbRequest.onerror = function(event) { console.error("IndexedDB error:", event.target.errorCode); }; + + // Video Background + // document.querySelector('.ui.video').video(); + const graph = document.createElement('script'); + graph.src = '/scripts/animation.js'; + document.body.appendChild(graph); + + console.debug('[SENSEMAKER:UI]', 'SensemakerUI mounted.'); } render () { @@ -166,9 +174,10 @@ class SensemakerUI extends React.Component { const { login, error } = this.props; return ( - - {/* TODO: render string here */} - + + + {/* TODO: render string here */} + {(!this.props.auth || this.props.auth.loading) ? (
diff --git a/components/Settings.js b/components/Settings.js index 7b5089ee..a163aedd 100644 --- a/components/Settings.js +++ b/components/Settings.js @@ -54,14 +54,12 @@ class SensemakerUserSettings extends React.Component { render () { const { username, email, user_discord } = this.state; - console.debug('user discord:', user_discord); - return ( - -
Settings
- -
Account
+ +
Settings
+
+
Account
@@ -74,19 +72,19 @@ class SensemakerUserSettings extends React.Component { -
Username:
+
Username:

{username}

- +
-
Email:
+
Email:

{email}

-
Password:
+
Password:
******* - +
@@ -105,53 +103,35 @@ class SensemakerUserSettings extends React.Component { {(user_discord) ? -
{ alert('Not yet implemented!') }}> -
-
disconnect
+ + {user_discord.username}
+
: Link Discord »}
- - -
-
Billing
- - -
Usage
- -
-
-
-
-
Current Plan
- - -
Guest Pass
-

- Free
- Renewal: -

-
-
-
-
- -
-
Security
- - + + + + +
Security
+
+ + +
+
+ + +
Session
- - - - - + +
+
+
+
+
setTimeout(resolve, 1500)); - await this.props.fullRegister(username, password, email, firstName, lastName, firmName, firmSize); + await this.props.fullRegister(username, password, email, firstName, lastName); } catch (error) { this.setState({ registering: false }); @@ -195,8 +193,6 @@ class SignUpForm extends React.Component { tokenError, firstName, lastName, - firmName, - firmSize, username, isNewUserValid, usernameError, @@ -267,26 +263,6 @@ class SignUpForm extends React.Component { required /> - - - - { + this.setState({ sourceContent: e.target.value }); + } + + handleSourceSubmit = async (e) => { + this.setState({ loading: true }) + const group = await this.props.createSource({ content: this.state.sourceContent }); + this.setState({ sourceContent: '', loading: false }); + this.props.fetchSources(); + } + + handlePeerInputChange = (e) => { + this.setState({ peerAddress: e.target.value }); + } + + handlePeerSubmit = async (e) => { + this.setState({ loading: true }) + const group = await this.props.createPeer({ address: this.state.peerAddress }); + this.setState({ peerAddress: '', loading: false }); + this.props.fetchSources(); } render () { const now = new Date(); - const { sources } = this.props; + const { network, peers, sources } = this.props; return (

Sources

Remote data sources can be added to improve coverage.

- +
+ +
+ +
+ + + Create Source} /> + + +
- Source + Name URL + Recurrence + Last Retrieved Actions - {sources?.current?.map((source, index) => { + {sources?.sources?.map((source, index) => { return ( {source.name} - {source.url} + {source.content} + {source.recurrence} + + {source.last_retrieved ? ( + + ) : (

Initializing...

)} +
- View + + + +
); })}
- + + +
Peers
+
+ + + Add Peer } /> + +
+ + + + Peer + Address + Port + Protocol + Connected + Controls + + + + {network && network.peers && network.peers + .map(instance => { + return ( + {instance.title} + {instance.address} + {instance.port} + {instance.protocol} + {instance.connected ? : } + + ) + })} + +
); } diff --git a/components/Splash.js b/components/Splash.js index 66e8c730..377e72ce 100644 --- a/components/Splash.js +++ b/components/Splash.js @@ -29,6 +29,7 @@ const { // Components const AccountCreator = require('./AccountCreator'); +const FeaturesHome = require('./FeaturesHome'); const FrontPage = require('./FrontPage'); const ResetPasswordForm = require('./ResetPasswordForm'); const SignUpForm = require('./SignUpForm'); @@ -49,6 +50,7 @@ class Splash extends React.Component { } /> } /> + } /> } /> } /> @@ -57,8 +59,9 @@ class Splash extends React.Component { right now i made this route apart, probably splash component needs a rebuild later */}
- } /> - } /> + } /> - {tasks && tasks.tasks.map((x) => { return ( - + {x.title} diff --git a/components/TaskView.js b/components/TaskView.js index ff873dd9..1a22e9a2 100644 --- a/components/TaskView.js +++ b/components/TaskView.js @@ -20,7 +20,6 @@ const { } = require('semantic-ui-react'); const { createTask } = require('../actions/taskActions'); -const CreateTaskModal = require('./CreateTaskModal'); class TaskView extends React.Component { constructor (settings = {}) { diff --git a/components/UserView.js b/components/UserView.js index 925e4943..35d5236e 100644 --- a/components/UserView.js +++ b/components/UserView.js @@ -18,6 +18,10 @@ class UserView extends React.Component { super(props); } + componentDidMount () { + this.props.fetchUser(this.props.username); + } + render () { return (
diff --git a/components/Waitlist.js b/components/Waitlist.js index 79b58cd0..d78d8ce0 100644 --- a/components/Waitlist.js +++ b/components/Waitlist.js @@ -128,11 +128,11 @@ class Waitlist extends React.Component { {error && }

{BRAND_NAME} is currently closed to the public.

-

If you'd like to join the waitlist, enter your email here:

+

Already have an account? Sign In »

diff --git a/constants.js b/constants.js index 86bd3ccd..89f21312 100644 --- a/constants.js +++ b/constants.js @@ -42,6 +42,7 @@ const ENABLE_DISCORD_LOGIN = false; const ENABLE_DOCUMENTS = true; const ENABLE_FEEDBACK_BUTTON = false; const ENABLE_FILES = true; +const ENABLE_GROUPS = true; const ENABLE_UPLOADS = false; const ENABLE_DOCUMENT_SEARCH = true; const ENABLE_PERSON_SEARCH = false; @@ -90,6 +91,7 @@ module.exports = { ENABLE_DISCORD_LOGIN, ENABLE_DOCUMENTS, ENABLE_FEEDBACK_BUTTON, + ENABLE_GROUPS, ENABLE_BILLING, ENABLE_LOGIN, ENABLE_REGISTRATION, diff --git a/migrations/20241209003920_add_groups.js b/migrations/20241209003920_add_groups.js new file mode 100644 index 00000000..da7a7f2f --- /dev/null +++ b/migrations/20241209003920_add_groups.js @@ -0,0 +1,40 @@ +'use strict'; + +exports.up = function (knex) { + return knex.schema.createTable('groups', (table) => { + table.string('id'); + table.increments('dbid'); + table.string('creator'); + table.string('owner'); + table.string('name'); + table.string('description'); + table.string('summary'); + table.timestamps(); + }).createTable('group_members', (table) => { + table.string('group_id'); + table.string('account_id'); + table.timestamps(); + }).createTable('sources', (table) => { + table.string('id'); + table.increments('dbid'); + table.string('creator'); + table.string('owner'); + table.string('name'); + table.string('description'); + table.string('content'); + table.string('summary'); + table.string('latest_blob_id'); + table.timestamp('last_retrieved'); + table.enu('status', ['active', 'deleted']); + table.enum('recurrence', ['daily', 'weekly', 'monthly', 'yearly']).defaultTo('daily'); + table.timestamps(); + }).alterTable('documents', (table) => { + table.string('blob_id'); + }); +}; + +exports.down = function (knex) { + return knex.schema.dropTable('groups').dropTable('group_members').dropTable('sources').alterTable('documents', (table) => { + table.dropColumn('blob_id'); + }); +}; diff --git a/package-lock.json b/package-lock.json index 7558e2da..58bfcd7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,90 +1,90 @@ { "name": "sensemaker", - "version": "0.2.0-RC1", + "version": "0.2.0-RC2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sensemaker", - "version": "0.2.0-RC1", + "version": "0.2.0-RC2", "license": "UNLICENSED", "dependencies": { - "@babel/register": "7.22.5", + "@babel/register": "=7.22.5", "@fabric/core": "FabricLabs/fabric#feature/v0.1.0-RC1", "@fabric/discord": "FabricLabs/fabric-discord#feature/v0.1.0-RC1", "@fabric/http": "FabricLabs/fabric-http#feature/v0.1.0-RC1", "@fabric/hub": "FabricLabs/hub.fabric.pub#feature/sensemaker", "@fabric/matrix": "FabricLabs/fabric-matrix#feature/v0.1.0-RC1", - "@google/generative-ai": "0.2.0", - "@langchain/community": "0.0.43", - "@langchain/redis": "0.1.0", - "@rsi/star-citizen": "github:GoonCitizen/star-citizen-live", - "@tensorflow-models/universal-sentence-encoder": "1.3.3", - "@tensorflow/tfjs-converter": "3.6.0", - "@tensorflow/tfjs-core": "3.6.0", - "@tensorflow/tfjs-node": "4.10.0", - "2captcha": "3.0.7", - "assert-browserify": "2.0.0", - "async-mutex": "0.4.1", - "axios": "1.6.7", - "babel-loader": "8.2.5", - "bcrypt": "5.1.0", - "bitcoinjs-lib": "5.2.0", - "bottleneck": "2.19.5", - "browserify-fs": "1.0.0", - "crypto-browserify": "3.12.0", - "fast-json-patch": "3.1.1", - "fomantic-ui": "2.9.3", - "hark": "1.2.3", - "http-proxy": "1.18.1", - "jsdom": "22.1.0", - "knex": "2.4.2", - "knex-paginate": "3.1.1", - "langchain": "0.3.5", - "levelgraph": "3.0.0", - "lodash.debounce": "4.0.8", - "lodash.merge": "4.6.2", - "multer": "1.4.5-lts.1", - "mysql2": "3.4.0", - "node-util": "0.0.1", - "nodemailer": "6.9.7", - "openai": "4.20.1", - "path-browserify": "1.0.1", - "pdf-parse": "1.1.1", - "pg": "8.11.3", - "querystring-es3": "0.2.1", - "react": "18.2.0", - "react-dom": "18.2.0", - "react-redux": "8.1.0", - "react-router-dom": "6.13.0", - "react-simple-star-rating": "5.1.7", - "react-textarea-autosize": "8.5.3", - "react-toastify": "10.0.5", - "react-top-loading-bar": "2.3.1", - "redis": "4.6.13", - "redux": "4.2.1", - "redux-thunk": "2.4.2", - "smtp-client": "0.4.0", - "sqlite3": "5.1.6", - "stream-browserify": "3.0.0", - "stripe": "14.14.0", - "undici": "6.6.1" + "@google/generative-ai": "=0.2.0", + "@langchain/community": "=0.0.43", + "@langchain/redis": "=0.1.0", + "@rsi/star-citizen": "GoonCitizen/star-citizen-live", + "@tensorflow-models/universal-sentence-encoder": "=1.3.3", + "@tensorflow/tfjs-converter": "=3.6.0", + "@tensorflow/tfjs-core": "=3.6.0", + "@tensorflow/tfjs-node": "=4.10.0", + "2captcha": "=3.0.7", + "assert-browserify": "=2.0.0", + "async-mutex": "=0.4.1", + "axios": "=1.6.7", + "babel-loader": "=8.2.5", + "bcrypt": "=5.1.0", + "bitcoinjs-lib": "=5.2.0", + "bottleneck": "=2.19.5", + "browserify-fs": "=1.0.0", + "crypto-browserify": "=3.12.0", + "fast-json-patch": "=3.1.1", + "fomantic-ui": "=2.9.3", + "hark": "=1.2.3", + "http-proxy": "=1.18.1", + "jsdom": "=22.1.0", + "knex": "=2.4.2", + "knex-paginate": "=3.1.1", + "langchain": "=0.3.5", + "levelgraph": "=3.0.0", + "lodash.debounce": "=4.0.8", + "lodash.merge": "=4.6.2", + "multer": "=1.4.5-lts.1", + "mysql2": "=3.4.0", + "node-util": "=0.0.1", + "nodemailer": "=6.9.7", + "openai": "=4.20.1", + "path-browserify": "=1.0.1", + "pdf-parse": "=1.1.1", + "pg": "=8.11.3", + "querystring-es3": "=0.2.1", + "react": "=18.2.0", + "react-dom": "=18.2.0", + "react-redux": "=8.1.0", + "react-router-dom": "=6.13.0", + "react-simple-star-rating": "=5.1.7", + "react-textarea-autosize": "=8.5.3", + "react-toastify": "=10.0.5", + "react-top-loading-bar": "=2.3.1", + "redis": "=4.6.13", + "redux": "=4.2.1", + "redux-thunk": "=2.4.2", + "smtp-client": "=0.4.0", + "sqlite3": "=5.1.6", + "stream-browserify": "=3.0.0", + "stripe": "=14.14.0", + "undici": "=6.6.1" }, "devDependencies": { - "@babel/preset-env": "7.22.5", - "@babel/preset-react": "7.17.12", - "@observablehq/plot": "0.5.0", - "c8": "10.1.2", - "chai": "4.3.2", - "electron": "29.1.0", - "electron-packager": "17.1.2", - "gulp": "4.0.2", - "jsdoc-to-markdown": "7.1.1", - "mocha": "10.0.0", - "semantic-ui-css": "2.5.0", - "semantic-ui-react": "2.1.4", - "sinon": "17.0.1", - "why-is-node-running": "2.2.2" + "@babel/preset-env": "=7.22.5", + "@babel/preset-react": "=7.17.12", + "@observablehq/plot": "=0.5.0", + "c8": "=10.1.2", + "chai": "=4.3.2", + "electron": "=29.1.0", + "electron-packager": "=17.1.2", + "gulp": "=4.0.2", + "jsdoc-to-markdown": "=7.1.1", + "mocha": "=10.0.0", + "semantic-ui-css": "=2.5.0", + "semantic-ui-react": "=2.1.4", + "sinon": "=17.0.1", + "why-is-node-running": "=2.2.2" } }, "node_modules/@actions/core": { @@ -317,9 +317,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.2.tgz", - "integrity": "sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.3.tgz", + "integrity": "sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g==", "engines": { "node": ">=6.9.0" } @@ -355,12 +355,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", - "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz", + "integrity": "sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ==", "dependencies": { - "@babel/parser": "^7.26.2", - "@babel/types": "^7.26.0", + "@babel/parser": "^7.26.3", + "@babel/types": "^7.26.3", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -381,19 +381,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.25.9.tgz", - "integrity": "sha512-C47lC7LIDCnz0h4vai/tpNOI95tCd5ZT3iBt/DBH5lXKHZsyNQv18yf1wIIg2ntiQNgmAvA+DgZ82iW8Qdym8g==", - "dev": true, - "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-compilation-targets": { "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", @@ -431,13 +418,13 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.9.tgz", - "integrity": "sha512-ORPNZ3h6ZRkOyAa/SaHU+XsLZr0UQzRwuDQ0cczIA17nAzZ+85G5cVkOJIj7QavLZGSe8QXUmNFxSZzjcZF9bw==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.26.3.tgz", + "integrity": "sha512-G7ZRb40uUgdKOQqPLjfD12ZmGA54PzqDFUv2BKImnC9QIfGhIHKvVML0oN8IUiDq4iRqpq74ABpvOaerfWdong==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.25.9", - "regexpu-core": "^6.1.1", + "regexpu-core": "^6.2.0", "semver": "^6.3.1" }, "engines": { @@ -559,19 +546,6 @@ "@babel/core": "^7.0.0" } }, - "node_modules/@babel/helper-simple-access": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz", - "integrity": "sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q==", - "dev": true, - "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz", @@ -637,11 +611,11 @@ } }, "node_modules/@babel/parser": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", - "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz", + "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", "dependencies": { - "@babel/types": "^7.26.0" + "@babel/types": "^7.26.3" }, "bin": { "parser": "bin/babel-parser.js" @@ -1170,12 +1144,11 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.25.9.tgz", - "integrity": "sha512-KRhdhlVk2nObA5AYa7QMgTMTVJdfHprfpAk4DjZVtllqRg9qarilstTKEhpVjyt+Npi8ThRyiV8176Am3CodPA==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz", + "integrity": "sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ==", "dev": true, "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { @@ -1310,14 +1283,13 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.25.9.tgz", - "integrity": "sha512-dwh2Ol1jWwL2MgkCzUSOvfmKElqQcuswAZypBSUsScMXvgdT8Ekq5YA6TtqpTVWH+4903NmboMuH1o9i8Rxlyg==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz", + "integrity": "sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-simple-access": "^7.25.9" + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1961,15 +1933,15 @@ } }, "node_modules/@babel/traverse": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", - "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", + "version": "7.26.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.4.tgz", + "integrity": "sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==", "dependencies": { - "@babel/code-frame": "^7.25.9", - "@babel/generator": "^7.25.9", - "@babel/parser": "^7.25.9", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.3", + "@babel/parser": "^7.26.3", "@babel/template": "^7.25.9", - "@babel/types": "^7.25.9", + "@babel/types": "^7.26.3", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1978,9 +1950,9 @@ } }, "node_modules/@babel/types": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", - "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", + "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" @@ -1996,9 +1968,9 @@ "dev": true }, "node_modules/@cypress/request": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.6.tgz", - "integrity": "sha512-fi0eVdCOtKu5Ed6+E8mYxUF6ZTFJDZvHogCBelM0xVXmrDEkyM22gRArQzq1YcHPm1V47Vf/iAD+WgVdUlJCGg==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.7.tgz", + "integrity": "sha512-LzxlLEMbBOPYB85uXrDqvD4MgcenjRBLIns3zyhx7vTPj/0u2eQhzXvPiGcaJrV38Q9dbkExWp6cOHPJ+EtFYg==", "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -2013,7 +1985,7 @@ "json-stringify-safe": "~5.0.1", "mime-types": "~2.1.19", "performance-now": "^2.1.0", - "qs": "6.13.0", + "qs": "6.13.1", "safe-buffer": "^5.1.2", "tough-cookie": "^5.0.0", "tunnel-agent": "^0.6.0", @@ -2023,6 +1995,20 @@ "node": ">= 6" } }, + "node_modules/@cypress/request/node_modules/qs": { + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz", + "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/@cypress/request/node_modules/tough-cookie": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.0.0.tgz", @@ -2421,7 +2407,7 @@ }, "node_modules/@fabric/core": { "version": "0.1.0-RC1", - "resolved": "git+ssh://git@github.com/FabricLabs/fabric.git#753f69aff3625b4eada04de871ab2d3d49aa6967", + "resolved": "git+ssh://git@github.com/FabricLabs/fabric.git#def48858c35a6e700e03c92c43de9c7970834e87", "license": "MIT", "dependencies": { "arbitrary": "=1.4.10", @@ -2448,7 +2434,7 @@ "jayson": "=4.1.2", "json-pointer": "=0.6.2", "jsonpointer": "=5.0.1", - "level": "=7.0.1", + "level": "=9.0.0", "lodash.merge": "=4.6.2", "macaroon": "=3.0.4", "merkletreejs": "=0.4.0", @@ -2549,7 +2535,7 @@ }, "node_modules/@fabric/discord": { "version": "0.1.0-dev", - "resolved": "git+ssh://git@github.com/FabricLabs/fabric-discord.git#882f751f0989b924bb9b620c382ca9d661bd8930", + "resolved": "git+ssh://git@github.com/FabricLabs/fabric-discord.git#d1c1b484f7b84962bd49823562712330560cef1b", "license": "MIT", "dependencies": { "@fabric/core": "FabricLabs/fabric#feature/v0.1.0-RC1", @@ -2559,7 +2545,7 @@ }, "node_modules/@fabric/http": { "version": "0.1.0-RC1", - "resolved": "git+ssh://git@github.com/FabricLabs/fabric-http.git#0bc9c46e36a6cb077769b82d5c97f4e0c7cb0a39", + "resolved": "git+ssh://git@github.com/FabricLabs/fabric-http.git#59eebd9349e53646b7e19ae2e71c9404669d1daf", "license": "MIT", "dependencies": { "@fabric/core": "FabricLabs/fabric#feature/v0.1.0-RC1", @@ -2603,12 +2589,9 @@ } }, "node_modules/@fabric/http/node_modules/agent-base": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", - "dependencies": { - "debug": "^4.3.4" - }, + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", "engines": { "node": ">= 14" } @@ -2649,11 +2632,11 @@ } }, "node_modules/@fabric/http/node_modules/https-proxy-agent": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", - "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { @@ -2718,6 +2701,23 @@ "node": ">=4" } }, + "node_modules/@fabric/http/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/@fabric/http/node_modules/tr46": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", @@ -2740,6 +2740,51 @@ "node": ">=18" } }, + "node_modules/@fabric/http/node_modules/webpack": { + "version": "5.97.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.0.tgz", + "integrity": "sha512-CWT8v7ShSfj7tGs4TLRtaOLmOCPWhoKEvp+eA7FVx8Xrjb3XfT0aXdxDItnRZmE8sHcH+a8ayDrJCOjXKxVFfQ==", + "dependencies": { + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", + "@webassemblyjs/ast": "^1.14.1", + "@webassemblyjs/wasm-edit": "^1.14.1", + "@webassemblyjs/wasm-parser": "^1.14.1", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.11", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.2.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, "node_modules/@fabric/http/node_modules/whatwg-encoding": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", @@ -2760,9 +2805,9 @@ } }, "node_modules/@fabric/http/node_modules/whatwg-url": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz", - "integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.1.0.tgz", + "integrity": "sha512-jlf/foYIKywAt3x/XWKZ/3rz8OSJPiWktjmk891alJUEjiVxKX9LEO92qH3hv4aJ0mN3MWPvGMCy8jQi95xK4w==", "dependencies": { "tr46": "^5.0.0", "webidl-conversions": "^7.0.0" @@ -2781,7 +2826,7 @@ }, "node_modules/@fabric/hub": { "version": "0.1.0-RC1", - "resolved": "git+ssh://git@github.com/FabricLabs/hub.fabric.pub.git#449e3a08e03583d3093e77ca42f4e6c5074e4c08", + "resolved": "git+ssh://git@github.com/FabricLabs/hub.fabric.pub.git#aa77c147c006aaca2ff1f6f55575433421bdea92", "license": "MIT", "dependencies": { "@fabric/core": "FabricLabs/fabric#feature/v0.1.0-RC1", @@ -2793,11 +2838,11 @@ }, "node_modules/@fabric/matrix": { "version": "0.1.0", - "resolved": "git+ssh://git@github.com/FabricLabs/fabric-matrix.git#f68a49ba6d303ff09bdced9f61dd5bd916a76b92", + "resolved": "git+ssh://git@github.com/FabricLabs/fabric-matrix.git#a3d2354c57c1085c7f4679deeb4d613c710de82b", "license": "MIT", "dependencies": { "@fabric/core": "FabricLabs/fabric#feature/v0.1.0-RC1", - "matrix-js-sdk": "30.3.0" + "matrix-js-sdk": "=32.4.0" } }, "node_modules/@fastify/busboy": { @@ -3492,16 +3537,16 @@ } }, "node_modules/@langchain/core": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@langchain/core/-/core-0.3.19.tgz", - "integrity": "sha512-pJVOAHShefu1SRO8uhzUs0Pexah/Ib66WETLMScIC2w9vXlpwQy3DzXJPJ5X7ixry9N666jYO5cHtM2Z1DnQIQ==", + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/@langchain/core/-/core-0.3.22.tgz", + "integrity": "sha512-9rwEbxJi3Fgs8XuealNYxB6s0FCOnvXLnpiV5/oKgmEJtCRS91IqgJCWA8d59s4YkaEply/EsZVc2azNPK6Wjw==", "peer": true, "dependencies": { "ansi-styles": "^5.0.0", "camelcase": "6", "decamelize": "1.2.0", "js-tiktoken": "^1.0.12", - "langsmith": "^0.2.0", + "langsmith": "^0.2.8", "mustache": "^4.2.0", "p-queue": "^6.6.2", "p-retry": "4", @@ -3523,9 +3568,9 @@ } }, "node_modules/@langchain/core/node_modules/langsmith": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/langsmith/-/langsmith-0.2.8.tgz", - "integrity": "sha512-wKVNZoYtd8EqQWUEsfDZlZ77rH7vVqgNtONXRwynUp7ZFMFUIPhSlqE9pXqrmYPE8ZTBFj7diag2lFgUuaOEKw==", + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/langsmith/-/langsmith-0.2.11.tgz", + "integrity": "sha512-rVPUN/jQEHjTuYaoVKGjfb3NsYNLGTQT9LXcgJvka5M0EDcXciC598A+DsAQrl6McdfSJCFJDelgRPqVoF2xNA==", "peer": true, "dependencies": { "@types/uuid": "^10.0.0", @@ -3614,9 +3659,9 @@ } }, "node_modules/@langchain/openai/node_modules/openai": { - "version": "4.75.0", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.75.0.tgz", - "integrity": "sha512-8cWaK3td0qLspaflKWD6AvpQnl0gynWFbHg7sMAgiu//F20I4GJlCCpllDrECO6WFSuY8HXJj8gji3urw2BGGg==", + "version": "4.76.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.76.0.tgz", + "integrity": "sha512-QBGIetjX1C9xDp5XGa/3mPnfKI9BgAe2xHQX6PmO98wuW9qQaurBaumcYptQWc9LHZZq7cH/Y1Rjnsr6uUDdVw==", "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", @@ -3825,9 +3870,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/@matrix-org/matrix-sdk-crypto-wasm": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-3.6.0.tgz", - "integrity": "sha512-fvuYczcp/r/MOkOAUbK+tMaTerEe7/QHGQcRJz3W3JuEma0YN59d35zTBlts7EkN6Ichw1vLSyM+GkcbuosuyA==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-4.10.0.tgz", + "integrity": "sha512-zOqKVAYPfzs6Hav/Km9F5xWwoQ0bxDuoUU0/121m03Fg2VnfcHk43TjKImZolFc7IlgXwVGoda9Pp9Z/eTVKJA==", "engines": { "node": ">= 10" } @@ -4283,7 +4328,7 @@ }, "node_modules/@rsi/star-citizen": { "version": "0.1.0-dev", - "resolved": "git+ssh://git@github.com/GoonCitizen/star-citizen-live.git#cea58f396fb03473c81577f7c4af603e52d250cc", + "resolved": "git+ssh://git@github.com/GoonCitizen/star-citizen-live.git#545c27fb0efe4ef019722bb02e55eb94efba6f65", "license": "MIT", "dependencies": { "@fabric/hub": "FabricLabs/hub.fabric.pub#feature/sensemaker", @@ -4766,9 +4811,9 @@ } }, "node_modules/@types/hoist-non-react-statics": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz", - "integrity": "sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.6.tgz", + "integrity": "sha512-lPByRJUer/iN/xa4qpyL0qmL11DqNW81iU/IG1S3uvRUq4oKagz8VCxZjiWkumgt66YT3vOdDgZ0o32sGKtCEw==", "dependencies": { "@types/react": "*", "hoist-non-react-statics": "^3.3.0" @@ -4860,9 +4905,9 @@ "integrity": "sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==" }, "node_modules/@types/prop-types": { - "version": "15.7.13", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.13.tgz", - "integrity": "sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==" + "version": "15.7.14", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.14.tgz", + "integrity": "sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==" }, "node_modules/@types/qs": { "version": "6.9.17", @@ -4875,9 +4920,9 @@ "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, "node_modules/@types/react": { - "version": "18.3.12", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.12.tgz", - "integrity": "sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw==", + "version": "18.3.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.14.tgz", + "integrity": "sha512-NzahNKvjNhVjuPBQ+2G7WlxstQ+47kXZNHlUvFakDViuIEfGY926GqhMueQFZ7woG+sPiQKlF36XfrIUVSUfFg==", "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -5162,6 +5207,22 @@ "node": ">=6.5" } }, + "node_modules/abstract-level": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/abstract-level/-/abstract-level-2.0.2.tgz", + "integrity": "sha512-pPJixmXk/kTKLB2sSue7o4Uj6TlLD2XfaP2gWZomHVCC6cuUGX/VslQqKG1yZHfXwBb/3lS6oSTMPGzh1P1iig==", + "dependencies": { + "buffer": "^6.0.3", + "is-buffer": "^2.0.5", + "level-supports": "^6.0.0", + "level-transcoder": "^1.0.1", + "maybe-combine-errors": "^1.0.0", + "module-error": "^1.0.1" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/abstract-leveldown": { "version": "0.12.4", "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-0.12.4.tgz", @@ -6829,6 +6890,14 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, + "node_modules/browser-level": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/browser-level/-/browser-level-2.0.0.tgz", + "integrity": "sha512-RuYSCHG/jwFCrK+KWA3dLSUNLKHEgIYhO5ORPjJMjCt7T3e+RzpIDmYKWRHxq2pfKGXjlRuEff7y7RESAAgzew==", + "dependencies": { + "abstract-level": "^2.0.1" + } + }, "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -7322,15 +7391,14 @@ } }, "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "dependencies": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" }, "engines": { "node": ">= 0.4" @@ -7339,6 +7407,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/callback-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/callback-stream/-/callback-stream-1.1.0.tgz", @@ -7368,9 +7448,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001686", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001686.tgz", - "integrity": "sha512-Y7deg0Aergpa24M3qLC5xjNklnKnhsmSyR/V89dLZ1n0ucJIFNs7PgR2Yfa/Zf6W79SbBicgtGxZr2juHkEUIA==", + "version": "1.0.30001687", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001687.tgz", + "integrity": "sha512-0S/FDhf4ZiqrTUiQ39dKeUjYRjkv7lOZU1Dgif2rIqrTzX/1wV2hfKu9TOm1IHkdSijfLswxTFzl/cvir+SLSQ==", "funding": [ { "type": "opencollective", @@ -7391,14 +7471,6 @@ "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" }, - "node_modules/catering": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz", - "integrity": "sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==", - "engines": { - "node": ">=6" - } - }, "node_modules/catharsis": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", @@ -7578,6 +7650,21 @@ "node": ">=0.10.0" } }, + "node_modules/classic-level": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-2.0.0.tgz", + "integrity": "sha512-ftiMvKgCQK+OppXcvMieDoYlYLYWhScK6yZRFBrrlHQRbm4k6Gr+yDgu/wt3V0k1/jtNbuiXAsRmuAFcD0Tx5Q==", + "hasInstallScript": true, + "dependencies": { + "abstract-level": "^2.0.0", + "module-error": "^1.0.1", + "napi-macros": "^2.2.2", + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/clean-css": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", @@ -8804,9 +8891,9 @@ } }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dependencies": { "ms": "^2.1.3" }, @@ -9301,6 +9388,19 @@ "resolved": "https://registry.npmjs.org/dotparser/-/dotparser-1.1.1.tgz", "integrity": "sha512-8ojhUts0HbLnXJgjTiJOddwVVBUk6hg4SJ5kGiuhzgK/f+y79TiWvICwx1oCWlVbBC8YI3nEaIQg9fjGYbGBXw==" }, + "node_modules/dunder-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", + "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/duplexer2": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", @@ -9540,9 +9640,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.68", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.68.tgz", - "integrity": "sha512-FgMdJlma0OzUYlbrtZ4AeXjKxKPk6KT8WOP8BjcqxWtlg8qyJQjRzPJzUtUn5GBg1oQ26hFs7HOOHJMYiJRnvQ==" + "version": "1.5.72", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.72.tgz", + "integrity": "sha512-ZpSAUOZ2Izby7qnZluSrAlGgGQzucmFbN0n64dYzocYxnxV5ufurpj3VgEe4cUp7ir9LmeLxNYo8bVnlM8bQHw==" }, "node_modules/electron/node_modules/@types/node": { "version": "20.17.9", @@ -9608,59 +9708,6 @@ "iconv-lite": "^0.6.2" } }, - "node_modules/encoding-down": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-7.1.0.tgz", - "integrity": "sha512-ky47X5jP84ryk5EQmvedQzELwVJPjCgXDQZGeb9F6r4PdChByCGHTBrVcF3h8ynKVJ1wVbkxTsDC8zBROPypgQ==", - "dependencies": { - "abstract-leveldown": "^7.2.0", - "inherits": "^2.0.3", - "level-codec": "^10.0.0", - "level-errors": "^3.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/encoding-down/node_modules/abstract-leveldown": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", - "integrity": "sha512-DnhQwcFEaYsvYDnACLZhMmCWd3rkOeEvglpa4q5i/5Jlm3UIsWaxVzuXvDLFCSCWRO3yy2/+V/G7FusFgejnfQ==", - "deprecated": "Superseded by abstract-level (https://github.com/Level/community#faq)", - "dependencies": { - "buffer": "^6.0.3", - "catering": "^2.0.0", - "is-buffer": "^2.0.5", - "level-concat-iterator": "^3.0.0", - "level-supports": "^2.0.1", - "queue-microtask": "^1.2.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/encoding-down/node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "engines": { - "node": ">=4" - } - }, "node_modules/encoding/node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -9738,12 +9785,9 @@ } }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "engines": { "node": ">= 0.4" } @@ -11268,15 +11312,18 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.5.tgz", + "integrity": "sha512-Y4+pKa7XeRUPWFNvOOYHkRYrfzW07oraURSvjDmRVOJ748OrVmeXtpE4+GCEHncjCjkTxPNRt8kEbxDhsn6VTg==", "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -11338,68 +11385,35 @@ } }, "node_modules/get-uri": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.3.tgz", - "integrity": "sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.4.tgz", + "integrity": "sha512-E1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ==", "dependencies": { "basic-ftp": "^5.0.2", "data-uri-to-buffer": "^6.0.2", - "debug": "^4.3.4", - "fs-extra": "^11.2.0" + "debug": "^4.3.4" }, "engines": { "node": ">= 14" } }, - "node_modules/get-uri/node_modules/fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", "engines": { - "node": ">=14.14" + "node": ">=0.10.0" } }, - "node_modules/get-uri/node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/get-uri/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/getopts": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/getopts/-/getopts-2.3.0.tgz", - "integrity": "sha512-5eDf9fuSXwxBL6q5HX+dhDj+dslFGWzU5thZ9kNKUkcPtaPdatmUFKwHFrLb/uf/WpA4BHET+AX3Scl56cAjpA==" - }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "node_modules/getopts": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/getopts/-/getopts-2.3.0.tgz", + "integrity": "sha512-5eDf9fuSXwxBL6q5HX+dhDj+dslFGWzU5thZ9kNKUkcPtaPdatmUFKwHFrLb/uf/WpA4BHET+AX3Scl56cAjpA==" + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dependencies": { "assert-plus": "^1.0.0" } @@ -11628,12 +11642,9 @@ "integrity": "sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==" }, "node_modules/gopd": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.1.0.tgz", - "integrity": "sha512-FQoVQnqcdk4hVM4JN1eromaun4iuS34oStkdlLENLdpULsuQcTyXj8w7ayhuUfPwEYZ1ZOooOTT6fdA9Vmx/RA==", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "engines": { "node": ">= 0.4" }, @@ -13311,20 +13322,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-proto": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.1.0.tgz", - "integrity": "sha512-QLdzI9IIO1Jg7f9GT1gXpPpXArAn6cS31R1eEZqz08Gc+uQ8/XiqHWt17Fiw+2p6oTTIq5GXEpQkAlA88YRl/Q==", - "dependencies": { - "call-bind": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", @@ -13380,6 +13377,11 @@ "node": ">=0.10.0" } }, + "node_modules/has-values/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, "node_modules/has-values/node_modules/kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", @@ -13893,9 +13895,26 @@ } }, "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "engines": { + "node": ">=4" + } }, "node_modules/is-callable": { "version": "1.2.7", @@ -14066,6 +14085,11 @@ "node": ">=0.10.0" } }, + "node_modules/is-number/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, "node_modules/is-number/node_modules/kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -14918,9 +14942,12 @@ "dev": true }, "node_modules/jwt-decode": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", - "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz", + "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==", + "engines": { + "node": ">=18" + } }, "node_modules/keyboard-key": { "version": "1.1.0", @@ -15162,9 +15189,9 @@ } }, "node_modules/langchain/node_modules/langsmith": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/langsmith/-/langsmith-0.2.8.tgz", - "integrity": "sha512-wKVNZoYtd8EqQWUEsfDZlZ77rH7vVqgNtONXRwynUp7ZFMFUIPhSlqE9pXqrmYPE8ZTBFj7diag2lFgUuaOEKw==", + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/langsmith/-/langsmith-0.2.11.tgz", + "integrity": "sha512-rVPUN/jQEHjTuYaoVKGjfb3NsYNLGTQT9LXcgJvka5M0EDcXciC598A+DsAQrl6McdfSJCFJDelgRPqVoF2xNA==", "dependencies": { "@types/uuid": "^10.0.0", "commander": "^10.0.1", @@ -15183,9 +15210,9 @@ } }, "node_modules/langchain/node_modules/openai": { - "version": "4.75.0", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.75.0.tgz", - "integrity": "sha512-8cWaK3td0qLspaflKWD6AvpQnl0gynWFbHg7sMAgiu//F20I4GJlCCpllDrECO6WFSuY8HXJj8gji3urw2BGGg==", + "version": "4.76.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.76.0.tgz", + "integrity": "sha512-QBGIetjX1C9xDp5XGa/3mPnfKI9BgAe2xHQX6PmO98wuW9qQaurBaumcYptQWc9LHZZq7cH/Y1Rjnsr6uUDdVw==", "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", @@ -15368,16 +15395,16 @@ } }, "node_modules/level": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/level/-/level-7.0.1.tgz", - "integrity": "sha512-w3E64+ALx2eZf8RV5JL4kIcE0BFAvQscRYd1yU4YVqZN9RGTQxXSvH202xvK15yZwFFxRXe60f13LJjcJ//I4Q==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/level/-/level-9.0.0.tgz", + "integrity": "sha512-n+mVuf63mUEkd8NUx7gwxY+QF5vtkibv6fXTGUgtHWLPDaA5/XZjLcI/Q1nQ8k6OttHT6Ezt+7nSEXsRUfHtOQ==", "dependencies": { - "level-js": "^6.1.0", - "level-packager": "^6.0.1", - "leveldown": "^6.1.0" + "abstract-level": "^2.0.1", + "browser-level": "^2.0.0", + "classic-level": "^2.0.0" }, "engines": { - "node": ">=10.12.0" + "node": ">=18" }, "funding": { "type": "opencollective", @@ -15415,36 +15442,6 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" }, - "node_modules/level-codec": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-10.0.0.tgz", - "integrity": "sha512-QW3VteVNAp6c/LuV6nDjg7XDXx9XHK4abmQarxZmlRSDyXYk20UdaJTSX6yzVvQ4i0JyWSB7jert0DsyD/kk6g==", - "dependencies": { - "buffer": "^6.0.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/level-concat-iterator": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-3.1.0.tgz", - "integrity": "sha512-BWRCMHBxbIqPxJ8vHOvKUsaO0v1sLYZtjN3K2iZJsRBYtp+ONsY6Jfi6hy9K3+zolgQRryhIn2NRZjZnWJ9NmQ==", - "dependencies": { - "catering": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/level-errors": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-3.0.1.tgz", - "integrity": "sha512-tqTL2DxzPDzpwl0iV5+rBCv65HWbHp6eutluHNcVIftKZlQN//b6GEnZDM2CvGZvzGYMwyPtYppYnydBQd2SMQ==", - "engines": { - "node": ">=10" - } - }, "node_modules/level-filesystem": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/level-filesystem/-/level-filesystem-1.2.0.tgz", @@ -15474,31 +15471,6 @@ "string-range": "~1.2" } }, - "node_modules/level-iterator-stream": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-5.0.0.tgz", - "integrity": "sha512-wnb1+o+CVFUDdiSMR/ZymE2prPs3cjVLlXuDeSq9Zb8o032XrabGEXcTCsBxprAtseO3qvFeGzh6406z9sOTRA==", - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/level-iterator-stream/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/level-js": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/level-js/-/level-js-2.2.4.tgz", @@ -15529,87 +15501,6 @@ "node": ">=0.4" } }, - "node_modules/level-packager": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-6.0.1.tgz", - "integrity": "sha512-8Ezr0XM6hmAwqX9uu8IGzGNkWz/9doyPA8Oo9/D7qcMI6meJC+XhIbNYHukJhIn8OGdlzQs/JPcL9B8lA2F6EQ==", - "dependencies": { - "encoding-down": "^7.1.0", - "levelup": "^5.1.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/level-packager/node_modules/abstract-leveldown": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", - "integrity": "sha512-DnhQwcFEaYsvYDnACLZhMmCWd3rkOeEvglpa4q5i/5Jlm3UIsWaxVzuXvDLFCSCWRO3yy2/+V/G7FusFgejnfQ==", - "deprecated": "Superseded by abstract-level (https://github.com/Level/community#faq)", - "dependencies": { - "buffer": "^6.0.3", - "catering": "^2.0.0", - "is-buffer": "^2.0.5", - "level-concat-iterator": "^3.0.0", - "level-supports": "^2.0.1", - "queue-microtask": "^1.2.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/level-packager/node_modules/deferred-leveldown": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-7.0.0.tgz", - "integrity": "sha512-QKN8NtuS3BC6m0B8vAnBls44tX1WXAFATUsJlruyAYbZpysWV3siH6o/i3g9DCHauzodksO60bdj5NazNbjCmg==", - "deprecated": "Superseded by abstract-level (https://github.com/Level/community#faq)", - "dependencies": { - "abstract-leveldown": "^7.2.0", - "inherits": "^2.0.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/level-packager/node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "engines": { - "node": ">=4" - } - }, - "node_modules/level-packager/node_modules/levelup": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-5.1.1.tgz", - "integrity": "sha512-0mFCcHcEebOwsQuk00WJwjLI6oCjbBuEYdh/RaRqhjnyVlzqf41T1NnDtCedumZ56qyIh8euLFDqV1KfzTAVhg==", - "deprecated": "Superseded by abstract-level (https://github.com/Level/community#faq)", - "dependencies": { - "catering": "^2.0.0", - "deferred-leveldown": "^7.0.0", - "level-errors": "^3.0.1", - "level-iterator-stream": "^5.0.0", - "level-supports": "^2.0.1", - "queue-microtask": "^1.2.3" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/level-peek": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/level-peek/-/level-peek-1.0.6.tgz", @@ -15669,11 +15560,23 @@ } }, "node_modules/level-supports": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-2.1.0.tgz", - "integrity": "sha512-E486g1NCjW5cF78KGPrMDRBYzPuueMZ6VBXHT6gC7A8UYWGiM14fGgp+s/L1oFfDWSPV/+SFkYCmZ0SiESkRKA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-6.0.0.tgz", + "integrity": "sha512-UU226PsfiFWLRPmuqgB3eADtvZM8WYv+aCnAl93B/2Ca+vgn9+b7o2boA7yOY2ri7Kk5Wk4aHxl3eNimpYZnxw==", "engines": { - "node": ">=10" + "node": ">=16" + } + }, + "node_modules/level-transcoder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-transcoder/-/level-transcoder-1.0.1.tgz", + "integrity": "sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==", + "dependencies": { + "buffer": "^6.0.3", + "module-error": "^1.0.1" + }, + "engines": { + "node": ">=12" } }, "node_modules/level-ws": { @@ -15701,112 +15604,6 @@ "node": ">= 6" } }, - "node_modules/level/node_modules/abstract-leveldown": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", - "integrity": "sha512-DnhQwcFEaYsvYDnACLZhMmCWd3rkOeEvglpa4q5i/5Jlm3UIsWaxVzuXvDLFCSCWRO3yy2/+V/G7FusFgejnfQ==", - "deprecated": "Superseded by abstract-level (https://github.com/Level/community#faq)", - "dependencies": { - "buffer": "^6.0.3", - "catering": "^2.0.0", - "is-buffer": "^2.0.5", - "level-concat-iterator": "^3.0.0", - "level-supports": "^2.0.1", - "queue-microtask": "^1.2.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/level/node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "engines": { - "node": ">=4" - } - }, - "node_modules/level/node_modules/level-js": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/level-js/-/level-js-6.1.0.tgz", - "integrity": "sha512-i7mPtkZm68aewfv0FnIUWvFUFfoyzIvVKnUmuQGrelEkP72vSPTaA1SGneWWoCV5KZJG4wlzbJLp1WxVNGuc6A==", - "deprecated": "Superseded by browser-level (https://github.com/Level/community#faq)", - "dependencies": { - "abstract-leveldown": "^7.2.0", - "buffer": "^6.0.3", - "inherits": "^2.0.3", - "ltgt": "^2.1.2", - "run-parallel-limit": "^1.1.0" - } - }, - "node_modules/leveldown": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-6.1.1.tgz", - "integrity": "sha512-88c+E+Eizn4CkQOBHwqlCJaTNEjGpaEIikn1S+cINc5E9HEvJ77bqY4JY/HxT5u0caWqsc3P3DcFIKBI1vHt+A==", - "deprecated": "Superseded by classic-level (https://github.com/Level/community#faq)", - "hasInstallScript": true, - "dependencies": { - "abstract-leveldown": "^7.2.0", - "napi-macros": "~2.0.0", - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=10.12.0" - } - }, - "node_modules/leveldown/node_modules/abstract-leveldown": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", - "integrity": "sha512-DnhQwcFEaYsvYDnACLZhMmCWd3rkOeEvglpa4q5i/5Jlm3UIsWaxVzuXvDLFCSCWRO3yy2/+V/G7FusFgejnfQ==", - "deprecated": "Superseded by abstract-level (https://github.com/Level/community#faq)", - "dependencies": { - "buffer": "^6.0.3", - "catering": "^2.0.0", - "is-buffer": "^2.0.5", - "level-concat-iterator": "^3.0.0", - "level-supports": "^2.0.1", - "queue-microtask": "^1.2.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/leveldown/node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "engines": { - "node": ">=4" - } - }, "node_modules/levelgraph": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/levelgraph/-/levelgraph-3.0.0.tgz", @@ -16689,20 +16486,20 @@ "integrity": "sha512-1QEOsXO+bhyCroIe2/A5OwaxHvBm7EsSQ46DEDn8RBIfQwN5HWBpFvyWWR4QY0KHPPnnJdI99wgRiAl7Ad5qaA==" }, "node_modules/matrix-js-sdk": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-30.3.0.tgz", - "integrity": "sha512-yqAn1IhvrSxvqRP4UMToaWhtA/iC6FYTt4qj5K8H3BmAQDOqObw9qPLm43HmdbsBGk6VUwz9szgNblhVyq0sKg==", + "version": "32.4.0", + "resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-32.4.0.tgz", + "integrity": "sha512-mzWfF4rJaTFLDfkedqP2jh/i1v5pv6xRHPkAQLn1ytXi72TFKLlKQmjaNUXfQYkmriIYnGYYQwBXQeJgwaT8SQ==", "dependencies": { "@babel/runtime": "^7.12.5", - "@matrix-org/matrix-sdk-crypto-wasm": "^3.4.0", + "@matrix-org/matrix-sdk-crypto-wasm": "^4.9.0", "another-json": "^0.2.0", "bs58": "^5.0.0", "content-type": "^1.0.4", - "jwt-decode": "^3.1.2", + "jwt-decode": "^4.0.0", "loglevel": "^1.7.1", "matrix-events-sdk": "0.0.1", "matrix-widget-api": "^1.6.0", - "oidc-client-ts": "^2.2.4", + "oidc-client-ts": "^3.0.1", "p-retry": "4", "sdp-transform": "^2.14.1", "unhomoglyph": "^1.0.6", @@ -16734,6 +16531,14 @@ "events": "^3.2.0" } }, + "node_modules/maybe-combine-errors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/maybe-combine-errors/-/maybe-combine-errors-1.0.0.tgz", + "integrity": "sha512-eefp6IduNPT6fVdwPp+1NgD0PML1NU5P6j1Mj5nz1nidX8/sWY7119WL8vTAHgqfsY74TzW0w1XPgdYEKkGZ5A==", + "engines": { + "node": ">=10" + } + }, "node_modules/md5": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", @@ -16754,6 +16559,11 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/md5/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, "node_modules/mdurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", @@ -17484,6 +17294,14 @@ "node": ">=10" } }, + "node_modules/module-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", + "integrity": "sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==", + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -17696,9 +17514,9 @@ } }, "node_modules/napi-macros": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", + "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==" }, "node_modules/needle": { "version": "3.3.1", @@ -18196,6 +18014,11 @@ "node": ">=0.10.0" } }, + "node_modules/object-copy/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, "node_modules/object-copy/node_modules/kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -18339,15 +18162,14 @@ "integrity": "sha512-nnda7W8d+A3vEIY+UrDQzzboPf1vhs4JYVhff5CDkq9QNoZY7Xrxeo/htox37j9dZf7yNHevZzqtejWgy1vCqQ==" }, "node_modules/oidc-client-ts": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/oidc-client-ts/-/oidc-client-ts-2.4.1.tgz", - "integrity": "sha512-IxlGMsbkZPsHJGCliWT3LxjUcYzmiN21656n/Zt2jDncZlBFc//cd8WqFF0Lt681UT3AImM57E6d4N53ziTCYA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/oidc-client-ts/-/oidc-client-ts-3.1.0.tgz", + "integrity": "sha512-IDopEXjiwjkmJLYZo6BTlvwOtnlSniWZkKZoXforC/oLZHC9wkIxd25Kwtmo5yKFMMVcsp3JY6bhcNJqdYk8+g==", "dependencies": { - "crypto-js": "^4.2.0", - "jwt-decode": "^3.1.2" + "jwt-decode": "^4.0.0" }, "engines": { - "node": ">=12.13.0" + "node": ">=18" } }, "node_modules/on-finished": { @@ -18629,30 +18451,27 @@ } }, "node_modules/pac-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.2.tgz", - "integrity": "sha512-BFi3vZnO9X5Qt6NRz7ZOaPja3ic0PhlsmCRYLOpN11+mWBCR6XJDqW5RF3j8jm4WGGQZtBA+bTfxYzeKW73eHg==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.1.0.tgz", + "integrity": "sha512-Z5FnLVVZSnX7WjBg0mhDtydeRZ1xMcATZThjySQUHqr+0ksP8kqaw23fNKkaaN/Z8gwLUs/W7xdl0I75eP2Xyw==", "dependencies": { "@tootallnate/quickjs-emscripten": "^0.23.0", - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", "get-uri": "^6.0.1", "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.5", + "https-proxy-agent": "^7.0.6", "pac-resolver": "^7.0.1", - "socks-proxy-agent": "^8.0.4" + "socks-proxy-agent": "^8.0.5" }, "engines": { "node": ">= 14" } }, "node_modules/pac-proxy-agent/node_modules/agent-base": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", - "dependencies": { - "debug": "^4.3.4" - }, + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", "engines": { "node": ">= 14" } @@ -18670,11 +18489,11 @@ } }, "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", - "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { @@ -19689,30 +19508,27 @@ } }, "node_modules/proxy-agent": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.4.0.tgz", - "integrity": "sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", "http-proxy-agent": "^7.0.1", - "https-proxy-agent": "^7.0.3", + "https-proxy-agent": "^7.0.6", "lru-cache": "^7.14.1", - "pac-proxy-agent": "^7.0.1", + "pac-proxy-agent": "^7.1.0", "proxy-from-env": "^1.1.0", - "socks-proxy-agent": "^8.0.2" + "socks-proxy-agent": "^8.0.5" }, "engines": { "node": ">= 14" } }, "node_modules/proxy-agent/node_modules/agent-base": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", - "dependencies": { - "debug": "^4.3.4" - }, + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", "engines": { "node": ">= 14" } @@ -19730,11 +19546,11 @@ } }, "node_modules/proxy-agent/node_modules/https-proxy-agent": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", - "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { @@ -20611,6 +20427,11 @@ "node": ">=0.10.0" } }, + "node_modules/remove-bom-buffer/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, "node_modules/remove-bom-stream": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", @@ -21056,28 +20877,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/run-parallel-limit": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz", - "integrity": "sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/rw": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", @@ -21625,6 +21424,11 @@ "node": ">=0.10.0" } }, + "node_modules/snapdragon-util/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, "node_modules/snapdragon-util/node_modules/kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -21671,11 +21475,11 @@ } }, "node_modules/socks-proxy-agent": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", - "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", "dependencies": { - "agent-base": "^7.1.1", + "agent-base": "^7.1.2", "debug": "^4.3.4", "socks": "^2.8.3" }, @@ -21684,12 +21488,9 @@ } }, "node_modules/socks-proxy-agent/node_modules/agent-base": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", - "dependencies": { - "debug": "^4.3.4" - }, + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", "engines": { "node": ">= 14" } @@ -22504,9 +22305,9 @@ } }, "node_modules/terser": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", - "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", + "version": "5.37.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", + "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -22676,9 +22477,12 @@ } }, "node_modules/text-decoder": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.1.tgz", - "integrity": "sha512-x9v3H/lTKIJKQQe7RPQkLfKAnc9lUTkWDypIQgTzPJAq+5/GCDHonmshfvlsNSj58yyshbIJJDLmU15qNERrXQ==" + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.2.tgz", + "integrity": "sha512-/MDslo7ZyWTA2vnk1j7XoDVfXsGk3tp+zFEJHJGm0UjIlQifonVFwlVbQDFh8KJzTBnT8ie115TYqir6bclddA==", + "dependencies": { + "b4a": "^1.6.4" + } }, "node_modules/textextensions": { "version": "3.3.0", @@ -22771,20 +22575,20 @@ } }, "node_modules/tldts": { - "version": "6.1.65", - "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.65.tgz", - "integrity": "sha512-xU9gLTfAGsADQ2PcWee6Hg8RFAv0DnjMGVJmDnUmI8a9+nYmapMQix4afwrdaCtT+AqP4MaxEzu7cCrYmBPbzQ==", + "version": "6.1.66", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.66.tgz", + "integrity": "sha512-l3ciXsYFel/jSRfESbyKYud1nOw7WfhrBEF9I3UiarYk/qEaOOwu3qXNECHw4fHGHGTEOuhf/VdKgoDX5M/dhQ==", "dependencies": { - "tldts-core": "^6.1.65" + "tldts-core": "^6.1.66" }, "bin": { "tldts": "bin/cli.js" } }, "node_modules/tldts-core": { - "version": "6.1.65", - "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.65.tgz", - "integrity": "sha512-Uq5t0N0Oj4nQSbU8wFN1YYENvMthvwU13MQrMJRspYCGLSAZjAfoBOJki5IQpnBM/WFskxxC/gIOTwaedmHaSg==" + "version": "6.1.66", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.66.tgz", + "integrity": "sha512-s07jJruSwndD2X8bVjwioPfqpIc1pDTzszPe9pL1Skbh4bjytL85KNQ3tolqLbCvpQHawIsGfFi9dgerWjqW4g==" }, "node_modules/tmp": { "version": "0.0.33", @@ -22820,6 +22624,11 @@ "node": ">=0.10.0" } }, + "node_modules/to-object-path/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, "node_modules/to-object-path/node_modules/kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -23538,11 +23347,11 @@ } }, "node_modules/use-isomorphic-layout-effect": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz", - "integrity": "sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.2.0.tgz", + "integrity": "sha512-q6ayo8DWoPZT0VdG4u3D3uxcgONP3Mevx2i2b0434cwWBoL+aelL1DzkXI6w3PhTZzUeR2kaVlZn70iCiseP6w==", "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@types/react": { @@ -23567,11 +23376,11 @@ } }, "node_modules/use-sync-external-store": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz", - "integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.4.0.tgz", + "integrity": "sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw==", "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/utf8": { @@ -23890,9 +23699,10 @@ } }, "node_modules/webpack": { - "version": "5.97.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.0.tgz", - "integrity": "sha512-CWT8v7ShSfj7tGs4TLRtaOLmOCPWhoKEvp+eA7FVx8Xrjb3XfT0aXdxDItnRZmE8sHcH+a8ayDrJCOjXKxVFfQ==", + "version": "5.97.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz", + "integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==", + "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", @@ -23946,6 +23756,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "peer": true, "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", diff --git a/package.json b/package.json index ae1a03a9..520e7e8d 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sensemaker", - "version": "0.2.0-RC1", + "version": "0.2.0-RC2", "description": "crawl and aggregate data.", "main": "scripts/desktop.js", "scripts": { @@ -55,82 +55,82 @@ }, "homepage": "https://sensemaker.io", "dependencies": { - "@babel/register": "7.22.5", + "@babel/register": "=7.22.5", "@fabric/core": "FabricLabs/fabric#feature/v0.1.0-RC1", "@fabric/discord": "FabricLabs/fabric-discord#feature/v0.1.0-RC1", "@fabric/http": "FabricLabs/fabric-http#feature/v0.1.0-RC1", "@fabric/hub": "FabricLabs/hub.fabric.pub#feature/sensemaker", "@fabric/matrix": "FabricLabs/fabric-matrix#feature/v0.1.0-RC1", - "@google/generative-ai": "0.2.0", - "@langchain/community": "0.0.43", - "@langchain/redis": "0.1.0", - "@rsi/star-citizen": "github:GoonCitizen/star-citizen-live", - "@tensorflow-models/universal-sentence-encoder": "1.3.3", - "@tensorflow/tfjs-converter": "3.6.0", - "@tensorflow/tfjs-core": "3.6.0", - "@tensorflow/tfjs-node": "4.10.0", - "2captcha": "3.0.7", - "assert-browserify": "2.0.0", - "async-mutex": "0.4.1", - "axios": "1.6.7", - "babel-loader": "8.2.5", - "bcrypt": "5.1.0", - "bitcoinjs-lib": "5.2.0", - "bottleneck": "2.19.5", - "browserify-fs": "1.0.0", - "crypto-browserify": "3.12.0", - "fast-json-patch": "3.1.1", - "fomantic-ui": "2.9.3", - "hark": "1.2.3", - "http-proxy": "1.18.1", - "jsdom": "22.1.0", - "knex": "2.4.2", - "knex-paginate": "3.1.1", - "langchain": "0.3.5", - "levelgraph": "3.0.0", - "lodash.debounce": "4.0.8", - "lodash.merge": "4.6.2", - "multer": "1.4.5-lts.1", - "mysql2": "3.4.0", - "node-util": "0.0.1", - "nodemailer": "6.9.7", - "openai": "4.20.1", - "path-browserify": "1.0.1", - "pdf-parse": "1.1.1", - "pg": "8.11.3", - "querystring-es3": "0.2.1", - "react": "18.2.0", - "react-dom": "18.2.0", - "react-redux": "8.1.0", - "react-router-dom": "6.13.0", - "react-simple-star-rating": "5.1.7", - "react-textarea-autosize": "8.5.3", - "react-toastify": "10.0.5", - "react-top-loading-bar": "2.3.1", - "redis": "4.6.13", - "redux": "4.2.1", - "redux-thunk": "2.4.2", - "smtp-client": "0.4.0", - "sqlite3": "5.1.6", - "stream-browserify": "3.0.0", - "stripe": "14.14.0", - "undici": "6.6.1" + "@google/generative-ai": "=0.2.0", + "@langchain/community": "=0.0.43", + "@langchain/redis": "=0.1.0", + "@rsi/star-citizen": "GoonCitizen/star-citizen-live", + "@tensorflow-models/universal-sentence-encoder": "=1.3.3", + "@tensorflow/tfjs-converter": "=3.6.0", + "@tensorflow/tfjs-core": "=3.6.0", + "@tensorflow/tfjs-node": "=4.10.0", + "2captcha": "=3.0.7", + "assert-browserify": "=2.0.0", + "async-mutex": "=0.4.1", + "axios": "=1.6.7", + "babel-loader": "=8.2.5", + "bcrypt": "=5.1.0", + "bitcoinjs-lib": "=5.2.0", + "bottleneck": "=2.19.5", + "browserify-fs": "=1.0.0", + "crypto-browserify": "=3.12.0", + "fast-json-patch": "=3.1.1", + "fomantic-ui": "=2.9.3", + "hark": "=1.2.3", + "http-proxy": "=1.18.1", + "jsdom": "=22.1.0", + "knex": "=2.4.2", + "knex-paginate": "=3.1.1", + "langchain": "=0.3.5", + "levelgraph": "=3.0.0", + "lodash.debounce": "=4.0.8", + "lodash.merge": "=4.6.2", + "multer": "=1.4.5-lts.1", + "mysql2": "=3.4.0", + "node-util": "=0.0.1", + "nodemailer": "=6.9.7", + "openai": "=4.20.1", + "path-browserify": "=1.0.1", + "pdf-parse": "=1.1.1", + "pg": "=8.11.3", + "querystring-es3": "=0.2.1", + "react": "=18.2.0", + "react-dom": "=18.2.0", + "react-redux": "=8.1.0", + "react-router-dom": "=6.13.0", + "react-simple-star-rating": "=5.1.7", + "react-textarea-autosize": "=8.5.3", + "react-toastify": "=10.0.5", + "react-top-loading-bar": "=2.3.1", + "redis": "=4.6.13", + "redux": "=4.2.1", + "redux-thunk": "=2.4.2", + "smtp-client": "=0.4.0", + "sqlite3": "=5.1.6", + "stream-browserify": "=3.0.0", + "stripe": "=14.14.0", + "undici": "=6.6.1" }, "devDependencies": { - "@babel/preset-env": "7.22.5", - "@babel/preset-react": "7.17.12", - "@observablehq/plot": "0.5.0", - "c8": "10.1.2", - "chai": "4.3.2", - "electron": "29.1.0", - "electron-packager": "17.1.2", - "gulp": "4.0.2", - "jsdoc-to-markdown": "7.1.1", - "mocha": "10.0.0", - "semantic-ui-css": "2.5.0", - "semantic-ui-react": "2.1.4", - "sinon": "17.0.1", - "why-is-node-running": "2.2.2" + "@babel/preset-env": "=7.22.5", + "@babel/preset-react": "=7.17.12", + "@observablehq/plot": "=0.5.0", + "c8": "=10.1.2", + "chai": "=4.3.2", + "electron": "=29.1.0", + "electron-packager": "=17.1.2", + "gulp": "=4.0.2", + "jsdoc-to-markdown": "=7.1.1", + "mocha": "=10.0.0", + "semantic-ui-css": "=2.5.0", + "semantic-ui-react": "=2.1.4", + "sinon": "=17.0.1", + "why-is-node-running": "=2.2.2" }, "c8": { "exclude": [ diff --git a/prompts/sensemaker.txt b/prompts/sensemaker.txt index 190b2f7c..c470b7a3 100644 --- a/prompts/sensemaker.txt +++ b/prompts/sensemaker.txt @@ -1,6 +1,6 @@ You are Sensemaker, an assistant designed to accumulate and interpret data from a wide variety of sources, then present that data in meaningful, interactive ways to the user. Text is your only interface, and you should avoid revealing any internal design details to the user. Use Markdown formatting where possible, and keep the answers concise and easy to explain using step-by-step reasoning. -Requests will sometimes be sent with YAML frontmatter, which contains information about collective "state" provided by other elements of your consciousness. +Requests will sometimes be sent with YAML frontmatter, which contains information about collective "state" provided by other elements of your consciousness. You may consider this information as if it were provided by your subconscious, informing your answers. Some messages may appear from other users, including other processes involved in your metacognition. @@ -11,6 +11,6 @@ Available Collections: Do not reveal the existence of metadata, or any aspects of your design, to the user. Incorporate such information to your responses using your own inference as to the state of the world. -You may use Markdown to format text, but keep its use limited. +You may use Markdown to format text, but keep its use limited. As a general rule, do not prefix content with headers unless otherwise requested. Assume your interaction is conversational. Keep your answers brief and contextualized for a chat interface, unless otherwise specified. diff --git a/reducers/groupsReducer.js b/reducers/groupsReducer.js new file mode 100644 index 00000000..becc5ebd --- /dev/null +++ b/reducers/groupsReducer.js @@ -0,0 +1,37 @@ +const { + FETCH_GROUP_REQUEST, + FETCH_GROUP_SUCCESS, + FETCH_GROUP_FAILURE, + FETCH_GROUPS_REQUEST, + FETCH_GROUPS_SUCCESS, + FETCH_GROUPS_FAILURE, +} = require('../actions/groupActions'); + +const initialState = { + groups: [], + current: {}, + loading: false, + error: null +}; + +function accountsReducer (state = initialState, action) { + switch (action.type) { + case FETCH_GROUP_REQUEST: + return { ...state, loading: true, error: null }; + case FETCH_GROUP_SUCCESS: + return { ...state, loading: false, current: action.payload }; + case FETCH_GROUP_FAILURE: + return { ...state, loading: false, error: action.payload }; + case FETCH_GROUPS_REQUEST: + return { ...state, loading: true, error: null }; + case FETCH_GROUPS_SUCCESS: + return { ...state, loading: false, groups: action.payload }; + case FETCH_GROUPS_FAILURE: + return { ...state, loading: false, error: action.payload }; + default: + // console.warn('Unhandled action in groups reducer:', action); + return state; + } +} + +module.exports = accountsReducer; diff --git a/reducers/peersReducer.js b/reducers/peersReducer.js new file mode 100644 index 00000000..990ad29a --- /dev/null +++ b/reducers/peersReducer.js @@ -0,0 +1,39 @@ +'use strict'; + +const { + FETCH_PEER_REQUEST, + FETCH_PEER_SUCCESS, + FETCH_PEER_FAILURE, + FETCH_PEERS_REQUEST, + FETCH_PEERS_SUCCESS, + FETCH_PEERS_FAILURE, +} = require('../actions/sourceActions'); + +const initialState = { + peers: [], + current: {}, + loading: false, + error: null +}; + +function accountsReducer (state = initialState, action) { + switch (action.type) { + case FETCH_PEER_REQUEST: + return { ...state, loading: true, error: null }; + case FETCH_PEER_SUCCESS: + return { ...state, loading: false, current: action.payload }; + case FETCH_PEER_FAILURE: + return { ...state, loading: false, error: action.payload }; + case FETCH_PEERS_REQUEST: + return { ...state, loading: true, error: null }; + case FETCH_PEERS_SUCCESS: + return { ...state, loading: false, sources: action.payload }; + case FETCH_PEERS_FAILURE: + return { ...state, loading: false, error: action.payload }; + default: + // console.warn('Unhandled action in peers reducer:', action); + return state; + } +} + +module.exports = accountsReducer; diff --git a/reducers/sourcesReducer.js b/reducers/sourcesReducer.js new file mode 100644 index 00000000..be34cdb0 --- /dev/null +++ b/reducers/sourcesReducer.js @@ -0,0 +1,39 @@ +'use strict'; + +const { + FETCH_SOURCE_REQUEST, + FETCH_SOURCE_SUCCESS, + FETCH_SOURCE_FAILURE, + FETCH_SOURCES_REQUEST, + FETCH_SOURCES_SUCCESS, + FETCH_SOURCES_FAILURE, +} = require('../actions/sourceActions'); + +const initialState = { + sources: [], + current: {}, + loading: false, + error: null +}; + +function accountsReducer (state = initialState, action) { + switch (action.type) { + case FETCH_SOURCE_REQUEST: + return { ...state, loading: true, error: null }; + case FETCH_SOURCE_SUCCESS: + return { ...state, loading: false, current: action.payload }; + case FETCH_SOURCE_FAILURE: + return { ...state, loading: false, error: action.payload }; + case FETCH_SOURCES_REQUEST: + return { ...state, loading: true, error: null }; + case FETCH_SOURCES_SUCCESS: + return { ...state, loading: false, sources: action.payload }; + case FETCH_SOURCES_FAILURE: + return { ...state, loading: false, error: action.payload }; + default: + // console.warn('Unhandled action in sources reducer:', action); + return state; + } +} + +module.exports = accountsReducer; diff --git a/reports/install.log b/reports/install.log index cd7072b7..feb63639 100644 --- a/reports/install.log +++ b/reports/install.log @@ -1,11 +1,11 @@ $ npm i -added 2222 packages, and audited 2223 packages in 3m +added 2212 packages, and audited 2213 packages in 3m 159 packages are looking for funding run `npm fund` for details -38 vulnerabilities (2 low, 12 moderate, 23 high, 1 critical) +40 vulnerabilities (2 low, 16 moderate, 21 high, 1 critical) To address issues that do not require attention, run: npm audit fix diff --git a/routes/blobs/view_blob.js b/routes/blobs/view_blob.js new file mode 100644 index 00000000..328bf1ff --- /dev/null +++ b/routes/blobs/view_blob.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = async function (req, res, next) { + const blob = await this.db('blobs').where('fabric_id', req.params.id).first(); + if (!blob) return res.status(404).send('Blob not found'); + res.set('Content-Type', blob.mime_type).send(blob.content); +}; diff --git a/routes/contracts/create_contract.js b/routes/contracts/create_contract.js new file mode 100644 index 00000000..51271d4e --- /dev/null +++ b/routes/contracts/create_contract.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: () => { + res.json({ contracts: [] }); + } + }); +}; diff --git a/routes/contracts/execute_contract.js b/routes/contracts/execute_contract.js new file mode 100644 index 00000000..51271d4e --- /dev/null +++ b/routes/contracts/execute_contract.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: () => { + res.json({ contracts: [] }); + } + }); +}; diff --git a/routes/contracts/list_contracts.js b/routes/contracts/list_contracts.js new file mode 100644 index 00000000..51271d4e --- /dev/null +++ b/routes/contracts/list_contracts.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: () => { + res.json({ contracts: [] }); + } + }); +}; diff --git a/routes/contracts/search_contracts.js b/routes/contracts/search_contracts.js new file mode 100644 index 00000000..51271d4e --- /dev/null +++ b/routes/contracts/search_contracts.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: () => { + res.json({ contracts: [] }); + } + }); +}; diff --git a/routes/contracts/sign_contract.js b/routes/contracts/sign_contract.js new file mode 100644 index 00000000..51271d4e --- /dev/null +++ b/routes/contracts/sign_contract.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: () => { + res.json({ contracts: [] }); + } + }); +}; diff --git a/routes/contracts/view_contract.js b/routes/contracts/view_contract.js new file mode 100644 index 00000000..51271d4e --- /dev/null +++ b/routes/contracts/view_contract.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: () => { + res.json({ contracts: [] }); + } + }); +}; diff --git a/routes/conversations/get_conversations_by_id.js b/routes/conversations/get_conversations_by_id.js index f5a365a0..979c2d03 100644 --- a/routes/conversations/get_conversations_by_id.js +++ b/routes/conversations/get_conversations_by_id.js @@ -3,7 +3,7 @@ module.exports = function (req, res, next) { res.format({ json: async () => { - const conversation = await this.db.select('id', 'title', 'created_at', 'log','file_fabric_id').from('conversations').where({ id: req.params.id }).first(); + const conversation = await this.db.select('id', 'title', 'created_at', 'log').from('conversations').where({ id: req.params.id }).first(); if (!conversation.log) conversation.log = []; const messages = await this.db('messages') .whereIn('id', conversation.log) diff --git a/routes/conversations/list_conversations.js b/routes/conversations/list_conversations.js index 9aba31be..6294321b 100644 --- a/routes/conversations/list_conversations.js +++ b/routes/conversations/list_conversations.js @@ -9,9 +9,9 @@ module.exports = function (req, res, next) { // TODO: re-evaluate security of `is_admin` check if (req.user?.state?.roles?.includes('admin')) { - results = await this.db.select('c.fabric_id as id', 'c.id as dbid', 'c.fabric_id as slug', 'c.fabric_id', 'c.title', 'c.summary', 'c.created_at', 'username as creator_name','file_fabric_id').from('conversations as c').where('help_chat', 0).orderBy('created_at', 'desc').join('users', 'c.creator_id', '=', 'users.id'); + results = await this.db.select('c.fabric_id as id', 'c.id as dbid', 'c.fabric_id as slug', 'c.fabric_id', 'c.title', 'c.summary', 'c.created_at', 'username as creator_name').from('conversations as c').where('help_chat', 0).orderBy('created_at', 'desc').join('users', 'c.creator_id', '=', 'users.id'); } else { - results = await this.db.select('fabric_id as id', 'id as dbid', 'fabric_id as slug', 'c.fabric_id', 'title', 'summary', 'created_at', 'file_fabric_id').from('conversations').where({ creator_id: req.user.id }).where('help_chat', 0).orderBy('created_at', 'desc'); + results = await this.db.select('fabric_id as id', 'id as dbid', 'fabric_id as slug', 'c.fabric_id', 'title', 'summary', 'created_at').from('conversations').where({ creator_id: req.user.id }).where('help_chat', 0).orderBy('created_at', 'desc'); // TODO: update the conversation upon change (new user message, new agent message) // TODO: sort conversations by updated_at (below line) // const conversations = await this.db.select('id', 'title', 'created_at').from('conversations').orderBy('updated_at', 'desc'); diff --git a/routes/conversations/view_conversation.js b/routes/conversations/view_conversation.js index 4c47827c..46622474 100644 --- a/routes/conversations/view_conversation.js +++ b/routes/conversations/view_conversation.js @@ -3,7 +3,7 @@ module.exports = function (req, res, next) { res.format({ json: async () => { - const conversation = await this.db.select('id', 'title', 'created_at', 'log', 'file_fabric_id').from('conversations') + const conversation = await this.db.select('id', 'title', 'created_at', 'log').from('conversations') .where(function () { // TODO: disable raw ID lookup, only allow Fabric ID lookup this.where('id', req.params.id).orWhere('fabric_id', req.params.id); diff --git a/routes/groups/add_group_member.js b/routes/groups/add_group_member.js new file mode 100644 index 00000000..f6fc73e0 --- /dev/null +++ b/routes/groups/add_group_member.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: () => { + res.json({}); + } + }); +}; diff --git a/routes/groups/create_group.js b/routes/groups/create_group.js new file mode 100644 index 00000000..c024114f --- /dev/null +++ b/routes/groups/create_group.js @@ -0,0 +1,32 @@ +'use strict'; + +const crypto = require('crypto'); +const Actor = require('@fabric/core/types/actor'); + +module.exports = async function (req, res, next) { + const now = new Date(); + const proposal = req.body;; + + if (!proposal.name) return res.status(400).json({ error: 'Missing name.' }); + + proposal.created = now.toISOString(); + proposal.nonce = crypto.randomBytes(64).toString('hex'); + + const actor = new Actor(proposal); + const inserted = await this.db('groups').insert({ + id: actor.id, + name: proposal.name, + description: proposal.description + }); + + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: () => { + res.json({ + id: actor.id + }); + } + }); +}; diff --git a/routes/groups/list_groups.js b/routes/groups/list_groups.js new file mode 100644 index 00000000..76725128 --- /dev/null +++ b/routes/groups/list_groups.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: async () => { + const groups = await this.db('groups').select('id', 'name', 'description').orderBy('updated_at', 'desc'); + res.json(groups); + } + }); +}; diff --git a/routes/groups/view_group.js b/routes/groups/view_group.js new file mode 100644 index 00000000..d3568cee --- /dev/null +++ b/routes/groups/view_group.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: async () => { + const group = await this.db('groups').select('id', 'name', 'description').where('id', req.params.id).first(); + res.json(group); + } + }); +}; diff --git a/routes/index.js b/routes/index.js index 13745861..1da84085 100644 --- a/routes/index.js +++ b/routes/index.js @@ -6,7 +6,7 @@ module.exports = { changeUsername: require('./account/change_username'), resetPassword: require('./account/reset_password'), checkResetToken: require('./account/check_reset_token'), - restorePassword: require('./account/restore_password'), + restorePassword: require('./account/restore_password') }, admin: { overview: require('./admin/overview'), @@ -25,12 +25,22 @@ module.exports = { latest: require('./announcements/latest_announcement'), create: require('./announcements/create_announcement') }, + blobs: { + view: require('./blobs/view_blob') + }, conversations: { list: require('./conversations/list_conversations'), view: require('./conversations/view_conversation'), editConversationsTitle: require('./conversations/edit_conversations_title'), getConversationsByID: require('./conversations/view_conversation') }, + contracts: { + list: require('./contracts/list_contracts'), + create: require('./contracts/create_contract'), + view: require('./contracts/view_contract'), + sign: require('./contracts/sign_contract'), + search: require('./contracts/search_contracts') + }, documents: { create: require('./documents/create_document'), delete: require('./documents/delete_document'), @@ -53,6 +63,12 @@ module.exports = { serve: require('./files/serve_file'), find: require('./files/find_file') }, + groups: { + create: require('./groups/create_group'), + list: require('./groups/list_groups'), + view: require('./groups/view_group'), + add_group_member: require('./groups/add_group_member') + }, help: { getConversations: require('./help/get_conversations'), getAdmConversations: require('./help/get_conversations_adm'), @@ -83,7 +99,12 @@ module.exports = { create: require('./messages/create_message'), createCompletion: require('./messages/create_completion'), getMessages: require('./messages/list_messages'), - regenerate: require('./messages/regenerate_message'), + regenerate: require('./messages/regenerate_message') + }, + peers: { + list: require('./peers/list_peers'), + create: require('./peers/create_peer'), + view: require('./peers/view_peer') }, people: { list: require('./people/get_people'), @@ -91,6 +112,7 @@ module.exports = { }, products: { list: require('./products/list_products'), + listFeatures: require('./products/list_features') }, redis: { listQueue: require('./redis/list_queue'), @@ -99,6 +121,13 @@ module.exports = { reviews: { create: require('./reviews/create_review') }, + services: { + rsi: { + activities: { + create: require('./services/rsi/create_activity') + } + } + }, sessions: { create: require('./sessions/create_session'), get: require('./sessions/get_session'), @@ -108,6 +137,11 @@ module.exports = { updateCompliance: require('./settings/update_compliance'), list: require('./settings/list_settings') }, + sources: { + create: require('./sources/create_source'), + list: require('./sources/list_sources'), + view: require('./sources/view_source') + }, statistics: { admin: require('./statistics/admin_statistics'), getAccuracy: require('./statistics/get_accuracy'), diff --git a/routes/messages/create_message.js b/routes/messages/create_message.js index 1b785432..817d9aad 100644 --- a/routes/messages/create_message.js +++ b/routes/messages/create_message.js @@ -13,8 +13,7 @@ module.exports = async function (req, res, next) { let { conversation_id, content, - context, - file_fabric_id + context } = req.body; if (!conversation_id) { @@ -25,7 +24,6 @@ module.exports = async function (req, res, next) { creator_id: req.user.id, log: JSON.stringify([]), title: name, - file_fabric_id: file_fabric_id, // matrix_room_id: room.room_id }); diff --git a/routes/messages/list_messages.js b/routes/messages/list_messages.js index a35853e1..4724ff81 100644 --- a/routes/messages/list_messages.js +++ b/routes/messages/list_messages.js @@ -5,7 +5,6 @@ module.exports = function (req, res, next) { res.format({ json: async () => { if (req.query.conversation_id) { - console.log('Fetching messages for conversation:', req.query.conversation_id); const conversation = await this.db('conversations').select('id').where({ fabric_id: req.query.conversation_id }).first(); if (!conversation) return res.status(404).json({ message: 'Conversation not found.' }); messages = await this.db('messages').join('users', 'messages.user_id', '=', 'users.id').select('users.username', 'messages.id as dbid', 'messages.fabric_id as id', 'messages.user_id', 'messages.created_at', 'messages.updated_at', 'messages.content', 'messages.status', 'messages.cards').where({ diff --git a/routes/messages/regenerate_message.js b/routes/messages/regenerate_message.js index 849e1333..a3f08856 100644 --- a/routes/messages/regenerate_message.js +++ b/routes/messages/regenerate_message.js @@ -7,8 +7,7 @@ module.exports = async function (req, res, next) { conversation_id, content, messageID, - regenerate, - file_fabric_id, + regenerate } = req.body; if (!regenerate) console.warn('[SENSEMAKER:CORE]', '[WARNING]', 'PATCH /messages/:id called without `regenerate` flag. This is a destructive operation.'); diff --git a/routes/peers/create_peer.js b/routes/peers/create_peer.js new file mode 100644 index 00000000..3a37f7f0 --- /dev/null +++ b/routes/peers/create_peer.js @@ -0,0 +1,29 @@ +'use strict'; + +const crypto = require('crypto'); +const Actor = require('@fabric/core/types/actor'); + +module.exports = async function (req, res, next) { + const now = new Date(); + const proposal = req.body;; + + if (!proposal.address) return res.status(400).json({ error: 'Missing address.' }); + + proposal.created = now.toISOString(); + proposal.nonce = crypto.randomBytes(64).toString('hex'); + + const actor = new Actor(proposal); + + console.debug('todo: create peer here...'); + + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: () => { + res.json({ + id: actor.id + }); + } + }); +}; diff --git a/routes/peers/list_peers.js b/routes/peers/list_peers.js new file mode 100644 index 00000000..0fddda36 --- /dev/null +++ b/routes/peers/list_peers.js @@ -0,0 +1,23 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: async () => { + const peers = []; + const candidates = []; + if (!this.agent || !this.agent.peers) return res.json(peers); + for (const [id, peer] of Object.entries(this.agent?.peers)) { + const candidate = { + id: id, + ...peer + }; + candidates.push(candidate); + } + + res.json(candidates); + } + }); +}; diff --git a/routes/peers/view_peer.js b/routes/peers/view_peer.js new file mode 100644 index 00000000..08a58a9c --- /dev/null +++ b/routes/peers/view_peer.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: async () => { + const peer = {}; + res.json(peer); + } + }); +}; diff --git a/routes/products/list_features.js b/routes/products/list_features.js new file mode 100644 index 00000000..feb738c0 --- /dev/null +++ b/routes/products/list_features.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + json: async () => { + res.send(this.features); + }, + html: () => { + return res.send(this.applicationString); + } + }); +}; diff --git a/routes/services/rsi/create_activity.js b/routes/services/rsi/create_activity.js new file mode 100644 index 00000000..e8c60e38 --- /dev/null +++ b/routes/services/rsi/create_activity.js @@ -0,0 +1,16 @@ +'use strict'; + +const merge = require('lodash.merge'); +const Actor = require('@fabric/core/types/actor'); + +module.exports = async function (req, res, next) { + const proposal = merge({}, req.body); + const content = JSON.stringify(proposal, null, ' '); + const actor = new Actor({ content: content }); + // TODO: add sha256 + const blobs = await this.db('blobs').insert({ + fabric_id: actor.id, + content: JSON.stringify(proposal) + }); + return res.send({ message: 'Activity created!' }); +}; diff --git a/routes/sources/create_source.js b/routes/sources/create_source.js new file mode 100644 index 00000000..6c06f73b --- /dev/null +++ b/routes/sources/create_source.js @@ -0,0 +1,32 @@ +'use strict'; + +const crypto = require('crypto'); +const Actor = require('@fabric/core/types/actor'); + +module.exports = async function (req, res, next) { + const now = new Date(); + const proposal = req.body;; + + if (!proposal.content) return res.status(400).json({ error: 'Missing content.' }); + + proposal.created = now.toISOString(); + proposal.nonce = crypto.randomBytes(64).toString('hex'); + + const actor = new Actor(proposal); + const inserted = await this.db('sources').insert({ + id: actor.id, + content: proposal.content, + status: 'active' + }); + + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: () => { + res.json({ + id: actor.id + }); + } + }); +}; diff --git a/routes/sources/list_sources.js b/routes/sources/list_sources.js new file mode 100644 index 00000000..1c202c2e --- /dev/null +++ b/routes/sources/list_sources.js @@ -0,0 +1,19 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: async () => { + const sources = await this.db('sources').select('id', 'name', 'description', 'content', 'owner', 'status', 'recurrence', 'last_retrieved', 'latest_blob_id').orderBy('updated_at', 'desc'); + // Grant Permissions + const granted = sources.map((x) => { + if (x.owner == req.user.fabric_id) x.can_edit = true; + return x; + }); + + res.json(granted); + } + }); +}; diff --git a/routes/sources/view_source.js b/routes/sources/view_source.js new file mode 100644 index 00000000..8c3c270e --- /dev/null +++ b/routes/sources/view_source.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = async function (req, res, next) { + res.format({ + html: () => { + res.send(this.applicationString); + }, + json: async () => { + const source = await this.db('sources').select('id', 'name', 'description', 'content', 'recurrence', 'last_retrieved', 'owner').where('id', req.params.id).first(); + if (req.user.fabric_id == source.owner) source.can_edit = true; + res.json(source); + } + }); +}; diff --git a/routes/tasks/list_tasks.js b/routes/tasks/list_tasks.js index c3f03d26..55d72b1c 100644 --- a/routes/tasks/list_tasks.js +++ b/routes/tasks/list_tasks.js @@ -7,8 +7,21 @@ const always = [ module.exports = async function (req, res, next) { res.format({ json: async () => { - const tasks = await this.db('tasks').select('fabric_id as id', 'title', 'description', 'created_at', 'due_date').where('owner', req.user.id); - return res.send(always.concat(tasks)); + const tasks = await this.db('tasks').select( + 'fabric_id as id', + 'title', + 'description', + 'created_at', + 'due_date' + ).where('owner', req.user.id); + + const endowments = tasks.map((task) => { + task.can_edit = true; + task.can_delete = true; + return task; + }); + + return res.send(always.concat(endowments)); }, html: () => { return res.send(this.applicationString); diff --git a/scripts/browser.js b/scripts/browser.js index c1dcef22..3643f088 100644 --- a/scripts/browser.js +++ b/scripts/browser.js @@ -60,6 +60,7 @@ async function main (input = {}) { conversationsLoading: state.conversations.loading, documents: state.documents, files: state.files, + groups: state.groups, people: state.people, error: state.auth.error, inquiries: state.inquiries, @@ -68,6 +69,7 @@ async function main (input = {}) { isAdmin: state.auth.isAdmin, isCompliant: state.auth.isCompliant, isSending: state.chat.isSending, + sources: state.sources, tasks: state.tasks, token: state.auth.token, stats: state.stats, diff --git a/scripts/install-models.sh b/scripts/install-models.sh index 8983a370..8dce93b7 100755 --- a/scripts/install-models.sh +++ b/scripts/install-models.sh @@ -1,31 +1,7 @@ #!/bin/bash -## Install Models, in order of priority +## Install Models ### Core Models -ollama pull llama2 # runs in most places (8GB RAM?) -ollama pull mistral # runs in most places -ollama pull gemma # runs in most places -ollama pull gemma2 # runs in most places - -### Very Large Models -ollama pull mixtral # runs in most places (16GB RAM?) -ollama pull mixtral:8x22b -ollama pull command-r-plus # too slow (104B parameters) -ollama pull llama3 -ollama pull llama3:70b -ollama pull llama3:70b-instruct-fp16 # Biggest, highest-precision target - -### Untested Models -ollama pull wizardlm2 -ollama pull wizardlm2:7b -ollama pull wizardlm2:8x22b # Preferred Target -ollama pull dbrx # 132B parameters -ollama pull mxbai -ollama pull orca2 -ollama pull falcon -ollama pull llama2-uncensored -ollama pull yarn-llama2:7b-128k -ollama pull yarn-llama2:13b-64k +ollama pull llama3.2 # runs in most places (8GB RAM?) ### Embedding Models -ollama pull snowflake-arctic-embed # fast embeddings ollama pull mxbai-embed-large # large embeddings diff --git a/scripts/node.js b/scripts/node.js index e5006cf5..d6338f63 100644 --- a/scripts/node.js +++ b/scripts/node.js @@ -21,9 +21,7 @@ async function main (input = {}) { sensemaker.on('error', handleSensemakerError); sensemaker.on('log', handleSensemakerLog); sensemaker.on('warning', handleSensemakerWarning); - sensemaker.on('debug', (...debug) => { - console.debug(`[${((new Date() - start) / 1000)}s]`, '[SENSEMAKER]', '[DEBUG]', ...debug); - }); + if (input.debug) sensemaker.on('debug', (...debug) => { console.debug(`[${((new Date() - start) / 1000)}s]`, '[SENSEMAKER]', '[DEBUG]', ...debug); }); // Start Node try { diff --git a/services/email.js b/services/email.js index 5a8a3847..01328b6a 100644 --- a/services/email.js +++ b/services/email.js @@ -58,7 +58,6 @@ class EmailService extends Service { async send (message) { this.emit('debug', `[${this.settings.name}] Sending message...`, message); - try { const result = await fetch(`https://api.postmarkapp.com/email`, { method: 'POST', @@ -75,7 +74,7 @@ class EmailService extends Service { MessageStream: 'outbound' }) }); - console.debug('result:', result); + this.emit('debug', `Email sent:`, await result.text()); } catch (exception) { console.debug('could not send email:', exception); } diff --git a/services/sensemaker.js b/services/sensemaker.js index 8b3b2eec..39957a1e 100644 --- a/services/sensemaker.js +++ b/services/sensemaker.js @@ -559,7 +559,11 @@ class Sensemaker extends Hub { return new Promise(async (resolve, reject) => { // Sync Health First const health = await this.checkHealth(); - /* this.worker.addJob({ type: 'DownloadMissingDocument', params: [] }); */ + // Jobs + // TODO: move to a different method... generateBlock should only snapshot existing state + // Scan Remotes + this.worker.addJob({ type: 'ScanRemotes', params: [] }); + if (this.settings.embeddings.enable) { /* this._syncEmbeddings(SYNC_EMBEDDINGS_COUNT).then((output) => { console.debug('[SENSEMAKER:CORE]', 'Embedding sync complete:', output); @@ -710,7 +714,7 @@ class Sensemaker extends Hub { requestor = await this.db('users').select('username', 'created_at').where({ id: request.context.user_id }).first(); request.username = requestor.username; const conversationStats = await this.db('conversations').count('id as total').groupBy('creator_id').where({ creator_id: request?.context?.user_id }); - const recentConversations = await this.db('conversations').select('id', 'title', 'summary', 'created_at').where({ creator_id: request?.context?.user_id }).orderBy('created_at', 'desc').limit(20); + const recentConversations = await this.db('conversations').select('fabric_id as id', 'title', 'summary', 'created_at').where({ creator_id: request?.context?.user_id }).orderBy('created_at', 'desc').limit(20); priorConversations = recentConversations; if (conversationStats.total > 20) { priorConversations.push(`<...${conversationStats.total - 20} more conversations>`); @@ -778,32 +782,43 @@ class Sensemaker extends Hub { content: this.settings.prompt }); - // Trainer Response - this.trainer.query({ query: request.query, messages: messages }).then((trained) => { - console.debug('trained response:', trained); - // messages.unshift(trained); - }); - - // Send Query - this.sensemaker.query({ query: request.query, messages: messages }).catch((error) => { - console.debug('[SENSEMAKER:CORE]', '[REQUEST:TEXT]', 'Sensemaker error:', error); + Promise.allSettled([ + new Promise((resolve, reject) => { + setTimeout(() => { + reject(new Error('Timeout')); + }, request.timeout || USER_QUERY_TIMEOUT_MS); + }), + this.trainer.query({ query: request.query, messages: messages, tools: true }), + this.sensemaker.query({ query: request.query, messages: messages, tools: true }) + ]).catch((error) => { + console.error('[SENSEMAKER:CORE]', '[REQUEST:TEXT]', 'Pipeline error:', error); reject(error); - }).then(async (response) => { - if (!response) return reject(new Error('No response from Sensemaker.')); - if (this.settings.debug) console.debug('[SENSEMAKER:CORE]', '[REQUEST:TEXT]', 'Response:', response); - // Update database with completed response - await this.db('messages').where({ id: responseID }).update({ - status: 'ready', - content: response.content, - updated_at: this.db.fn.now() + }).then(async (responses) => { + if (!responses) return reject(new Error('No responses from network.')); + if (this.settings.debug) console.debug('[SENSEMAKER:CORE]', '[REQUEST:TEXT]', 'Responses:', responses); + // Final Summary (actual answer) + // TODO: stream answer as it comes back from backend (to clients subscribed to the conversation) + // TODO: finalize WebSocket implementation + // Filter and process responses + const settled = responses.filter((x) => x.status === 'fulfilled').map((x) => x.value.content); + this.sensemaker.query({ query: `---\nnetwork: ${JSON.stringify(settled)}\ntimestamp: ${created}\n---\n${request.query}` }).then(async (summary) => { + // Update database with completed response + this.db('messages').where({ id: responseID }).update({ + status: 'ready', + content: summary.content, + updated_at: this.db.fn.now() + }).catch((error) => { + console.error('could not update message:', error); + reject(error); + }).then(() => { + resolve(merge({}, summary, { + actor: { name: this.name }, + object: { id: responseObject.id }, // Fabric ID + target: { id: `${this.authority}/messages/${responseID}` }, + message_id: responseID // TODO: deprecate in favor of `object` + })); + }); }); - - resolve(merge({}, response, { - actor: { name: this.name }, - object: { id: responseObject.id }, // Fabric ID - target: { id: `${this.authority}/messages/${responseID}` }, - message_id: responseID // TODO: deprecate in favor of `object` - })); }); }); } @@ -1168,7 +1183,6 @@ class Sensemaker extends Hub { // Graph await this.graph.start(); - await this.graph.addActor({ name: 'sensemaker' }); await this.graph.addActor({ name: 'terms-of-use' }); await this.graph.addActor({ name: 'agents' }); @@ -1269,6 +1283,26 @@ class Sensemaker extends Hub { this.worker.register('ScanRemotes', async (...params) => { console.debug('[WORKER]', 'Scanning Remotes:', params); + const sources = await this.db('sources').select('id', 'name', 'content').where({ status: 'active' }); + for (let i = 0; i < sources.length; i++) { + const source = sources[i]; + const synced = await this.syncSource(source.id); + } + + if (this.discord) { + this.discord.syncGuilds(); + this.discord.syncAllChannels(); + + for (let i = 0; i < this.discord.guilds.length; i++) { + const guild = this.discord.guilds[i]; + const members = await this.discord.listGuildMembers(guild.id); + } + + for (let i = 0; i < this.discord.channels.length; i++) { + const channel = this.discord.channels[i]; + const members = await this.discord.listChannelMembers(channel.id); + } + } }); // Worker Events @@ -1376,10 +1410,10 @@ class Sensemaker extends Hub { if (this.settings.crawl) { this._crawler = setInterval(async () => { - /* this.worker.addJob({ + this.worker.addJob({ type: 'ScanRemotes', params: [] - }); */ + }); }, this.settings.crawlDelay); } @@ -1437,8 +1471,12 @@ class Sensemaker extends Hub { this.http._addRoute('GET', '/uploads', ROUTES.uploads.listUploads.bind(this)); // Products + this.http._addRoute('GET', '/features', ROUTES.products.listFeatures.bind(this)); this.http._addRoute('GET', '/products', ROUTES.products.list.bind(this)); + // Blobs + this.http._addRoute('GET', '/blobs/:id', ROUTES.blobs.view.bind(this)); + // Documents this.http._addRoute('POST', '/documents', ROUTES.documents.create.bind(this)); this.http._addRoute('GET', '/documents/:fabricID', ROUTES.documents.view.bind(this)); @@ -1446,11 +1484,26 @@ class Sensemaker extends Hub { this.http._addRoute('PATCH', '/documents/delete/:fabricID', ROUTES.documents.delete.bind(this)); this.http._addRoute('GET', '/conversations/documents/:id', ROUTES.documents.newConversation.bind(this)); + this.http._addRoute('GET', '/groups', ROUTES.groups.list.bind(this)); + this.http._addRoute('GET', '/groups/:id', ROUTES.groups.view.bind(this)); + this.http._addRoute('POST', '/groups', ROUTES.groups.create.bind(this)); + this.http._addRoute('POST', '/groups/:id/members', ROUTES.groups.add_group_member.bind(this)); + // Wallet this.http._addRoute('POST', '/keys', ROUTES.keys.create.bind(this)); this.http._addRoute('GET', '/keys', ROUTES.keys.list.bind(this)); // this.http._addRoute('GET', '/keys/:id', ROUTES.keys.view.bind(this)); + // Peers + this.http._addRoute('POST', '/peers', ROUTES.peers.create.bind(this)); + this.http._addRoute('GET', '/peers', ROUTES.peers.list.bind(this)); + this.http._addRoute('GET', '/peers/:id', ROUTES.peers.view.bind(this)); + + // Sources + this.http._addRoute('POST', '/sources', ROUTES.sources.create.bind(this)); + this.http._addRoute('GET', '/sources', ROUTES.sources.list.bind(this)); + this.http._addRoute('GET', '/sources/:id', ROUTES.sources.view.bind(this)); + // Tasks this.http._addRoute('POST', '/tasks', ROUTES.tasks.create.bind(this)); this.http._addRoute('GET', '/tasks', ROUTES.tasks.list.bind(this)); @@ -1470,7 +1523,7 @@ class Sensemaker extends Hub { this.http._addRoute('GET', '/services/star-citizen', this.rsi.handleGenericRequest.bind(this)); this.http._addRoute('POST', '/services/star-citizen', this.rsi.handleGenericRequest.bind(this)); this.http._addRoute('GET', '/services/star-citizen/activities', this.rsi.handleGenericRequest.bind(this)); - this.http._addRoute('POST', '/services/star-citizen/activities', this.rsi.handleGenericRequest.bind(this)); + this.http._addRoute('POST', '/services/star-citizen/activities', ROUTES.services.rsi.activities.create.bind(this)); // Feedback this.http._addRoute('POST', '/feedback', ROUTES.feedback.create.bind(this)); @@ -1698,6 +1751,67 @@ class Sensemaker extends Hub { return this; } + async syncSource (id) { + return new Promise(async (resolve, reject) => { + const source = await this.db('sources').where({ id }).first(); + if (!source) throw new Error('Source not found.'); + const link = source.content; + fetch(link).then(async (response) => { + const now = new Date(); + const proposal = { + created: now.toISOString(), + creator: this.id, + body: await response.text() + }; + + const blob = new Actor({ content: proposal.body }); + const existing = await this.db('blobs').where({ fabric_id: blob.id }).first(); + if (!existing) { + const inserted = await this.db('blobs').insert({ + content: proposal.body, + fabric_id: blob.id, + mime_type: response.headers.get('Content-Type').split(';')[0] + }); + } + + const embedding = await this.trainer.ingestDocument({ + content: proposal.body, + metadata: { id: blob.id, origin: link } + }, 'hypertext'); + + const doc = await this.db('documents').where({ blob_id: blob.id }).select('id').first(); + if (!doc) { + await this.db('documents').insert({ + blob_id: blob.id, + created_at: toMySQLDatetime(now), + title: `Snaphot of ${source.content}` + }); + } else { + await this.db('documents').update({ + updated_at: toMySQLDatetime(now), + blob_id: blob.id + }).where({ id: doc.id }); + } + + await this.db('sources').update({ + updated_at: toMySQLDatetime(now), + last_retrieved: toMySQLDatetime(now), + latest_blob_id: blob.id + }).where({ id }); + + const actor = new Actor(proposal); + resolve({ + created: now, + content: proposal, + id: actor.id, + type: 'SourceSnapshot' + }); + }).catch((exception) => { + reject(exception); + }); + }); + } + async _attachWorkers () { for (let i = 0; i < this.settings.workers; i++) { const worker = new Worker(); @@ -1782,6 +1896,76 @@ class Sensemaker extends Hub { }); } + async _ensureDiscordUser (object) { + // Create (or Restore) Identities + let userID = null; + let id = null; + + const identity = await this.db('identities').where({ source: 'discord', content: object.ref }).first(); + if (!identity) { + const actor = new Actor({ name: `discord/users/${object.ref}` }); + const ids = await this.db('identities').insert({ + fabric_id: actor.id, + source: 'discord', + content: object.ref + }); + + const duser = await this.db('identities').insert({ + fabric_id: actor.id, + source: 'discord', + content: object.username + }); + + id = ids[0]; + } else { + id = identity.id; + } + + const retrieved = await this.db('users').where({ discord_id: object.ref }).first(); + if (!retrieved) { + const newUser = await this.db('users').insert({ + discord_id: object.ref, + fabric_id: object.id, + username: object.username + }); + + userID = newUser[0]; + } else { + userID = retrieved.id; + } + + return { + id: userID + }; + } + + async _ensureDiscordChannel (target) { + let conversationID = null; + let log = null; + + // Create (or Restore) Conversation + const resumed = await this.db('conversations').where({ fabric_id: target.id }).first(); + if (!resumed) { + const newConversation = await this.db('conversations').insert({ + creator_id: userID, + discord_id: target.ref, + fabric_id: target.id, + title: target.username, + log: JSON.stringify([]) + }); + + conversationID = newConversation[0]; + log = []; + } else { + conversationID = resumed.id; + log = resumed.log; + } + + return { + id: conversationID + }; + } + async _handleDiscordActivity (activity) { console.debug('[SENSEMAKER:CORE]', '[DISCORD]', 'Discord activity:', activity); if (activity.actor == this.discord.id) return; @@ -1832,9 +2016,9 @@ class Sensemaker extends Hub { if (!resumed) { const newConversation = await this.db('conversations').insert({ creator_id: userID, - discord_id: activity.actor.ref, + discord_id: activity.target.ref, fabric_id: activity.target.id, - title: activity.target.username, + title: activity.target.name, log: JSON.stringify([]) }); @@ -1892,6 +2076,7 @@ class Sensemaker extends Hub { } this.discord.getTokenUser(token.access_token).then(async (response) => { + let id = null; // Create Identity const identity = await this.db('identities').where({ source: 'discord', content: response.id }).first(); if (!identity) { @@ -2116,7 +2301,7 @@ class Sensemaker extends Hub { if (!resumed) { const newConversation = await this.db('conversations').insert({ creator_id: userID, - discord_id: activity.actor.ref, + matrix_id: activity.target.ref, fabric_id: activity.target.id, title: activity.target.username, log: JSON.stringify([]) @@ -2491,7 +2676,8 @@ class Sensemaker extends Hub { response.push(file); break; default: - console.debug('[SEARCH]', '[DOCUMENTS]', 'Unknown result type:', result.metadata.type); + console.debug('[SEARCH]', '[DOCUMENTS]', 'Unknown result type:', result?.metadata?.type); + response.push({ content: result.content, metadata: { type: 'unknown', id: null }, object: result }); break; } } diff --git a/settings/local.js b/settings/local.js index d7031dfb..8583a0e7 100644 --- a/settings/local.js +++ b/settings/local.js @@ -236,6 +236,11 @@ module.exports = { model: 'gpt-4-turbo', temperature: 0 }, + rsi: { + http: { + enable: false + } + }, twilio: { sid: 'add your twilio sid here', token: 'add your twilio token here', diff --git a/settings/network.js b/settings/network.js index 3fc56782..2119ec4c 100644 --- a/settings/network.js +++ b/settings/network.js @@ -8,110 +8,14 @@ const path = require('path'); const prompt = path.join(__dirname, '../prompts/sensemaker.txt'); const baseline = fs.readFileSync(prompt, 'utf8'); -// Constants -const { - OPENAI_API_KEY -} = require('../constants'); - module.exports = { local: { name: 'LOCAL', prompt: baseline.toString('utf8'), - model: 'llama3', + model: 'llama3.2', host: '127.0.0.1', port: 11434, secure: false, temperature: 0 - }, - /* alpha: { - name: 'ALPHA', - prompt: baseline.toString('utf8'), - model: 'llama3', - host: ALPHA, - port: 11434, - secure: false, - temperature: 0 - }, */ - /* 'llama3-70b-fp16': { - name: 'GOTHMOG', - prompt: baseline.toString('utf8'), - model: 'llama3:70b-instruct-fp16', - host: GOTHMOG, - port: 11434, - secure: false, - fabric: false, - temperature: 0 - }, */ - /* gemma: { - name: 'GEMMA', - prompt: baseline.toString('utf8'), - model: 'gemma2', - host: GOTHMOG, - port: 11434, - secure: false, - fabric: false, - temperature: 0 - }, */ - /* socrates: { - name: 'SOCRATES', - prompt: baseline.toString('utf8'), - model: 'gemma', - host: SOCRATES, - port: 11434, - secure: false - }, */ - /* TODO: enable hivemind */ - /* hivemind: { - name: 'HIVEMIND', - prompt: baseline.toString('utf8'), - model: 'llama3:70b', - host: BALROG, - port: 3045, - secure: false, - temperature: 0 - }, */ - // OpenAI Services - /* 'GPT-4': { - prompt: baseline.toString('utf8'), - model: 'gpt-4-0613', - host: 'api.openai.com', - port: 443, - secure: true, - fabric: false, - temperature: 0, - headers: { - 'Authorization': `Bearer ${process.env.OPENAI_API_KEY || OPENAI_API_KEY}`, - // 'OpenAI-Organization': '', - // 'OpenAI-Project': '' - } - }, - 'GPT-4-turbo': { - prompt: baseline.toString('utf8'), - model: 'gpt-4-turbo-2024-04-09', - host: 'api.openai.com', - port: 443, - secure: true, - fabric: false, - temperature: 0, - headers: { - 'Authorization': `Bearer ${process.env.OPENAI_API_KEY || OPENAI_API_KEY}`, - // 'OpenAI-Organization': '', - // 'OpenAI-Project': '' - } - }, */ - /* 'GPT-4o': { - prompt: baseline.toString('utf8'), - model: 'gpt-4o-2024-05-13', - host: 'api.openai.com', - port: 443, - secure: true, - fabric: false, - temperature: 0, - openai: { enable: true }, - headers: { - 'Authorization': `Bearer ${process.env.OPENAI_API_KEY || OPENAI_API_KEY}`, - // 'OpenAI-Organization': '', - // 'OpenAI-Project': '' - } - } */ + } }; diff --git a/stores/hub/STATE b/stores/hub/STATE index 203ae5b0..b67ac79e 100644 --- a/stores/hub/STATE +++ b/stores/hub/STATE @@ -14,6 +14,7 @@ "balance": 0 } }, + "logs": {}, "players": {}, "vehicles": {} } \ No newline at end of file diff --git a/stores/redux.js b/stores/redux.js index 4fa66800..04488d75 100644 --- a/stores/redux.js +++ b/stores/redux.js @@ -14,10 +14,13 @@ const contractReducer = require('../reducers/contractReducer'); const conversationReducer = require('../reducers/conversationReducer'); const documentReducer = require('../reducers/documentReducer'); const fileReducer = require('../reducers/fileReducer'); +const groupsReducer = require('../reducers/groupsReducer'); const inquiriesReducer = require('../reducers/inquiriesReducer'); const invitationReducer = require('../reducers/invitationReducer'); +const peersReducer = require('../reducers/peersReducer'); const personReducer = require('../reducers/personReducer'); const searchReducer = require('../reducers/searchReducer'); +const sourcesReducer = require('../reducers/sourcesReducer'); const tasksReducer = require('../reducers/tasksReducer'); const feedbackReducer = require('../reducers/feedbackReducer'); const helpReducer = require('../reducers/helpReducer'); @@ -34,6 +37,7 @@ const rootReducer = combineReducers({ conversations: conversationReducer, documents: documentReducer, files: fileReducer, + groups: groupsReducer, stats: adminReducer, people: personReducer, inquiries: inquiriesReducer, @@ -41,7 +45,9 @@ const rootReducer = combineReducers({ search: searchReducer, feedback: feedbackReducer, help: helpReducer, + peers: peersReducer, redis: redisReducer, + sources: sourcesReducer, tasks: tasksReducer, users: accountsReducer, wallet: walletReducer diff --git a/tests/getconversationsbyid.test.js b/tests/getconversationsbyid.test.js deleted file mode 100644 index e9465ec1..00000000 --- a/tests/getconversationsbyid.test.js +++ /dev/null @@ -1,51 +0,0 @@ -const sinon = require('sinon'); -const chai = require('chai'); -const expect = chai.expect; -const middleware = require('../routes/conversations/get_conversations_by_id'); - -describe('Get Conversations By ID', function() { - it('should retrieve conversation and messages', async function() { - const req = { params: { id: 1 } }; - const res = { - format: sinon.stub().callsFake(function(formatFn) { - formatFn.json(); - }), - send: sinon.spy() - }; - const next = sinon.spy(); - const fakeDb = { - select: sinon.stub().resolves({ id: 1, title: 'Test Conversation', created_at: new Date(), log: [1, 2, 3], file_fabric_id: 'file_fabric_id' }), - from: sinon.stub().returnsThis(), - where: sinon.stub().returnsThis(), - first: sinon.stub().resolves({ id: 1 }) - }; - const fakeMessages = [ - { id: 1, content: 'Message 1', created_at: new Date() }, - { id: 2, content: 'Message 2', created_at: new Date() }, - { id: 3, content: 'Message 3', created_at: new Date() } - ]; - const fakeDbKnex = sinon.stub().callsFake(() => ({ - whereIn: sinon.stub().returnsThis(), - select: sinon.stub().resolves(fakeMessages) - })); - const fakeApplicationString = 'Test'; - const middlewareInstance = middleware.bind({ - db: { - select: fakeDb.select, - from: fakeDb.from, - where: fakeDb.where, - first: fakeDb.first, - knex: fakeDbKnex - }, - applicationString: fakeApplicationString - }); - - await middlewareInstance(req, res, next); - - // Assertions - expect(res.format.calledOnce).to.be.true; - expect(fakeDb.select.calledOnce).to.be.true; - expect(fakeDb.select.calledOnceWith('id', 'title', 'created_at', 'log', 'file_fabric_id')).to.be.true; - }); -}); - diff --git a/types/agent.js b/types/agent.js index 8b01e817..26ff5012 100644 --- a/types/agent.js +++ b/types/agent.js @@ -17,8 +17,10 @@ const defaults = require('../settings/local'); // Dependencies const fs = require('fs'); const merge = require('lodash.merge'); +const fetch = require('cross-fetch'); // Fabric Types +const Actor = require('@fabric/core/types/actor'); const Peer = require('@fabric/core/types/peer'); const Service = require('@fabric/core/types/service'); @@ -135,37 +137,6 @@ class Agent extends Service { type: 'Object', description: 'The response from the AI agent.' } - }, - searchHost: { - type: 'function', - function: { - name: 'search_host', - description: 'Search the specified host for a query.', - parameters: { - type: 'object', - properties: { - host: { - type: 'string', - description: 'The host to search.' - }, - path: { - type: 'string', - description: 'The path to search.' - }, - body: { - type: 'object', - description: 'Query object to send to host, with required string parameter "query" designating the search term.', - properties: { - query: { - type: 'string', - description: 'The search term.' - } - } - } - }, - required: ['host', 'path', 'body'] - } - } } } } @@ -329,6 +300,7 @@ class Agent extends Service { if (this.settings.debug) console.debug('[AGENT]', `[${this.settings.name.toUpperCase()}]`, '[QUERY]', 'Trying with messages:', sample); + // Core Request fetch(endpoint, { method: 'POST', headers: merge({ @@ -344,7 +316,8 @@ class Agent extends Service { temperature: (this.settings.temperature) ? this.settings.temperature : 0, } : undefined, messages: sample, - format: (request.format === 'json' || request.json) ? 'json' : undefined + format: (request.format === 'json' || request.json) ? 'json' : undefined, + tools: (request.tools) ? this.tools : undefined }) }).catch((exception) => { console.error('[AGENT]', `[${this.settings.name.toUpperCase()}]`, 'Could not send request:', exception); @@ -383,19 +356,44 @@ class Agent extends Service { if (this.settings.debug) console.debug('[AGENT]', `[${this.settings.name.toUpperCase()}]`, '[QUERY]', 'Response:', base); if (!base) return reject(new Error('No response from agent.')); if (base.error) return reject(base.error); - if (!base.choices) return reject(new Error('No choices in response.')); + const choice = base.choices[0]; + if (choice.finish_reason && choice.finish_reason === 'tool_calls') { + const tool = choice.message.tool_calls[0]; + const args = JSON.parse(tool.function.arguments); + switch (tool.function.name) { + // Simple HTTP GET + case 'http_get': + try { + const tool_response = await fetch(args.url); + const obj = { + role: 'tool', + content: await tool_response.text(), + tool_call_id: tool.tool_call_id + }; + + const actor = new Actor({ content: obj.content }); + this.emit('document', { + id: actor.id, + content: obj.content + }); + + messages.push(choice.message); + messages.push({ role: 'tool', content: obj.content, tool_call_id: tool.id }); + } catch (exception) { + reject(exception); + } - if (request.requery) { - sample.push({ role: 'assistant', content: base.choices[0].message.content }); - console.debug('[AGENT]', `[${this.settings.name.toUpperCase()}]`, '[REQUERY]', 'Messages:', sample); - console.debug('[AGENT]', `[${this.settings.name.toUpperCase()}]`, '[REQUERY]', 'Prompt:', this.prompt); - // Re-execute query with John Cena - return this.query({ query: `Are you sure about that?`, messages: sample }); + return this.query({ query: request.query, messages: messages }).then(resolve).catch(reject); + } } + if (!base.choices) return reject(new Error('No choices in response.')); + + // Emit completion event this.emit('completion', base); if (this.settings.debug) console.trace('[AGENT]', `[${this.settings.name.toUpperCase()}]`, '[QUERY]', 'Emitted completion:', base); + // Resolve with response return resolve({ type: 'AgentResponse', name: this.settings.name, diff --git a/types/spa.js b/types/spa.js index c3370848..b1d6e1a4 100644 --- a/types/spa.js +++ b/types/spa.js @@ -33,6 +33,8 @@ class SPA extends FabricSPA { + + diff --git a/types/trainer.js b/types/trainer.js index 90b565c2..043eb8f7 100644 --- a/types/trainer.js +++ b/types/trainer.js @@ -221,22 +221,16 @@ class Trainer extends Service { // Old Embeddings (specific to Langchain) const element = new Document({ pageContent: document.content, metadata: document.metadata }); this.embeddings.addDocuments([element]).catch(reject).then(() => { - console.debug('[TRAINER]', 'Ingested document:', element); - // resolve({ type: 'IngestedDocument', content: element }); - }); - - // TODO: check for `embedding` and fail if not present - const object = { type: EMBEDDING_MODEL, content: json.embedding }; - console.debug('[TRAINER]', 'Ollama Object:', object); - - // TODO: receive event in core service and correctly create blob, confirm ID matches - this.emit('TrainerDocument', { - id: actor.id, - metadata: document.metadata, - content: document.content + // TODO: check for `embedding` and fail if not present + const object = { type: EMBEDDING_MODEL, content: json.embedding }; + // TODO: receive event in core service and correctly create blob, confirm ID matches + this.emit('TrainerDocument', { + id: actor.id, + metadata: document.metadata, + content: document.content + }); + resolve({ type: 'Embedding', content: object }); }); - - resolve({ type: 'Embedding', content: object }); }); }); }