airloom 0.1.27 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -8
- package/dist/viewer/assets/{browser-CyAZgeub.js → browser-CNNk1Yyj.js} +1 -1
- package/dist/viewer/assets/{index-C64jxT85.js → index-BIIt6Ahm.js} +3 -3
- package/dist/viewer/assets/{index-PCs83gKK.js → index-BrCBwFcp.js} +1 -1
- package/dist/viewer/assets/{index-BYOU4j-Z.css → index-DGkPtIMJ.css} +1 -1
- package/dist/viewer/index.html +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1494,7 +1494,7 @@ var HOST_HTML = `<!DOCTYPE html>
|
|
|
1494
1494
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@xterm/xterm@6.0.0/css/xterm.css">
|
|
1495
1495
|
<style>
|
|
1496
1496
|
:root{color-scheme:light dark;--bg:#0a0a0a;--surface:#1a1a1a;--border:#2a2a2a;--text:#e0e0e0;--text-muted:#888;--accent:#7c8aff;--accent-hover:#6b79ee;--input-bg:#111;--input-border:#333;--term-bg:#05070c;--tool-bg:#333;--tool-hover:#444;--msg-user:#2a3a6a;--msg-asst:#1e1e1e}
|
|
1497
|
-
@media(prefers-color-scheme:light){:root{--bg:#f5f5f7;--surface:#fff;--border:#d1d1d6;--text:#1c1c1e;--text-muted:#6e6e73;--accent:#5856d6;--accent-hover:#4a48c4;--input-bg:#fff;--input-border:#d1d1d6;--term-bg:#
|
|
1497
|
+
@media(prefers-color-scheme:light){:root{--bg:#f5f5f7;--surface:#fff;--border:#d1d1d6;--text:#1c1c1e;--text-muted:#6e6e73;--accent:#5856d6;--accent-hover:#4a48c4;--input-bg:#fff;--input-border:#d1d1d6;--term-bg:#fff;--tool-bg:#e5e5ea;--tool-hover:#d1d1d6;--msg-user:#d6d5f7;--msg-asst:#f2f2f7}}
|
|
1498
1498
|
*{margin:0;padding:0;box-sizing:border-box}
|
|
1499
1499
|
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:var(--bg);color:var(--text);min-height:100vh}
|
|
1500
1500
|
.container{max-width:800px;margin:0 auto;padding:20px}
|
|
@@ -1603,12 +1603,12 @@ const darkTheme = {
|
|
|
1603
1603
|
brightBlue: '#a5b4ff', brightMagenta: '#d2a8ff', brightCyan: '#56d4dd', brightWhite: '#f0f6fc',
|
|
1604
1604
|
};
|
|
1605
1605
|
const lightTheme = {
|
|
1606
|
-
background: '#
|
|
1607
|
-
selectionBackground: 'rgba(88,86,214,0.
|
|
1608
|
-
black: '#1c1c1e', red: '#
|
|
1609
|
-
blue: '#
|
|
1610
|
-
brightBlack: '#6e6e73', brightRed: '#
|
|
1611
|
-
brightBlue: '#
|
|
1606
|
+
background: '#ffffff', foreground: '#1c1c1e', cursor: '#5856d6', cursorAccent: '#ffffff',
|
|
1607
|
+
selectionBackground: 'rgba(88,86,214,0.20)',
|
|
1608
|
+
black: '#1c1c1e', red: '#c41a16', green: '#007400', yellow: '#826b28',
|
|
1609
|
+
blue: '#0000ff', magenta: '#a90d91', cyan: '#3e8a8a', white: '#e5e5ea',
|
|
1610
|
+
brightBlack: '#6e6e73', brightRed: '#eb4d3d', brightGreen: '#36b738', brightYellow: '#b79a14',
|
|
1611
|
+
brightBlue: '#0451a5', brightMagenta: '#c42275', brightCyan: '#318495', brightWhite: '#f2f2f7',
|
|
1612
1612
|
};
|
|
1613
1613
|
function getTheme() { return matchMedia('(prefers-color-scheme:light)').matches ? lightTheme : darkTheme; }
|
|
1614
1614
|
matchMedia('(prefers-color-scheme:light)').addEventListener('change', () => {
|
|
@@ -1911,7 +1911,7 @@ async function main() {
|
|
|
1911
1911
|
const tokenDetails = await rest.auth.requestToken({
|
|
1912
1912
|
clientId: "*",
|
|
1913
1913
|
// viewer picks its own clientId
|
|
1914
|
-
capability: {
|
|
1914
|
+
capability: { "airloom:*": ["publish", "subscribe", "presence"] },
|
|
1915
1915
|
ttl: ABLY_TOKEN_TTL
|
|
1916
1916
|
});
|
|
1917
1917
|
console.log(`[ably] Scoped token issued (TTL: ${Math.round(ABLY_TOKEN_TTL / 6e4)}min, channel: ${channelName})`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as c}from"./index-
|
|
1
|
+
import{g as c}from"./index-BIIt6Ahm.js";function f(t,i){for(var o=0;o<i.length;o++){const e=i[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n,a;function b(){return a||(a=1,n=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),n}var u=b();const w=c(u),p=f({__proto__:null,default:w},[u]);export{p as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var sf=Object.defineProperty;var rf=(e,t,i)=>t in e?sf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Qe=(e,t,i)=>rf(e,typeof t!="symbol"?t+"":t,i);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const h of a)if(h.type==="childList")for(const d of h.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&n(d)}).observe(document,{childList:!0,subtree:!0});function i(a){const h={};return a.integrity&&(h.integrity=a.integrity),a.referrerPolicy&&(h.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?h.credentials="include":a.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function n(a){if(a.ep)return;a.ep=!0;const h=i(a);fetch(a.href,h)}})();const nf="modulepreload",of=function(e,t){return new URL(e,t).href},Dl={},qh=function(t,i,n){let a=Promise.resolve();if(i&&i.length>0){let d=function(R){return Promise.all(R.map(k=>Promise.resolve(k).then(B=>({status:"fulfilled",value:B}),B=>({status:"rejected",reason:B}))))};const g=document.getElementsByTagName("link"),v=document.querySelector("meta[property=csp-nonce]"),m=(v==null?void 0:v.nonce)||(v==null?void 0:v.getAttribute("nonce"));a=d(i.map(R=>{if(R=of(R,n),R in Dl)return;Dl[R]=!0;const k=R.endsWith(".css"),B=k?'[rel="stylesheet"]':"";if(!!n)for(let U=g.length-1;U>=0;U--){const Z=g[U];if(Z.href===R&&(!k||Z.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${R}"]${B}`))return;const P=document.createElement("link");if(P.rel=k?"stylesheet":nf,k||(P.as="script"),P.crossOrigin="",P.href=R,m&&P.setAttribute("nonce",m),document.head.appendChild(P),k)return new Promise((U,Z)=>{P.addEventListener("load",U),P.addEventListener("error",()=>Z(new Error(`Unable to preload CSS for ${R}`)))})}))}function h(d){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=d,window.dispatchEvent(g),!g.defaultPrevented)throw d}return a.then(d=>{for(const g of d||[])g.status==="rejected"&&h(g.reason);return t().catch(h)})};var Ki=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function af(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lf(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var i=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),i}var Vr={exports:{}},Nl;function hf(){if(Nl)return Vr.exports;Nl=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(W,E,ae){return Function.prototype.apply.call(W,E,ae)},i;e&&typeof e.ownKeys=="function"?i=e.ownKeys:Object.getOwnPropertySymbols?i=function(W){return Object.getOwnPropertyNames(W).concat(Object.getOwnPropertySymbols(W))}:i=function(W){return Object.getOwnPropertyNames(W)};function n(H){console&&console.warn&&console.warn(H)}var a=Number.isNaN||function(W){return W!==W};function h(){h.init.call(this)}Vr.exports=h,Vr.exports.once=_e,h.EventEmitter=h,h.prototype._events=void 0,h.prototype._eventsCount=0,h.prototype._maxListeners=void 0;var d=10;function g(H){if(typeof H!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof H)}Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(H){if(typeof H!="number"||H<0||a(H))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+H+".");d=H}}),h.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},h.prototype.setMaxListeners=function(W){if(typeof W!="number"||W<0||a(W))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+W+".");return this._maxListeners=W,this};function v(H){return H._maxListeners===void 0?h.defaultMaxListeners:H._maxListeners}h.prototype.getMaxListeners=function(){return v(this)},h.prototype.emit=function(W){for(var E=[],ae=1;ae<arguments.length;ae++)E.push(arguments[ae]);var be=W==="error",ze=this._events;if(ze!==void 0)be=be&&ze.error===void 0;else if(!be)return!1;if(be){var Be;if(E.length>0&&(Be=E[0]),Be instanceof Error)throw Be;var xe=new Error("Unhandled error."+(Be?" ("+Be.message+")":""));throw xe.context=Be,xe}var ce=ze[W];if(ce===void 0)return!1;if(typeof ce=="function")t(ce,this,E);else for(var f=ce.length,re=P(ce,f),ae=0;ae<f;++ae)t(re[ae],this,E);return!0};function m(H,W,E,ae){var be,ze,Be;if(g(E),ze=H._events,ze===void 0?(ze=H._events=Object.create(null),H._eventsCount=0):(ze.newListener!==void 0&&(H.emit("newListener",W,E.listener?E.listener:E),ze=H._events),Be=ze[W]),Be===void 0)Be=ze[W]=E,++H._eventsCount;else if(typeof Be=="function"?Be=ze[W]=ae?[E,Be]:[Be,E]:ae?Be.unshift(E):Be.push(E),be=v(H),be>0&&Be.length>be&&!Be.warned){Be.warned=!0;var xe=new Error("Possible EventEmitter memory leak detected. "+Be.length+" "+String(W)+" listeners added. Use emitter.setMaxListeners() to increase limit");xe.name="MaxListenersExceededWarning",xe.emitter=H,xe.type=W,xe.count=Be.length,n(xe)}return H}h.prototype.addListener=function(W,E){return m(this,W,E,!1)},h.prototype.on=h.prototype.addListener,h.prototype.prependListener=function(W,E){return m(this,W,E,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function k(H,W,E){var ae={fired:!1,wrapFn:void 0,target:H,type:W,listener:E},be=R.bind(ae);return be.listener=E,ae.wrapFn=be,be}h.prototype.once=function(W,E){return g(E),this.on(W,k(this,W,E)),this},h.prototype.prependOnceListener=function(W,E){return g(E),this.prependListener(W,k(this,W,E)),this},h.prototype.removeListener=function(W,E){var ae,be,ze,Be,xe;if(g(E),be=this._events,be===void 0)return this;if(ae=be[W],ae===void 0)return this;if(ae===E||ae.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete be[W],be.removeListener&&this.emit("removeListener",W,ae.listener||E));else if(typeof ae!="function"){for(ze=-1,Be=ae.length-1;Be>=0;Be--)if(ae[Be]===E||ae[Be].listener===E){xe=ae[Be].listener,ze=Be;break}if(ze<0)return this;ze===0?ae.shift():U(ae,ze),ae.length===1&&(be[W]=ae[0]),be.removeListener!==void 0&&this.emit("removeListener",W,xe||E)}return this},h.prototype.off=h.prototype.removeListener,h.prototype.removeAllListeners=function(W){var E,ae,be;if(ae=this._events,ae===void 0)return this;if(ae.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ae[W]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ae[W]),this;if(arguments.length===0){var ze=Object.keys(ae),Be;for(be=0;be<ze.length;++be)Be=ze[be],Be!=="removeListener"&&this.removeAllListeners(Be);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(E=ae[W],typeof E=="function")this.removeListener(W,E);else if(E!==void 0)for(be=E.length-1;be>=0;be--)this.removeListener(W,E[be]);return this};function B(H,W,E){var ae=H._events;if(ae===void 0)return[];var be=ae[W];return be===void 0?[]:typeof be=="function"?E?[be.listener||be]:[be]:E?Z(be):P(be,be.length)}h.prototype.listeners=function(W){return B(this,W,!0)},h.prototype.rawListeners=function(W){return B(this,W,!1)},h.listenerCount=function(H,W){return typeof H.listenerCount=="function"?H.listenerCount(W):L.call(H,W)},h.prototype.listenerCount=L;function L(H){var W=this._events;if(W!==void 0){var E=W[H];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}h.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function P(H,W){for(var E=new Array(W),ae=0;ae<W;++ae)E[ae]=H[ae];return E}function U(H,W){for(;W+1<H.length;W++)H[W]=H[W+1];H.pop()}function Z(H){for(var W=new Array(H.length),E=0;E<W.length;++E)W[E]=H[E].listener||H[E];return W}function _e(H,W){return new Promise(function(E,ae){function be(Be){H.removeListener(W,ze),ae(Be)}function ze(){typeof H.removeListener=="function"&&H.removeListener("error",be),E([].slice.call(arguments))}Ne(H,W,ze,{once:!0}),W!=="error"&&st(H,be,{once:!0})})}function st(H,W,E){typeof H.on=="function"&&Ne(H,"error",W,E)}function Ne(H,W,E,ae){if(typeof H.on=="function")ae.once?H.once(W,E):H.on(W,E);else if(typeof H.addEventListener=="function")H.addEventListener(W,function be(ze){ae.once&&H.removeEventListener(W,be),E(ze)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof H)}return Vr.exports}var Gh=hf();function cf(e){if(typeof Buffer<"u")return Buffer.from(e).toString("base64");let t="";for(const i of e)t+=String.fromCharCode(i);return btoa(t)}function uf(e){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));const t=atob(e),i=new Uint8Array(t.length);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}function df(e){return new TextEncoder().encode(JSON.stringify(e))}function ff(e){const t=JSON.parse(new TextDecoder().decode(e));if(!t||typeof t!="object"||typeof t.type!="string"||typeof t.id!="string")throw new Error("Invalid channel message: missing type or id field");return t}function _f(e){const t=JSON.parse(e);if(!t||typeof t!="object"||typeof t.relay!="string"||typeof t.session!="string"||typeof t.v!="number")throw new Error("Invalid pairing data: missing required fields");if(t.transport!==void 0&&t.transport!=="ws"&&t.transport!=="ably")throw new Error('Invalid pairing data: transport must be "ws" or "ably"');if(t.token!==void 0&&typeof t.token!="string")throw new Error("Invalid pairing data: token must be a string");if(t.transport==="ably"&&!t.token)throw new Error("Invalid pairing data: Ably transport requires a token");return t}function gf(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Kn={exports:{}};const pf={},mf=Object.freeze(Object.defineProperty({__proto__:null,default:pf},Symbol.toStringTag,{value:"Module"})),vf=lf(mf);var Hl;function yf(){return Hl||(Hl=1,(function(e){(function(t){var i=function(p){var S,y=new Float64Array(16);if(p)for(S=0;S<p.length;S++)y[S]=p[S];return y},n=function(){throw new Error("no PRNG")},a=new Uint8Array(16),h=new Uint8Array(32);h[0]=9;var d=i(),g=i([1]),v=i([56129,1]),m=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),R=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),k=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),B=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),L=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function P(p,S,y,u){p[S]=y>>24&255,p[S+1]=y>>16&255,p[S+2]=y>>8&255,p[S+3]=y&255,p[S+4]=u>>24&255,p[S+5]=u>>16&255,p[S+6]=u>>8&255,p[S+7]=u&255}function U(p,S,y,u,w){var T,I=0;for(T=0;T<w;T++)I|=p[S+T]^y[u+T];return(1&I-1>>>8)-1}function Z(p,S,y,u){return U(p,S,y,u,16)}function _e(p,S,y,u){return U(p,S,y,u,32)}function st(p,S,y,u){for(var w=u[0]&255|(u[1]&255)<<8|(u[2]&255)<<16|(u[3]&255)<<24,T=y[0]&255|(y[1]&255)<<8|(y[2]&255)<<16|(y[3]&255)<<24,I=y[4]&255|(y[5]&255)<<8|(y[6]&255)<<16|(y[7]&255)<<24,G=y[8]&255|(y[9]&255)<<8|(y[10]&255)<<16|(y[11]&255)<<24,X=y[12]&255|(y[13]&255)<<8|(y[14]&255)<<16|(y[15]&255)<<24,we=u[4]&255|(u[5]&255)<<8|(u[6]&255)<<16|(u[7]&255)<<24,le=S[0]&255|(S[1]&255)<<8|(S[2]&255)<<16|(S[3]&255)<<24,Ke=S[4]&255|(S[5]&255)<<8|(S[6]&255)<<16|(S[7]&255)<<24,fe=S[8]&255|(S[9]&255)<<8|(S[10]&255)<<16|(S[11]&255)<<24,ke=S[12]&255|(S[13]&255)<<8|(S[14]&255)<<16|(S[15]&255)<<24,Me=u[8]&255|(u[9]&255)<<8|(u[10]&255)<<16|(u[11]&255)<<24,He=y[16]&255|(y[17]&255)<<8|(y[18]&255)<<16|(y[19]&255)<<24,J=y[20]&255|(y[21]&255)<<8|(y[22]&255)<<16|(y[23]&255)<<24,Oe=y[24]&255|(y[25]&255)<<8|(y[26]&255)<<16|(y[27]&255)<<24,Te=y[28]&255|(y[29]&255)<<8|(y[30]&255)<<16|(y[31]&255)<<24,Ee=u[12]&255|(u[13]&255)<<8|(u[14]&255)<<16|(u[15]&255)<<24,ge=w,ie=T,he=I,ye=G,ve=X,ne=we,D=le,N=Ke,K=fe,j=ke,$=Me,Y=He,Ce=J,Ie=Oe,We=Te,Ue=Ee,x,Ge=0;Ge<20;Ge+=2)x=ge+Ce|0,ve^=x<<7|x>>>25,x=ve+ge|0,K^=x<<9|x>>>23,x=K+ve|0,Ce^=x<<13|x>>>19,x=Ce+K|0,ge^=x<<18|x>>>14,x=ne+ie|0,j^=x<<7|x>>>25,x=j+ne|0,Ie^=x<<9|x>>>23,x=Ie+j|0,ie^=x<<13|x>>>19,x=ie+Ie|0,ne^=x<<18|x>>>14,x=$+D|0,We^=x<<7|x>>>25,x=We+$|0,he^=x<<9|x>>>23,x=he+We|0,D^=x<<13|x>>>19,x=D+he|0,$^=x<<18|x>>>14,x=Ue+Y|0,ye^=x<<7|x>>>25,x=ye+Ue|0,N^=x<<9|x>>>23,x=N+ye|0,Y^=x<<13|x>>>19,x=Y+N|0,Ue^=x<<18|x>>>14,x=ge+ye|0,ie^=x<<7|x>>>25,x=ie+ge|0,he^=x<<9|x>>>23,x=he+ie|0,ye^=x<<13|x>>>19,x=ye+he|0,ge^=x<<18|x>>>14,x=ne+ve|0,D^=x<<7|x>>>25,x=D+ne|0,N^=x<<9|x>>>23,x=N+D|0,ve^=x<<13|x>>>19,x=ve+N|0,ne^=x<<18|x>>>14,x=$+j|0,Y^=x<<7|x>>>25,x=Y+$|0,K^=x<<9|x>>>23,x=K+Y|0,j^=x<<13|x>>>19,x=j+K|0,$^=x<<18|x>>>14,x=Ue+We|0,Ce^=x<<7|x>>>25,x=Ce+Ue|0,Ie^=x<<9|x>>>23,x=Ie+Ce|0,We^=x<<13|x>>>19,x=We+Ie|0,Ue^=x<<18|x>>>14;ge=ge+w|0,ie=ie+T|0,he=he+I|0,ye=ye+G|0,ve=ve+X|0,ne=ne+we|0,D=D+le|0,N=N+Ke|0,K=K+fe|0,j=j+ke|0,$=$+Me|0,Y=Y+He|0,Ce=Ce+J|0,Ie=Ie+Oe|0,We=We+Te|0,Ue=Ue+Ee|0,p[0]=ge>>>0&255,p[1]=ge>>>8&255,p[2]=ge>>>16&255,p[3]=ge>>>24&255,p[4]=ie>>>0&255,p[5]=ie>>>8&255,p[6]=ie>>>16&255,p[7]=ie>>>24&255,p[8]=he>>>0&255,p[9]=he>>>8&255,p[10]=he>>>16&255,p[11]=he>>>24&255,p[12]=ye>>>0&255,p[13]=ye>>>8&255,p[14]=ye>>>16&255,p[15]=ye>>>24&255,p[16]=ve>>>0&255,p[17]=ve>>>8&255,p[18]=ve>>>16&255,p[19]=ve>>>24&255,p[20]=ne>>>0&255,p[21]=ne>>>8&255,p[22]=ne>>>16&255,p[23]=ne>>>24&255,p[24]=D>>>0&255,p[25]=D>>>8&255,p[26]=D>>>16&255,p[27]=D>>>24&255,p[28]=N>>>0&255,p[29]=N>>>8&255,p[30]=N>>>16&255,p[31]=N>>>24&255,p[32]=K>>>0&255,p[33]=K>>>8&255,p[34]=K>>>16&255,p[35]=K>>>24&255,p[36]=j>>>0&255,p[37]=j>>>8&255,p[38]=j>>>16&255,p[39]=j>>>24&255,p[40]=$>>>0&255,p[41]=$>>>8&255,p[42]=$>>>16&255,p[43]=$>>>24&255,p[44]=Y>>>0&255,p[45]=Y>>>8&255,p[46]=Y>>>16&255,p[47]=Y>>>24&255,p[48]=Ce>>>0&255,p[49]=Ce>>>8&255,p[50]=Ce>>>16&255,p[51]=Ce>>>24&255,p[52]=Ie>>>0&255,p[53]=Ie>>>8&255,p[54]=Ie>>>16&255,p[55]=Ie>>>24&255,p[56]=We>>>0&255,p[57]=We>>>8&255,p[58]=We>>>16&255,p[59]=We>>>24&255,p[60]=Ue>>>0&255,p[61]=Ue>>>8&255,p[62]=Ue>>>16&255,p[63]=Ue>>>24&255}function Ne(p,S,y,u){for(var w=u[0]&255|(u[1]&255)<<8|(u[2]&255)<<16|(u[3]&255)<<24,T=y[0]&255|(y[1]&255)<<8|(y[2]&255)<<16|(y[3]&255)<<24,I=y[4]&255|(y[5]&255)<<8|(y[6]&255)<<16|(y[7]&255)<<24,G=y[8]&255|(y[9]&255)<<8|(y[10]&255)<<16|(y[11]&255)<<24,X=y[12]&255|(y[13]&255)<<8|(y[14]&255)<<16|(y[15]&255)<<24,we=u[4]&255|(u[5]&255)<<8|(u[6]&255)<<16|(u[7]&255)<<24,le=S[0]&255|(S[1]&255)<<8|(S[2]&255)<<16|(S[3]&255)<<24,Ke=S[4]&255|(S[5]&255)<<8|(S[6]&255)<<16|(S[7]&255)<<24,fe=S[8]&255|(S[9]&255)<<8|(S[10]&255)<<16|(S[11]&255)<<24,ke=S[12]&255|(S[13]&255)<<8|(S[14]&255)<<16|(S[15]&255)<<24,Me=u[8]&255|(u[9]&255)<<8|(u[10]&255)<<16|(u[11]&255)<<24,He=y[16]&255|(y[17]&255)<<8|(y[18]&255)<<16|(y[19]&255)<<24,J=y[20]&255|(y[21]&255)<<8|(y[22]&255)<<16|(y[23]&255)<<24,Oe=y[24]&255|(y[25]&255)<<8|(y[26]&255)<<16|(y[27]&255)<<24,Te=y[28]&255|(y[29]&255)<<8|(y[30]&255)<<16|(y[31]&255)<<24,Ee=u[12]&255|(u[13]&255)<<8|(u[14]&255)<<16|(u[15]&255)<<24,ge=w,ie=T,he=I,ye=G,ve=X,ne=we,D=le,N=Ke,K=fe,j=ke,$=Me,Y=He,Ce=J,Ie=Oe,We=Te,Ue=Ee,x,Ge=0;Ge<20;Ge+=2)x=ge+Ce|0,ve^=x<<7|x>>>25,x=ve+ge|0,K^=x<<9|x>>>23,x=K+ve|0,Ce^=x<<13|x>>>19,x=Ce+K|0,ge^=x<<18|x>>>14,x=ne+ie|0,j^=x<<7|x>>>25,x=j+ne|0,Ie^=x<<9|x>>>23,x=Ie+j|0,ie^=x<<13|x>>>19,x=ie+Ie|0,ne^=x<<18|x>>>14,x=$+D|0,We^=x<<7|x>>>25,x=We+$|0,he^=x<<9|x>>>23,x=he+We|0,D^=x<<13|x>>>19,x=D+he|0,$^=x<<18|x>>>14,x=Ue+Y|0,ye^=x<<7|x>>>25,x=ye+Ue|0,N^=x<<9|x>>>23,x=N+ye|0,Y^=x<<13|x>>>19,x=Y+N|0,Ue^=x<<18|x>>>14,x=ge+ye|0,ie^=x<<7|x>>>25,x=ie+ge|0,he^=x<<9|x>>>23,x=he+ie|0,ye^=x<<13|x>>>19,x=ye+he|0,ge^=x<<18|x>>>14,x=ne+ve|0,D^=x<<7|x>>>25,x=D+ne|0,N^=x<<9|x>>>23,x=N+D|0,ve^=x<<13|x>>>19,x=ve+N|0,ne^=x<<18|x>>>14,x=$+j|0,Y^=x<<7|x>>>25,x=Y+$|0,K^=x<<9|x>>>23,x=K+Y|0,j^=x<<13|x>>>19,x=j+K|0,$^=x<<18|x>>>14,x=Ue+We|0,Ce^=x<<7|x>>>25,x=Ce+Ue|0,Ie^=x<<9|x>>>23,x=Ie+Ce|0,We^=x<<13|x>>>19,x=We+Ie|0,Ue^=x<<18|x>>>14;p[0]=ge>>>0&255,p[1]=ge>>>8&255,p[2]=ge>>>16&255,p[3]=ge>>>24&255,p[4]=ne>>>0&255,p[5]=ne>>>8&255,p[6]=ne>>>16&255,p[7]=ne>>>24&255,p[8]=$>>>0&255,p[9]=$>>>8&255,p[10]=$>>>16&255,p[11]=$>>>24&255,p[12]=Ue>>>0&255,p[13]=Ue>>>8&255,p[14]=Ue>>>16&255,p[15]=Ue>>>24&255,p[16]=D>>>0&255,p[17]=D>>>8&255,p[18]=D>>>16&255,p[19]=D>>>24&255,p[20]=N>>>0&255,p[21]=N>>>8&255,p[22]=N>>>16&255,p[23]=N>>>24&255,p[24]=K>>>0&255,p[25]=K>>>8&255,p[26]=K>>>16&255,p[27]=K>>>24&255,p[28]=j>>>0&255,p[29]=j>>>8&255,p[30]=j>>>16&255,p[31]=j>>>24&255}function H(p,S,y,u){st(p,S,y,u)}function W(p,S,y,u){Ne(p,S,y,u)}var E=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function ae(p,S,y,u,w,T,I){var G=new Uint8Array(16),X=new Uint8Array(64),we,le;for(le=0;le<16;le++)G[le]=0;for(le=0;le<8;le++)G[le]=T[le];for(;w>=64;){for(H(X,G,I,E),le=0;le<64;le++)p[S+le]=y[u+le]^X[le];for(we=1,le=8;le<16;le++)we=we+(G[le]&255)|0,G[le]=we&255,we>>>=8;w-=64,S+=64,u+=64}if(w>0)for(H(X,G,I,E),le=0;le<w;le++)p[S+le]=y[u+le]^X[le];return 0}function be(p,S,y,u,w){var T=new Uint8Array(16),I=new Uint8Array(64),G,X;for(X=0;X<16;X++)T[X]=0;for(X=0;X<8;X++)T[X]=u[X];for(;y>=64;){for(H(I,T,w,E),X=0;X<64;X++)p[S+X]=I[X];for(G=1,X=8;X<16;X++)G=G+(T[X]&255)|0,T[X]=G&255,G>>>=8;y-=64,S+=64}if(y>0)for(H(I,T,w,E),X=0;X<y;X++)p[S+X]=I[X];return 0}function ze(p,S,y,u,w){var T=new Uint8Array(32);W(T,u,w,E);for(var I=new Uint8Array(8),G=0;G<8;G++)I[G]=u[G+16];return be(p,S,y,I,T)}function Be(p,S,y,u,w,T,I){var G=new Uint8Array(32);W(G,T,I,E);for(var X=new Uint8Array(8),we=0;we<8;we++)X[we]=T[we+16];return ae(p,S,y,u,w,X,G)}var xe=function(p){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var S,y,u,w,T,I,G,X;S=p[0]&255|(p[1]&255)<<8,this.r[0]=S&8191,y=p[2]&255|(p[3]&255)<<8,this.r[1]=(S>>>13|y<<3)&8191,u=p[4]&255|(p[5]&255)<<8,this.r[2]=(y>>>10|u<<6)&7939,w=p[6]&255|(p[7]&255)<<8,this.r[3]=(u>>>7|w<<9)&8191,T=p[8]&255|(p[9]&255)<<8,this.r[4]=(w>>>4|T<<12)&255,this.r[5]=T>>>1&8190,I=p[10]&255|(p[11]&255)<<8,this.r[6]=(T>>>14|I<<2)&8191,G=p[12]&255|(p[13]&255)<<8,this.r[7]=(I>>>11|G<<5)&8065,X=p[14]&255|(p[15]&255)<<8,this.r[8]=(G>>>8|X<<8)&8191,this.r[9]=X>>>5&127,this.pad[0]=p[16]&255|(p[17]&255)<<8,this.pad[1]=p[18]&255|(p[19]&255)<<8,this.pad[2]=p[20]&255|(p[21]&255)<<8,this.pad[3]=p[22]&255|(p[23]&255)<<8,this.pad[4]=p[24]&255|(p[25]&255)<<8,this.pad[5]=p[26]&255|(p[27]&255)<<8,this.pad[6]=p[28]&255|(p[29]&255)<<8,this.pad[7]=p[30]&255|(p[31]&255)<<8};xe.prototype.blocks=function(p,S,y){for(var u=this.fin?0:2048,w,T,I,G,X,we,le,Ke,fe,ke,Me,He,J,Oe,Te,Ee,ge,ie,he,ye=this.h[0],ve=this.h[1],ne=this.h[2],D=this.h[3],N=this.h[4],K=this.h[5],j=this.h[6],$=this.h[7],Y=this.h[8],Ce=this.h[9],Ie=this.r[0],We=this.r[1],Ue=this.r[2],x=this.r[3],Ge=this.r[4],Fe=this.r[5],Je=this.r[6],Pe=this.r[7],Xe=this.r[8],Ze=this.r[9];y>=16;)w=p[S+0]&255|(p[S+1]&255)<<8,ye+=w&8191,T=p[S+2]&255|(p[S+3]&255)<<8,ve+=(w>>>13|T<<3)&8191,I=p[S+4]&255|(p[S+5]&255)<<8,ne+=(T>>>10|I<<6)&8191,G=p[S+6]&255|(p[S+7]&255)<<8,D+=(I>>>7|G<<9)&8191,X=p[S+8]&255|(p[S+9]&255)<<8,N+=(G>>>4|X<<12)&8191,K+=X>>>1&8191,we=p[S+10]&255|(p[S+11]&255)<<8,j+=(X>>>14|we<<2)&8191,le=p[S+12]&255|(p[S+13]&255)<<8,$+=(we>>>11|le<<5)&8191,Ke=p[S+14]&255|(p[S+15]&255)<<8,Y+=(le>>>8|Ke<<8)&8191,Ce+=Ke>>>5|u,fe=0,ke=fe,ke+=ye*Ie,ke+=ve*(5*Ze),ke+=ne*(5*Xe),ke+=D*(5*Pe),ke+=N*(5*Je),fe=ke>>>13,ke&=8191,ke+=K*(5*Fe),ke+=j*(5*Ge),ke+=$*(5*x),ke+=Y*(5*Ue),ke+=Ce*(5*We),fe+=ke>>>13,ke&=8191,Me=fe,Me+=ye*We,Me+=ve*Ie,Me+=ne*(5*Ze),Me+=D*(5*Xe),Me+=N*(5*Pe),fe=Me>>>13,Me&=8191,Me+=K*(5*Je),Me+=j*(5*Fe),Me+=$*(5*Ge),Me+=Y*(5*x),Me+=Ce*(5*Ue),fe+=Me>>>13,Me&=8191,He=fe,He+=ye*Ue,He+=ve*We,He+=ne*Ie,He+=D*(5*Ze),He+=N*(5*Xe),fe=He>>>13,He&=8191,He+=K*(5*Pe),He+=j*(5*Je),He+=$*(5*Fe),He+=Y*(5*Ge),He+=Ce*(5*x),fe+=He>>>13,He&=8191,J=fe,J+=ye*x,J+=ve*Ue,J+=ne*We,J+=D*Ie,J+=N*(5*Ze),fe=J>>>13,J&=8191,J+=K*(5*Xe),J+=j*(5*Pe),J+=$*(5*Je),J+=Y*(5*Fe),J+=Ce*(5*Ge),fe+=J>>>13,J&=8191,Oe=fe,Oe+=ye*Ge,Oe+=ve*x,Oe+=ne*Ue,Oe+=D*We,Oe+=N*Ie,fe=Oe>>>13,Oe&=8191,Oe+=K*(5*Ze),Oe+=j*(5*Xe),Oe+=$*(5*Pe),Oe+=Y*(5*Je),Oe+=Ce*(5*Fe),fe+=Oe>>>13,Oe&=8191,Te=fe,Te+=ye*Fe,Te+=ve*Ge,Te+=ne*x,Te+=D*Ue,Te+=N*We,fe=Te>>>13,Te&=8191,Te+=K*Ie,Te+=j*(5*Ze),Te+=$*(5*Xe),Te+=Y*(5*Pe),Te+=Ce*(5*Je),fe+=Te>>>13,Te&=8191,Ee=fe,Ee+=ye*Je,Ee+=ve*Fe,Ee+=ne*Ge,Ee+=D*x,Ee+=N*Ue,fe=Ee>>>13,Ee&=8191,Ee+=K*We,Ee+=j*Ie,Ee+=$*(5*Ze),Ee+=Y*(5*Xe),Ee+=Ce*(5*Pe),fe+=Ee>>>13,Ee&=8191,ge=fe,ge+=ye*Pe,ge+=ve*Je,ge+=ne*Fe,ge+=D*Ge,ge+=N*x,fe=ge>>>13,ge&=8191,ge+=K*Ue,ge+=j*We,ge+=$*Ie,ge+=Y*(5*Ze),ge+=Ce*(5*Xe),fe+=ge>>>13,ge&=8191,ie=fe,ie+=ye*Xe,ie+=ve*Pe,ie+=ne*Je,ie+=D*Fe,ie+=N*Ge,fe=ie>>>13,ie&=8191,ie+=K*x,ie+=j*Ue,ie+=$*We,ie+=Y*Ie,ie+=Ce*(5*Ze),fe+=ie>>>13,ie&=8191,he=fe,he+=ye*Ze,he+=ve*Xe,he+=ne*Pe,he+=D*Je,he+=N*Fe,fe=he>>>13,he&=8191,he+=K*Ge,he+=j*x,he+=$*Ue,he+=Y*We,he+=Ce*Ie,fe+=he>>>13,he&=8191,fe=(fe<<2)+fe|0,fe=fe+ke|0,ke=fe&8191,fe=fe>>>13,Me+=fe,ye=ke,ve=Me,ne=He,D=J,N=Oe,K=Te,j=Ee,$=ge,Y=ie,Ce=he,S+=16,y-=16;this.h[0]=ye,this.h[1]=ve,this.h[2]=ne,this.h[3]=D,this.h[4]=N,this.h[5]=K,this.h[6]=j,this.h[7]=$,this.h[8]=Y,this.h[9]=Ce},xe.prototype.finish=function(p,S){var y=new Uint16Array(10),u,w,T,I;if(this.leftover){for(I=this.leftover,this.buffer[I++]=1;I<16;I++)this.buffer[I]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(u=this.h[1]>>>13,this.h[1]&=8191,I=2;I<10;I++)this.h[I]+=u,u=this.h[I]>>>13,this.h[I]&=8191;for(this.h[0]+=u*5,u=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=u,u=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=u,y[0]=this.h[0]+5,u=y[0]>>>13,y[0]&=8191,I=1;I<10;I++)y[I]=this.h[I]+u,u=y[I]>>>13,y[I]&=8191;for(y[9]-=8192,w=(u^1)-1,I=0;I<10;I++)y[I]&=w;for(w=~w,I=0;I<10;I++)this.h[I]=this.h[I]&w|y[I];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,T=this.h[0]+this.pad[0],this.h[0]=T&65535,I=1;I<8;I++)T=(this.h[I]+this.pad[I]|0)+(T>>>16)|0,this.h[I]=T&65535;p[S+0]=this.h[0]>>>0&255,p[S+1]=this.h[0]>>>8&255,p[S+2]=this.h[1]>>>0&255,p[S+3]=this.h[1]>>>8&255,p[S+4]=this.h[2]>>>0&255,p[S+5]=this.h[2]>>>8&255,p[S+6]=this.h[3]>>>0&255,p[S+7]=this.h[3]>>>8&255,p[S+8]=this.h[4]>>>0&255,p[S+9]=this.h[4]>>>8&255,p[S+10]=this.h[5]>>>0&255,p[S+11]=this.h[5]>>>8&255,p[S+12]=this.h[6]>>>0&255,p[S+13]=this.h[6]>>>8&255,p[S+14]=this.h[7]>>>0&255,p[S+15]=this.h[7]>>>8&255},xe.prototype.update=function(p,S,y){var u,w;if(this.leftover){for(w=16-this.leftover,w>y&&(w=y),u=0;u<w;u++)this.buffer[this.leftover+u]=p[S+u];if(y-=w,S+=w,this.leftover+=w,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(y>=16&&(w=y-y%16,this.blocks(p,S,w),S+=w,y-=w),y){for(u=0;u<y;u++)this.buffer[this.leftover+u]=p[S+u];this.leftover+=y}};function ce(p,S,y,u,w,T){var I=new xe(T);return I.update(y,u,w),I.finish(p,S),0}function f(p,S,y,u,w,T){var I=new Uint8Array(16);return ce(I,0,y,u,w,T),Z(p,S,I,0)}function re(p,S,y,u,w){var T;if(y<32)return-1;for(Be(p,0,S,0,y,u,w),ce(p,16,p,32,y-32,p),T=0;T<16;T++)p[T]=0;return 0}function oe(p,S,y,u,w){var T,I=new Uint8Array(32);if(y<32||(ze(I,0,32,u,w),f(S,16,S,32,y-32,I)!==0))return-1;for(Be(p,0,S,0,y,u,w),T=0;T<32;T++)p[T]=0;return 0}function A(p,S){var y;for(y=0;y<16;y++)p[y]=S[y]|0}function Se(p){var S,y,u=1;for(S=0;S<16;S++)y=p[S]+u+65535,u=Math.floor(y/65536),p[S]=y-u*65536;p[0]+=u-1+37*(u-1)}function te(p,S,y){for(var u,w=~(y-1),T=0;T<16;T++)u=w&(p[T]^S[T]),p[T]^=u,S[T]^=u}function se(p,S){var y,u,w,T=i(),I=i();for(y=0;y<16;y++)I[y]=S[y];for(Se(I),Se(I),Se(I),u=0;u<2;u++){for(T[0]=I[0]-65517,y=1;y<15;y++)T[y]=I[y]-65535-(T[y-1]>>16&1),T[y-1]&=65535;T[15]=I[15]-32767-(T[14]>>16&1),w=T[15]>>16&1,T[14]&=65535,te(I,T,1-w)}for(y=0;y<16;y++)p[2*y]=I[y]&255,p[2*y+1]=I[y]>>8}function ct(p,S){var y=new Uint8Array(32),u=new Uint8Array(32);return se(y,p),se(u,S),_e(y,0,u,0)}function zt(p){var S=new Uint8Array(32);return se(S,p),S[0]&1}function Mt(p,S){var y;for(y=0;y<16;y++)p[y]=S[2*y]+(S[2*y+1]<<8);p[15]&=32767}function ut(p,S,y){for(var u=0;u<16;u++)p[u]=S[u]+y[u]}function je(p,S,y){for(var u=0;u<16;u++)p[u]=S[u]-y[u]}function Ae(p,S,y){var u,w,T=0,I=0,G=0,X=0,we=0,le=0,Ke=0,fe=0,ke=0,Me=0,He=0,J=0,Oe=0,Te=0,Ee=0,ge=0,ie=0,he=0,ye=0,ve=0,ne=0,D=0,N=0,K=0,j=0,$=0,Y=0,Ce=0,Ie=0,We=0,Ue=0,x=y[0],Ge=y[1],Fe=y[2],Je=y[3],Pe=y[4],Xe=y[5],Ze=y[6],gt=y[7],rt=y[8],ft=y[9],mt=y[10],qe=y[11],ue=y[12],Ot=y[13],nt=y[14],Bt=y[15];u=S[0],T+=u*x,I+=u*Ge,G+=u*Fe,X+=u*Je,we+=u*Pe,le+=u*Xe,Ke+=u*Ze,fe+=u*gt,ke+=u*rt,Me+=u*ft,He+=u*mt,J+=u*qe,Oe+=u*ue,Te+=u*Ot,Ee+=u*nt,ge+=u*Bt,u=S[1],I+=u*x,G+=u*Ge,X+=u*Fe,we+=u*Je,le+=u*Pe,Ke+=u*Xe,fe+=u*Ze,ke+=u*gt,Me+=u*rt,He+=u*ft,J+=u*mt,Oe+=u*qe,Te+=u*ue,Ee+=u*Ot,ge+=u*nt,ie+=u*Bt,u=S[2],G+=u*x,X+=u*Ge,we+=u*Fe,le+=u*Je,Ke+=u*Pe,fe+=u*Xe,ke+=u*Ze,Me+=u*gt,He+=u*rt,J+=u*ft,Oe+=u*mt,Te+=u*qe,Ee+=u*ue,ge+=u*Ot,ie+=u*nt,he+=u*Bt,u=S[3],X+=u*x,we+=u*Ge,le+=u*Fe,Ke+=u*Je,fe+=u*Pe,ke+=u*Xe,Me+=u*Ze,He+=u*gt,J+=u*rt,Oe+=u*ft,Te+=u*mt,Ee+=u*qe,ge+=u*ue,ie+=u*Ot,he+=u*nt,ye+=u*Bt,u=S[4],we+=u*x,le+=u*Ge,Ke+=u*Fe,fe+=u*Je,ke+=u*Pe,Me+=u*Xe,He+=u*Ze,J+=u*gt,Oe+=u*rt,Te+=u*ft,Ee+=u*mt,ge+=u*qe,ie+=u*ue,he+=u*Ot,ye+=u*nt,ve+=u*Bt,u=S[5],le+=u*x,Ke+=u*Ge,fe+=u*Fe,ke+=u*Je,Me+=u*Pe,He+=u*Xe,J+=u*Ze,Oe+=u*gt,Te+=u*rt,Ee+=u*ft,ge+=u*mt,ie+=u*qe,he+=u*ue,ye+=u*Ot,ve+=u*nt,ne+=u*Bt,u=S[6],Ke+=u*x,fe+=u*Ge,ke+=u*Fe,Me+=u*Je,He+=u*Pe,J+=u*Xe,Oe+=u*Ze,Te+=u*gt,Ee+=u*rt,ge+=u*ft,ie+=u*mt,he+=u*qe,ye+=u*ue,ve+=u*Ot,ne+=u*nt,D+=u*Bt,u=S[7],fe+=u*x,ke+=u*Ge,Me+=u*Fe,He+=u*Je,J+=u*Pe,Oe+=u*Xe,Te+=u*Ze,Ee+=u*gt,ge+=u*rt,ie+=u*ft,he+=u*mt,ye+=u*qe,ve+=u*ue,ne+=u*Ot,D+=u*nt,N+=u*Bt,u=S[8],ke+=u*x,Me+=u*Ge,He+=u*Fe,J+=u*Je,Oe+=u*Pe,Te+=u*Xe,Ee+=u*Ze,ge+=u*gt,ie+=u*rt,he+=u*ft,ye+=u*mt,ve+=u*qe,ne+=u*ue,D+=u*Ot,N+=u*nt,K+=u*Bt,u=S[9],Me+=u*x,He+=u*Ge,J+=u*Fe,Oe+=u*Je,Te+=u*Pe,Ee+=u*Xe,ge+=u*Ze,ie+=u*gt,he+=u*rt,ye+=u*ft,ve+=u*mt,ne+=u*qe,D+=u*ue,N+=u*Ot,K+=u*nt,j+=u*Bt,u=S[10],He+=u*x,J+=u*Ge,Oe+=u*Fe,Te+=u*Je,Ee+=u*Pe,ge+=u*Xe,ie+=u*Ze,he+=u*gt,ye+=u*rt,ve+=u*ft,ne+=u*mt,D+=u*qe,N+=u*ue,K+=u*Ot,j+=u*nt,$+=u*Bt,u=S[11],J+=u*x,Oe+=u*Ge,Te+=u*Fe,Ee+=u*Je,ge+=u*Pe,ie+=u*Xe,he+=u*Ze,ye+=u*gt,ve+=u*rt,ne+=u*ft,D+=u*mt,N+=u*qe,K+=u*ue,j+=u*Ot,$+=u*nt,Y+=u*Bt,u=S[12],Oe+=u*x,Te+=u*Ge,Ee+=u*Fe,ge+=u*Je,ie+=u*Pe,he+=u*Xe,ye+=u*Ze,ve+=u*gt,ne+=u*rt,D+=u*ft,N+=u*mt,K+=u*qe,j+=u*ue,$+=u*Ot,Y+=u*nt,Ce+=u*Bt,u=S[13],Te+=u*x,Ee+=u*Ge,ge+=u*Fe,ie+=u*Je,he+=u*Pe,ye+=u*Xe,ve+=u*Ze,ne+=u*gt,D+=u*rt,N+=u*ft,K+=u*mt,j+=u*qe,$+=u*ue,Y+=u*Ot,Ce+=u*nt,Ie+=u*Bt,u=S[14],Ee+=u*x,ge+=u*Ge,ie+=u*Fe,he+=u*Je,ye+=u*Pe,ve+=u*Xe,ne+=u*Ze,D+=u*gt,N+=u*rt,K+=u*ft,j+=u*mt,$+=u*qe,Y+=u*ue,Ce+=u*Ot,Ie+=u*nt,We+=u*Bt,u=S[15],ge+=u*x,ie+=u*Ge,he+=u*Fe,ye+=u*Je,ve+=u*Pe,ne+=u*Xe,D+=u*Ze,N+=u*gt,K+=u*rt,j+=u*ft,$+=u*mt,Y+=u*qe,Ce+=u*ue,Ie+=u*Ot,We+=u*nt,Ue+=u*Bt,T+=38*ie,I+=38*he,G+=38*ye,X+=38*ve,we+=38*ne,le+=38*D,Ke+=38*N,fe+=38*K,ke+=38*j,Me+=38*$,He+=38*Y,J+=38*Ce,Oe+=38*Ie,Te+=38*We,Ee+=38*Ue,w=1,u=T+w+65535,w=Math.floor(u/65536),T=u-w*65536,u=I+w+65535,w=Math.floor(u/65536),I=u-w*65536,u=G+w+65535,w=Math.floor(u/65536),G=u-w*65536,u=X+w+65535,w=Math.floor(u/65536),X=u-w*65536,u=we+w+65535,w=Math.floor(u/65536),we=u-w*65536,u=le+w+65535,w=Math.floor(u/65536),le=u-w*65536,u=Ke+w+65535,w=Math.floor(u/65536),Ke=u-w*65536,u=fe+w+65535,w=Math.floor(u/65536),fe=u-w*65536,u=ke+w+65535,w=Math.floor(u/65536),ke=u-w*65536,u=Me+w+65535,w=Math.floor(u/65536),Me=u-w*65536,u=He+w+65535,w=Math.floor(u/65536),He=u-w*65536,u=J+w+65535,w=Math.floor(u/65536),J=u-w*65536,u=Oe+w+65535,w=Math.floor(u/65536),Oe=u-w*65536,u=Te+w+65535,w=Math.floor(u/65536),Te=u-w*65536,u=Ee+w+65535,w=Math.floor(u/65536),Ee=u-w*65536,u=ge+w+65535,w=Math.floor(u/65536),ge=u-w*65536,T+=w-1+37*(w-1),w=1,u=T+w+65535,w=Math.floor(u/65536),T=u-w*65536,u=I+w+65535,w=Math.floor(u/65536),I=u-w*65536,u=G+w+65535,w=Math.floor(u/65536),G=u-w*65536,u=X+w+65535,w=Math.floor(u/65536),X=u-w*65536,u=we+w+65535,w=Math.floor(u/65536),we=u-w*65536,u=le+w+65535,w=Math.floor(u/65536),le=u-w*65536,u=Ke+w+65535,w=Math.floor(u/65536),Ke=u-w*65536,u=fe+w+65535,w=Math.floor(u/65536),fe=u-w*65536,u=ke+w+65535,w=Math.floor(u/65536),ke=u-w*65536,u=Me+w+65535,w=Math.floor(u/65536),Me=u-w*65536,u=He+w+65535,w=Math.floor(u/65536),He=u-w*65536,u=J+w+65535,w=Math.floor(u/65536),J=u-w*65536,u=Oe+w+65535,w=Math.floor(u/65536),Oe=u-w*65536,u=Te+w+65535,w=Math.floor(u/65536),Te=u-w*65536,u=Ee+w+65535,w=Math.floor(u/65536),Ee=u-w*65536,u=ge+w+65535,w=Math.floor(u/65536),ge=u-w*65536,T+=w-1+37*(w-1),p[0]=T,p[1]=I,p[2]=G,p[3]=X,p[4]=we,p[5]=le,p[6]=Ke,p[7]=fe,p[8]=ke,p[9]=Me,p[10]=He,p[11]=J,p[12]=Oe,p[13]=Te,p[14]=Ee,p[15]=ge}function at(p,S){Ae(p,S,S)}function oi(p,S){var y=i(),u;for(u=0;u<16;u++)y[u]=S[u];for(u=253;u>=0;u--)at(y,y),u!==2&&u!==4&&Ae(y,y,S);for(u=0;u<16;u++)p[u]=y[u]}function Ni(p,S){var y=i(),u;for(u=0;u<16;u++)y[u]=S[u];for(u=250;u>=0;u--)at(y,y),u!==1&&Ae(y,y,S);for(u=0;u<16;u++)p[u]=y[u]}function qt(p,S,y){var u=new Uint8Array(32),w=new Float64Array(80),T,I,G=i(),X=i(),we=i(),le=i(),Ke=i(),fe=i();for(I=0;I<31;I++)u[I]=S[I];for(u[31]=S[31]&127|64,u[0]&=248,Mt(w,y),I=0;I<16;I++)X[I]=w[I],le[I]=G[I]=we[I]=0;for(G[0]=le[0]=1,I=254;I>=0;--I)T=u[I>>>3]>>>(I&7)&1,te(G,X,T),te(we,le,T),ut(Ke,G,we),je(G,G,we),ut(we,X,le),je(X,X,le),at(le,Ke),at(fe,G),Ae(G,we,G),Ae(we,X,Ke),ut(Ke,G,we),je(G,G,we),at(X,G),je(we,le,fe),Ae(G,we,v),ut(G,G,le),Ae(we,we,G),Ae(G,le,fe),Ae(le,X,w),at(X,Ke),te(G,X,T),te(we,le,T);for(I=0;I<16;I++)w[I+16]=G[I],w[I+32]=we[I],w[I+48]=X[I],w[I+64]=le[I];var ke=w.subarray(32),Me=w.subarray(16);return oi(ke,ke),Ae(Me,Me,ke),se(p,Me),0}function ai(p,S){return qt(p,S,h)}function fi(p,S){return n(S,32),ai(p,S)}function Gt(p,S,y){var u=new Uint8Array(32);return qt(u,y,S),W(p,a,u,E)}var et=re,_i=oe;function Dr(p,S,y,u,w,T){var I=new Uint8Array(32);return Gt(I,w,T),et(p,S,y,u,I)}function Nr(p,S,y,u,w,T){var I=new Uint8Array(32);return Gt(I,w,T),_i(p,S,y,u,I)}var Hr=[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 Gs(p,S,y,u){for(var w=new Int32Array(16),T=new Int32Array(16),I,G,X,we,le,Ke,fe,ke,Me,He,J,Oe,Te,Ee,ge,ie,he,ye,ve,ne,D,N,K,j,$,Y,Ce=p[0],Ie=p[1],We=p[2],Ue=p[3],x=p[4],Ge=p[5],Fe=p[6],Je=p[7],Pe=S[0],Xe=S[1],Ze=S[2],gt=S[3],rt=S[4],ft=S[5],mt=S[6],qe=S[7],ue=0;u>=128;){for(ve=0;ve<16;ve++)ne=8*ve+ue,w[ve]=y[ne+0]<<24|y[ne+1]<<16|y[ne+2]<<8|y[ne+3],T[ve]=y[ne+4]<<24|y[ne+5]<<16|y[ne+6]<<8|y[ne+7];for(ve=0;ve<80;ve++)if(I=Ce,G=Ie,X=We,we=Ue,le=x,Ke=Ge,fe=Fe,ke=Je,Me=Pe,He=Xe,J=Ze,Oe=gt,Te=rt,Ee=ft,ge=mt,ie=qe,D=Je,N=qe,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=(x>>>14|rt<<18)^(x>>>18|rt<<14)^(rt>>>9|x<<23),N=(rt>>>14|x<<18)^(rt>>>18|x<<14)^(x>>>9|rt<<23),K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,D=x&Ge^~x&Fe,N=rt&ft^~rt&mt,K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,D=Hr[ve*2],N=Hr[ve*2+1],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,D=w[ve%16],N=T[ve%16],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,he=$&65535|Y<<16,ye=K&65535|j<<16,D=he,N=ye,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=(Ce>>>28|Pe<<4)^(Pe>>>2|Ce<<30)^(Pe>>>7|Ce<<25),N=(Pe>>>28|Ce<<4)^(Ce>>>2|Pe<<30)^(Ce>>>7|Pe<<25),K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,D=Ce&Ie^Ce&We^Ie&We,N=Pe&Xe^Pe&Ze^Xe&Ze,K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,ke=$&65535|Y<<16,ie=K&65535|j<<16,D=we,N=Oe,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=he,N=ye,K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,we=$&65535|Y<<16,Oe=K&65535|j<<16,Ie=I,We=G,Ue=X,x=we,Ge=le,Fe=Ke,Je=fe,Ce=ke,Xe=Me,Ze=He,gt=J,rt=Oe,ft=Te,mt=Ee,qe=ge,Pe=ie,ve%16===15)for(ne=0;ne<16;ne++)D=w[ne],N=T[ne],K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=w[(ne+9)%16],N=T[(ne+9)%16],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,he=w[(ne+1)%16],ye=T[(ne+1)%16],D=(he>>>1|ye<<31)^(he>>>8|ye<<24)^he>>>7,N=(ye>>>1|he<<31)^(ye>>>8|he<<24)^(ye>>>7|he<<25),K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,he=w[(ne+14)%16],ye=T[(ne+14)%16],D=(he>>>19|ye<<13)^(ye>>>29|he<<3)^he>>>6,N=(ye>>>19|he<<13)^(he>>>29|ye<<3)^(ye>>>6|he<<26),K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,w[ne]=$&65535|Y<<16,T[ne]=K&65535|j<<16;D=Ce,N=Pe,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[0],N=S[0],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[0]=Ce=$&65535|Y<<16,S[0]=Pe=K&65535|j<<16,D=Ie,N=Xe,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[1],N=S[1],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[1]=Ie=$&65535|Y<<16,S[1]=Xe=K&65535|j<<16,D=We,N=Ze,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[2],N=S[2],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[2]=We=$&65535|Y<<16,S[2]=Ze=K&65535|j<<16,D=Ue,N=gt,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[3],N=S[3],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[3]=Ue=$&65535|Y<<16,S[3]=gt=K&65535|j<<16,D=x,N=rt,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[4],N=S[4],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[4]=x=$&65535|Y<<16,S[4]=rt=K&65535|j<<16,D=Ge,N=ft,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[5],N=S[5],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[5]=Ge=$&65535|Y<<16,S[5]=ft=K&65535|j<<16,D=Fe,N=mt,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[6],N=S[6],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[6]=Fe=$&65535|Y<<16,S[6]=mt=K&65535|j<<16,D=Je,N=qe,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[7],N=S[7],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[7]=Je=$&65535|Y<<16,S[7]=qe=K&65535|j<<16,ue+=128,u-=128}return u}function gi(p,S,y){var u=new Int32Array(8),w=new Int32Array(8),T=new Uint8Array(256),I,G=y;for(u[0]=1779033703,u[1]=3144134277,u[2]=1013904242,u[3]=2773480762,u[4]=1359893119,u[5]=2600822924,u[6]=528734635,u[7]=1541459225,w[0]=4089235720,w[1]=2227873595,w[2]=4271175723,w[3]=1595750129,w[4]=2917565137,w[5]=725511199,w[6]=4215389547,w[7]=327033209,Gs(u,w,S,y),y%=128,I=0;I<y;I++)T[I]=S[G-y+I];for(T[y]=128,y=256-128*(y<112?1:0),T[y-9]=0,P(T,y-8,G/536870912|0,G<<3),Gs(u,w,T,y),I=0;I<8;I++)P(p,8*I,u[I],w[I]);return 0}function vi(p,S){var y=i(),u=i(),w=i(),T=i(),I=i(),G=i(),X=i(),we=i(),le=i();je(y,p[1],p[0]),je(le,S[1],S[0]),Ae(y,y,le),ut(u,p[0],p[1]),ut(le,S[0],S[1]),Ae(u,u,le),Ae(w,p[3],S[3]),Ae(w,w,R),Ae(T,p[2],S[2]),ut(T,T,T),je(I,u,y),je(G,T,w),ut(X,T,w),ut(we,u,y),Ae(p[0],I,G),Ae(p[1],we,X),Ae(p[2],X,G),Ae(p[3],I,we)}function vs(p,S,y){var u;for(u=0;u<4;u++)te(p[u],S[u],y)}function Hi(p,S){var y=i(),u=i(),w=i();oi(w,S[2]),Ae(y,S[0],w),Ae(u,S[1],w),se(p,u),p[31]^=zt(y)<<7}function rs(p,S,y){var u,w;for(A(p[0],d),A(p[1],g),A(p[2],g),A(p[3],d),w=255;w>=0;--w)u=y[w/8|0]>>(w&7)&1,vs(p,S,u),vi(S,p),vi(p,p),vs(p,S,u)}function tt(p,S){var y=[i(),i(),i(),i()];A(y[0],k),A(y[1],B),A(y[2],g),Ae(y[3],k,B),rs(p,y,S)}function ys(p,S,y){var u=new Uint8Array(64),w=[i(),i(),i(),i()],T;for(y||n(S,32),gi(u,S,32),u[0]&=248,u[31]&=127,u[31]|=64,tt(w,u),Hi(p,w),T=0;T<32;T++)S[T+32]=p[T];return 0}var ns=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Ui(p,S){var y,u,w,T;for(u=63;u>=32;--u){for(y=0,w=u-32,T=u-12;w<T;++w)S[w]+=y-16*S[u]*ns[w-(u-32)],y=Math.floor((S[w]+128)/256),S[w]-=y*256;S[w]+=y,S[u]=0}for(y=0,w=0;w<32;w++)S[w]+=y-(S[31]>>4)*ns[w],y=S[w]>>8,S[w]&=255;for(w=0;w<32;w++)S[w]-=y*ns[w];for(u=0;u<32;u++)S[u+1]+=S[u]>>8,p[u]=S[u]&255}function Ss(p){var S=new Float64Array(64),y;for(y=0;y<64;y++)S[y]=p[y];for(y=0;y<64;y++)p[y]=0;Ui(p,S)}function js(p,S,y,u){var w=new Uint8Array(64),T=new Uint8Array(64),I=new Uint8Array(64),G,X,we=new Float64Array(64),le=[i(),i(),i(),i()];gi(w,u,32),w[0]&=248,w[31]&=127,w[31]|=64;var Ke=y+64;for(G=0;G<y;G++)p[64+G]=S[G];for(G=0;G<32;G++)p[32+G]=w[32+G];for(gi(I,p.subarray(32),y+32),Ss(I),tt(le,I),Hi(p,le),G=32;G<64;G++)p[G]=u[G];for(gi(T,p,y+64),Ss(T),G=0;G<64;G++)we[G]=0;for(G=0;G<32;G++)we[G]=I[G];for(G=0;G<32;G++)for(X=0;X<32;X++)we[G+X]+=T[G]*w[X];return Ui(p.subarray(32),we),Ke}function Vt(p,S){var y=i(),u=i(),w=i(),T=i(),I=i(),G=i(),X=i();return A(p[2],g),Mt(p[1],S),at(w,p[1]),Ae(T,w,m),je(w,w,p[2]),ut(T,p[2],T),at(I,T),at(G,I),Ae(X,G,I),Ae(y,X,w),Ae(y,y,T),Ni(y,y),Ae(y,y,w),Ae(y,y,T),Ae(y,y,T),Ae(p[0],y,T),at(u,p[0]),Ae(u,u,T),ct(u,w)&&Ae(p[0],p[0],L),at(u,p[0]),Ae(u,u,T),ct(u,w)?-1:(zt(p[0])===S[31]>>7&&je(p[0],d,p[0]),Ae(p[3],p[0],p[1]),0)}function bt(p,S,y,u){var w,T=new Uint8Array(32),I=new Uint8Array(64),G=[i(),i(),i(),i()],X=[i(),i(),i(),i()];if(y<64||Vt(X,u))return-1;for(w=0;w<y;w++)p[w]=S[w];for(w=0;w<32;w++)p[w+32]=u[w];if(gi(I,p,y),Ss(I),rs(G,X,I),tt(X,S.subarray(32)),vi(G,X),Hi(T,G),y-=64,_e(S,0,T,0)){for(w=0;w<y;w++)p[w]=0;return-1}for(w=0;w<y;w++)p[w]=S[w+64];return y}var Kt=32,Wi=24,Fi=32,Oi=16,zi=32,qi=32,Ti=32,Gi=32,bs=32,os=Wi,Ur=Fi,ws=Oi,dt=64,yi=32,ji=64,Cs=32,$s=64;t.lowlevel={crypto_core_hsalsa20:W,crypto_stream_xor:Be,crypto_stream:ze,crypto_stream_salsa20_xor:ae,crypto_stream_salsa20:be,crypto_onetimeauth:ce,crypto_onetimeauth_verify:f,crypto_verify_16:Z,crypto_verify_32:_e,crypto_secretbox:re,crypto_secretbox_open:oe,crypto_scalarmult:qt,crypto_scalarmult_base:ai,crypto_box_beforenm:Gt,crypto_box_afternm:et,crypto_box:Dr,crypto_box_open:Nr,crypto_box_keypair:fi,crypto_hash:gi,crypto_sign:js,crypto_sign_keypair:ys,crypto_sign_open:bt,crypto_secretbox_KEYBYTES:Kt,crypto_secretbox_NONCEBYTES:Wi,crypto_secretbox_ZEROBYTES:Fi,crypto_secretbox_BOXZEROBYTES:Oi,crypto_scalarmult_BYTES:zi,crypto_scalarmult_SCALARBYTES:qi,crypto_box_PUBLICKEYBYTES:Ti,crypto_box_SECRETKEYBYTES:Gi,crypto_box_BEFORENMBYTES:bs,crypto_box_NONCEBYTES:os,crypto_box_ZEROBYTES:Ur,crypto_box_BOXZEROBYTES:ws,crypto_sign_BYTES:dt,crypto_sign_PUBLICKEYBYTES:yi,crypto_sign_SECRETKEYBYTES:ji,crypto_sign_SEEDBYTES:Cs,crypto_hash_BYTES:$s,gf:i,D:m,L:ns,pack25519:se,unpack25519:Mt,M:Ae,A:ut,S:at,Z:je,pow2523:Ni,add:vi,set25519:A,modL:Ui,scalarmult:rs,scalarbase:tt};function Qt(p,S){if(p.length!==Kt)throw new Error("bad key size");if(S.length!==Wi)throw new Error("bad nonce size")}function Cn(p,S){if(p.length!==Ti)throw new Error("bad public key size");if(S.length!==Gi)throw new Error("bad secret key size")}function Yt(){for(var p=0;p<arguments.length;p++)if(!(arguments[p]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Vs(p){for(var S=0;S<p.length;S++)p[S]=0}t.randomBytes=function(p){var S=new Uint8Array(p);return n(S,p),S},t.secretbox=function(p,S,y){Yt(p,S,y),Qt(y,S);for(var u=new Uint8Array(Fi+p.length),w=new Uint8Array(u.length),T=0;T<p.length;T++)u[T+Fi]=p[T];return re(w,u,u.length,S,y),w.subarray(Oi)},t.secretbox.open=function(p,S,y){Yt(p,S,y),Qt(y,S);for(var u=new Uint8Array(Oi+p.length),w=new Uint8Array(u.length),T=0;T<p.length;T++)u[T+Oi]=p[T];return u.length<32||oe(w,u,u.length,S,y)!==0?null:w.subarray(Fi)},t.secretbox.keyLength=Kt,t.secretbox.nonceLength=Wi,t.secretbox.overheadLength=Oi,t.scalarMult=function(p,S){if(Yt(p,S),p.length!==qi)throw new Error("bad n size");if(S.length!==zi)throw new Error("bad p size");var y=new Uint8Array(zi);return qt(y,p,S),y},t.scalarMult.base=function(p){if(Yt(p),p.length!==qi)throw new Error("bad n size");var S=new Uint8Array(zi);return ai(S,p),S},t.scalarMult.scalarLength=qi,t.scalarMult.groupElementLength=zi,t.box=function(p,S,y,u){var w=t.box.before(y,u);return t.secretbox(p,S,w)},t.box.before=function(p,S){Yt(p,S),Cn(p,S);var y=new Uint8Array(bs);return Gt(y,p,S),y},t.box.after=t.secretbox,t.box.open=function(p,S,y,u){var w=t.box.before(y,u);return t.secretbox.open(p,S,w)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var p=new Uint8Array(Ti),S=new Uint8Array(Gi);return fi(p,S),{publicKey:p,secretKey:S}},t.box.keyPair.fromSecretKey=function(p){if(Yt(p),p.length!==Gi)throw new Error("bad secret key size");var S=new Uint8Array(Ti);return ai(S,p),{publicKey:S,secretKey:new Uint8Array(p)}},t.box.publicKeyLength=Ti,t.box.secretKeyLength=Gi,t.box.sharedKeyLength=bs,t.box.nonceLength=os,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(p,S){if(Yt(p,S),S.length!==ji)throw new Error("bad secret key size");var y=new Uint8Array(dt+p.length);return js(y,p,p.length,S),y},t.sign.open=function(p,S){if(Yt(p,S),S.length!==yi)throw new Error("bad public key size");var y=new Uint8Array(p.length),u=bt(y,p,p.length,S);if(u<0)return null;for(var w=new Uint8Array(u),T=0;T<w.length;T++)w[T]=y[T];return w},t.sign.detached=function(p,S){for(var y=t.sign(p,S),u=new Uint8Array(dt),w=0;w<u.length;w++)u[w]=y[w];return u},t.sign.detached.verify=function(p,S,y){if(Yt(p,S,y),S.length!==dt)throw new Error("bad signature size");if(y.length!==yi)throw new Error("bad public key size");var u=new Uint8Array(dt+p.length),w=new Uint8Array(dt+p.length),T;for(T=0;T<dt;T++)u[T]=S[T];for(T=0;T<p.length;T++)u[T+dt]=p[T];return bt(w,u,u.length,y)>=0},t.sign.keyPair=function(){var p=new Uint8Array(yi),S=new Uint8Array(ji);return ys(p,S),{publicKey:p,secretKey:S}},t.sign.keyPair.fromSecretKey=function(p){if(Yt(p),p.length!==ji)throw new Error("bad secret key size");for(var S=new Uint8Array(yi),y=0;y<S.length;y++)S[y]=p[32+y];return{publicKey:S,secretKey:new Uint8Array(p)}},t.sign.keyPair.fromSeed=function(p){if(Yt(p),p.length!==Cs)throw new Error("bad seed size");for(var S=new Uint8Array(yi),y=new Uint8Array(ji),u=0;u<32;u++)y[u]=p[u];return ys(S,y,!0),{publicKey:S,secretKey:y}},t.sign.publicKeyLength=yi,t.sign.secretKeyLength=ji,t.sign.seedLength=Cs,t.sign.signatureLength=dt,t.hash=function(p){Yt(p);var S=new Uint8Array($s);return gi(S,p,p.length),S},t.hash.hashLength=$s,t.verify=function(p,S){return Yt(p,S),p.length===0||S.length===0||p.length!==S.length?!1:U(p,0,S,0,p.length)===0},t.setPRNG=function(p){n=p},(function(){var p=typeof self<"u"?self.crypto||self.msCrypto:null;if(p&&p.getRandomValues){var S=65536;t.setPRNG(function(y,u){var w,T=new Uint8Array(u);for(w=0;w<u;w+=S)p.getRandomValues(T.subarray(w,w+Math.min(u-w,S)));for(w=0;w<u;w++)y[w]=T[w];Vs(T)})}else typeof gf<"u"&&(p=vf,p&&p.randomBytes&&t.setPRNG(function(y,u){var w,T=p.randomBytes(u);for(w=0;w<u;w++)y[w]=T[w];Vs(T)}))})()})(e.exports?e.exports:self.nacl=self.nacl||{})})(Kn)),Kn.exports}var Sf=yf();const uo=af(Sf),Ws=24,bf=16;function wf(e,t){const i=uo.randomBytes(Ws),n=uo.secretbox(e,i,t),a=new Uint8Array(Ws+n.length);return a.set(i),a.set(n,Ws),a}function Cf(e,t){if(e.length<Ws+bf)throw new Error("Sealed data too short");const i=e.slice(0,Ws),n=e.slice(Ws),a=uo.secretbox.open(n,i,t);if(!a)throw new Error("Decryption failed - data may be tampered with");return a}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function xf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function fo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function vn(e,...t){if(!xf(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function _a(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");fo(e.outputLen),fo(e.blockLen)}function cn(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 kf(e,t){vn(e);const i=t.outputLen;if(e.length<i)throw new Error("digestInto() expects output buffer of length at least "+i)}function xr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Yn(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function wi(e,t){return e<<32-t|e>>>t}function Ef(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function kr(e){return typeof e=="string"&&(e=Ef(e)),vn(e),e}class jh{}function Rf(e){const t=n=>e().update(kr(n)).digest(),i=e();return t.outputLen=i.outputLen,t.blockLen=i.blockLen,t.create=()=>e(),t}function Af(e,t,i,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,i,n);const a=BigInt(32),h=BigInt(4294967295),d=Number(i>>a&h),g=Number(i&h),v=n?4:0,m=n?0:4;e.setUint32(t+v,d,n),e.setUint32(t+m,g,n)}function Mf(e,t,i){return e&t^~e&i}function Of(e,t,i){return e&t^e&i^t&i}class Tf extends jh{constructor(t,i,n,a){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=i,this.padOffset=n,this.isLE=a,this.buffer=new Uint8Array(t),this.view=Yn(this.buffer)}update(t){cn(this),t=kr(t),vn(t);const{view:i,buffer:n,blockLen:a}=this,h=t.length;for(let d=0;d<h;){const g=Math.min(a-this.pos,h-d);if(g===a){const v=Yn(t);for(;a<=h-d;d+=a)this.process(v,d);continue}n.set(t.subarray(d,d+g),this.pos),this.pos+=g,d+=g,this.pos===a&&(this.process(i,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){cn(this),kf(t,this),this.finished=!0;const{buffer:i,view:n,blockLen:a,isLE:h}=this;let{pos:d}=this;i[d++]=128,xr(this.buffer.subarray(d)),this.padOffset>a-d&&(this.process(n,0),d=0);for(let k=d;k<a;k++)i[k]=0;Af(n,a-8,BigInt(this.length*8),h),this.process(n,0);const g=Yn(t),v=this.outputLen;if(v%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const m=v/4,R=this.get();if(m>R.length)throw new Error("_sha2: outputLen bigger than state");for(let k=0;k<m;k++)g.setUint32(4*k,R[k],h)}digest(){const{buffer:t,outputLen:i}=this;this.digestInto(t);const n=t.slice(0,i);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:i,buffer:n,length:a,finished:h,destroyed:d,pos:g}=this;return t.destroyed=d,t.finished=h,t.length=a,t.pos=g,a%i&&t.buffer.set(n),t}clone(){return this._cloneInto()}}const Yi=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pf=Uint32Array.from([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]),Ji=new Uint32Array(64);class Lf extends Tf{constructor(t=32){super(64,t,8,!1),this.A=Yi[0]|0,this.B=Yi[1]|0,this.C=Yi[2]|0,this.D=Yi[3]|0,this.E=Yi[4]|0,this.F=Yi[5]|0,this.G=Yi[6]|0,this.H=Yi[7]|0}get(){const{A:t,B:i,C:n,D:a,E:h,F:d,G:g,H:v}=this;return[t,i,n,a,h,d,g,v]}set(t,i,n,a,h,d,g,v){this.A=t|0,this.B=i|0,this.C=n|0,this.D=a|0,this.E=h|0,this.F=d|0,this.G=g|0,this.H=v|0}process(t,i){for(let k=0;k<16;k++,i+=4)Ji[k]=t.getUint32(i,!1);for(let k=16;k<64;k++){const B=Ji[k-15],L=Ji[k-2],P=wi(B,7)^wi(B,18)^B>>>3,U=wi(L,17)^wi(L,19)^L>>>10;Ji[k]=U+Ji[k-7]+P+Ji[k-16]|0}let{A:n,B:a,C:h,D:d,E:g,F:v,G:m,H:R}=this;for(let k=0;k<64;k++){const B=wi(g,6)^wi(g,11)^wi(g,25),L=R+B+Mf(g,v,m)+Pf[k]+Ji[k]|0,U=(wi(n,2)^wi(n,13)^wi(n,22))+Of(n,a,h)|0;R=m,m=v,v=g,g=d+L|0,d=h,h=a,a=n,n=L+U|0}n=n+this.A|0,a=a+this.B|0,h=h+this.C|0,d=d+this.D|0,g=g+this.E|0,v=v+this.F|0,m=m+this.G|0,R=R+this.H|0,this.set(n,a,h,d,g,v,m,R)}roundClean(){xr(Ji)}destroy(){this.set(0,0,0,0,0,0,0,0),xr(this.buffer)}}const Bf=Rf(()=>new Lf),Tr=Bf;class $h extends jh{constructor(t,i){super(),this.finished=!1,this.destroyed=!1,_a(t);const n=kr(i);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const a=this.blockLen,h=new Uint8Array(a);h.set(n.length>a?t.create().update(n).digest():n);for(let d=0;d<h.length;d++)h[d]^=54;this.iHash.update(h),this.oHash=t.create();for(let d=0;d<h.length;d++)h[d]^=106;this.oHash.update(h),xr(h)}update(t){return cn(this),this.iHash.update(t),this}digestInto(t){cn(this),vn(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:i,iHash:n,finished:a,destroyed:h,blockLen:d,outputLen:g}=this;return t=t,t.finished=a,t.destroyed=h,t.blockLen=d,t.outputLen=g,t.oHash=i._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const ga=(e,t,i)=>new $h(e,t).update(i).digest();ga.create=(e,t)=>new $h(e,t);function If(e,t,i){return _a(e),i===void 0&&(i=new Uint8Array(e.outputLen)),ga(e,kr(i),kr(t))}const Jn=Uint8Array.from([0]),Df=Uint8Array.of();function Nf(e,t,i,n=32){_a(e),fo(n);const a=e.outputLen;if(n>255*a)throw new Error("Length should be <= 255*HashLen");const h=Math.ceil(n/a),d=new Uint8Array(h*a),g=ga.create(e,t),v=g._cloneInto(),m=new Uint8Array(g.outputLen);for(let R=0;R<h;R++)Jn[0]=R+1,v.update(R===0?Df:m).update(i).update(Jn).digestInto(m),d.set(m,a*R),g._cloneInto(v);return g.destroy(),v.destroy(),xr(m,Jn),d.slice(0,n)}const Hf=(e,t,i,n,a)=>Nf(e,If(e,t,i),n,a);function Uf(e){const t=Tr(new TextEncoder().encode(`airloom-session:${e}`));return Array.from(t.slice(0,16),i=>i.toString(16).padStart(2,"0")).join("")}function pa(e,t){const i=new TextEncoder().encode("airloom-v1");return Hf(Tr,e,i,"airloom-encryption",32)}function Wf(e){return e.replace(/[-\s]/g,"").toUpperCase()}class Ff{constructor(t,i,n){Qe(this,"_ended",!1);this.id=t,this.sendFn=i,this.meta=n}write(t){if(this._ended)throw new Error("Cannot write after stream has ended");this.sendFn({type:"stream_chunk",id:this.id,data:t})}end(){this._ended||(this._ended=!0,this.sendFn({type:"stream_end",id:this.id}))}get ended(){return this._ended}}class zf extends Gh.EventEmitter{constructor(i,n){super();Qe(this,"id");Qe(this,"meta");Qe(this,"_ended",!1);this.id=i,this.meta=n}_pushChunk(i){this._ended||this.emit("data",i)}_end(){this._ended||(this._ended=!0,this.emit("end"))}get ended(){return this._ended}}class qf extends Gh.EventEmitter{constructor(i){super();Qe(this,"adapter");Qe(this,"encryptionKey");Qe(this,"role");Qe(this,"streams",new Map);Qe(this,"_ready",!1);Qe(this,"msgCounter",0);this.adapter=i.adapter,this.encryptionKey=i.encryptionKey??null,this.role=i.role,this.setupHandlers()}setupHandlers(){this.adapter.onMessage(i=>{this.handlePayload(i)}),this.adapter.onPeerJoined(()=>{this.encryptionKey&&(this._ready=!0,this.emit("ready"))}),this.adapter.onPeerLeft(()=>{this._ready=!1,this.emit("peer_left")}),this.adapter.onError(i=>this.emit("error",i)),this.adapter.onDisconnect(()=>this.emit("disconnect"))}handlePayload(i){try{if(!this.encryptionKey){this.emit("error",new Error("Received data but no encryption key"));return}const n=uf(i),a=Cf(n,this.encryptionKey),h=ff(a);this.handleMessage(h)}catch(n){this.emit("error",n)}}handleMessage(i){switch(i.type){case"message":this.emit("message",i.data);break;case"stream_start":{const n=new zf(i.id,i.meta);this.streams.set(i.id,n),this.emit("stream",n);break}case"stream_chunk":{const n=this.streams.get(i.id);n&&n._pushChunk(i.data);break}case"stream_end":{const n=this.streams.get(i.id);n&&(n._end(),this.streams.delete(i.id));break}}}sendRaw(i){if(!this.encryptionKey)throw new Error("No encryption key established");const n=df(i),a=wf(n,this.encryptionKey);this.adapter.send(cf(a))}send(i){const n=`msg-${++this.msgCounter}`;this.sendRaw({type:"message",id:n,data:i})}createStream(i){const n=`stream-${++this.msgCounter}`;return this.sendRaw({type:"stream_start",id:n,meta:i}),new Ff(n,a=>this.sendRaw(a),i)}async connect(i){await this.adapter.connect(i,this.role)}get ready(){return this._ready}waitForReady(i=3e4){return this._ready?Promise.resolve():new Promise((n,a)=>{const h=()=>{clearTimeout(m),this.removeListener("ready",d),this.removeListener("error",g),this.removeListener("disconnect",v)},d=()=>{h(),n()},g=R=>{h(),a(R)},v=()=>{h(),a(new Error("Disconnected before ready"))},m=setTimeout(()=>{h(),a(new Error("Timed out waiting for peer"))},i);this.once("ready",d),this.once("error",g),this.once("disconnect",v)})}close(){for(const i of this.streams.values())i._end();this.streams.clear(),this.adapter.close(),this.removeAllListeners()}}class Gf{constructor(t){Qe(this,"ws",null);Qe(this,"url");Qe(this,"_connected",!1);Qe(this,"messageHandlers",[]);Qe(this,"peerJoinedHandlers",[]);Qe(this,"peerLeftHandlers",[]);Qe(this,"errorHandlers",[]);Qe(this,"disconnectHandlers",[]);Qe(this,"reconnectAttempts",0);Qe(this,"maxReconnectAttempts",5);Qe(this,"reconnectTimer",null);Qe(this,"shouldReconnect",!1);Qe(this,"sessionToken",null);Qe(this,"role",null);this.url=t}get connected(){return this._connected}async connect(t,i){return this.sessionToken=t,this.role=i,this.doConnect()}async doConnect(){const t=await this.createWebSocket(this.url);return new Promise((i,n)=>{t.onopen=()=>{this._connected=!0,this.shouldReconnect=!0,this.reconnectAttempts=0;const a=this.role==="host"?{type:"create",sessionToken:this.sessionToken}:{type:"join",sessionToken:this.sessionToken};t.send(JSON.stringify(a)),i()},t.onmessage=a=>{const h=a.data,d=typeof h=="string"?h:typeof Buffer<"u"&&Buffer.isBuffer(h)?h.toString("utf-8"):new TextDecoder().decode(h);try{const g=JSON.parse(d);switch(g.type){case"created":case"joined":break;case"peer_joined":this.peerJoinedHandlers.forEach(v=>v());break;case"peer_left":this.peerLeftHandlers.forEach(v=>v());break;case"forward":this.messageHandlers.forEach(v=>v(g.payload));break;case"error":this.errorHandlers.forEach(v=>v(new Error(g.message)));break}}catch(g){this.errorHandlers.forEach(v=>v(g instanceof Error?g:new Error(String(g))))}},t.onclose=()=>{const a=this._connected;this._connected=!1,a&&this.disconnectHandlers.forEach(h=>h()),this.shouldReconnect&&!this.reconnectTimer&&this.attemptReconnect()},t.onerror=a=>{const h=a instanceof Error?a:new Error("WebSocket error");this.errorHandlers.forEach(d=>d(h)),this._connected||(this.shouldReconnect=!1,n(h))},this.ws=t})}async createWebSocket(t){if(typeof globalThis.WebSocket<"u")return new globalThis.WebSocket(t);try{const{default:i}=await qh(async()=>{const{default:n}=await import("./browser-CyAZgeub.js").then(a=>a.b);return{default:n}},[],import.meta.url);return new i(t)}catch{throw new Error('No WebSocket implementation available. Install the "ws" package for Node.js.')}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts||!this.sessionToken||!this.role)return;this.reconnectAttempts++;const t=Math.min(1e3*Math.pow(2,this.reconnectAttempts-1),3e4);this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.doConnect().catch(()=>{})},t)}send(t){!this.ws||!this._connected||this.ws.send(JSON.stringify({type:"forward",payload:t}))}onMessage(t){this.messageHandlers.push(t)}onPeerJoined(t){this.peerJoinedHandlers.push(t)}onPeerLeft(t){this.peerLeftHandlers.push(t)}onError(t){this.errorHandlers.push(t)}onDisconnect(t){this.disconnectHandlers.push(t)}close(){var t;this.shouldReconnect=!1,this.maxReconnectAttempts=0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.ws)==null||t.close(),this.ws=null,this._connected=!1}}var en={exports:{}};/*@license Copyright 2015-2022 Ably Real-time Ltd (ably.com)
|
|
1
|
+
var sf=Object.defineProperty;var rf=(e,t,i)=>t in e?sf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Qe=(e,t,i)=>rf(e,typeof t!="symbol"?t+"":t,i);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const h of a)if(h.type==="childList")for(const d of h.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&n(d)}).observe(document,{childList:!0,subtree:!0});function i(a){const h={};return a.integrity&&(h.integrity=a.integrity),a.referrerPolicy&&(h.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?h.credentials="include":a.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function n(a){if(a.ep)return;a.ep=!0;const h=i(a);fetch(a.href,h)}})();const nf="modulepreload",of=function(e,t){return new URL(e,t).href},Dl={},qh=function(t,i,n){let a=Promise.resolve();if(i&&i.length>0){let d=function(R){return Promise.all(R.map(k=>Promise.resolve(k).then(B=>({status:"fulfilled",value:B}),B=>({status:"rejected",reason:B}))))};const g=document.getElementsByTagName("link"),v=document.querySelector("meta[property=csp-nonce]"),m=(v==null?void 0:v.nonce)||(v==null?void 0:v.getAttribute("nonce"));a=d(i.map(R=>{if(R=of(R,n),R in Dl)return;Dl[R]=!0;const k=R.endsWith(".css"),B=k?'[rel="stylesheet"]':"";if(!!n)for(let U=g.length-1;U>=0;U--){const Z=g[U];if(Z.href===R&&(!k||Z.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${R}"]${B}`))return;const P=document.createElement("link");if(P.rel=k?"stylesheet":nf,k||(P.as="script"),P.crossOrigin="",P.href=R,m&&P.setAttribute("nonce",m),document.head.appendChild(P),k)return new Promise((U,Z)=>{P.addEventListener("load",U),P.addEventListener("error",()=>Z(new Error(`Unable to preload CSS for ${R}`)))})}))}function h(d){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=d,window.dispatchEvent(g),!g.defaultPrevented)throw d}return a.then(d=>{for(const g of d||[])g.status==="rejected"&&h(g.reason);return t().catch(h)})};var Ki=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function af(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lf(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var i=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),i}var Vr={exports:{}},Nl;function hf(){if(Nl)return Vr.exports;Nl=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(W,E,ae){return Function.prototype.apply.call(W,E,ae)},i;e&&typeof e.ownKeys=="function"?i=e.ownKeys:Object.getOwnPropertySymbols?i=function(W){return Object.getOwnPropertyNames(W).concat(Object.getOwnPropertySymbols(W))}:i=function(W){return Object.getOwnPropertyNames(W)};function n(H){console&&console.warn&&console.warn(H)}var a=Number.isNaN||function(W){return W!==W};function h(){h.init.call(this)}Vr.exports=h,Vr.exports.once=_e,h.EventEmitter=h,h.prototype._events=void 0,h.prototype._eventsCount=0,h.prototype._maxListeners=void 0;var d=10;function g(H){if(typeof H!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof H)}Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(H){if(typeof H!="number"||H<0||a(H))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+H+".");d=H}}),h.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},h.prototype.setMaxListeners=function(W){if(typeof W!="number"||W<0||a(W))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+W+".");return this._maxListeners=W,this};function v(H){return H._maxListeners===void 0?h.defaultMaxListeners:H._maxListeners}h.prototype.getMaxListeners=function(){return v(this)},h.prototype.emit=function(W){for(var E=[],ae=1;ae<arguments.length;ae++)E.push(arguments[ae]);var be=W==="error",ze=this._events;if(ze!==void 0)be=be&&ze.error===void 0;else if(!be)return!1;if(be){var Be;if(E.length>0&&(Be=E[0]),Be instanceof Error)throw Be;var xe=new Error("Unhandled error."+(Be?" ("+Be.message+")":""));throw xe.context=Be,xe}var ce=ze[W];if(ce===void 0)return!1;if(typeof ce=="function")t(ce,this,E);else for(var f=ce.length,re=P(ce,f),ae=0;ae<f;++ae)t(re[ae],this,E);return!0};function m(H,W,E,ae){var be,ze,Be;if(g(E),ze=H._events,ze===void 0?(ze=H._events=Object.create(null),H._eventsCount=0):(ze.newListener!==void 0&&(H.emit("newListener",W,E.listener?E.listener:E),ze=H._events),Be=ze[W]),Be===void 0)Be=ze[W]=E,++H._eventsCount;else if(typeof Be=="function"?Be=ze[W]=ae?[E,Be]:[Be,E]:ae?Be.unshift(E):Be.push(E),be=v(H),be>0&&Be.length>be&&!Be.warned){Be.warned=!0;var xe=new Error("Possible EventEmitter memory leak detected. "+Be.length+" "+String(W)+" listeners added. Use emitter.setMaxListeners() to increase limit");xe.name="MaxListenersExceededWarning",xe.emitter=H,xe.type=W,xe.count=Be.length,n(xe)}return H}h.prototype.addListener=function(W,E){return m(this,W,E,!1)},h.prototype.on=h.prototype.addListener,h.prototype.prependListener=function(W,E){return m(this,W,E,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function k(H,W,E){var ae={fired:!1,wrapFn:void 0,target:H,type:W,listener:E},be=R.bind(ae);return be.listener=E,ae.wrapFn=be,be}h.prototype.once=function(W,E){return g(E),this.on(W,k(this,W,E)),this},h.prototype.prependOnceListener=function(W,E){return g(E),this.prependListener(W,k(this,W,E)),this},h.prototype.removeListener=function(W,E){var ae,be,ze,Be,xe;if(g(E),be=this._events,be===void 0)return this;if(ae=be[W],ae===void 0)return this;if(ae===E||ae.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete be[W],be.removeListener&&this.emit("removeListener",W,ae.listener||E));else if(typeof ae!="function"){for(ze=-1,Be=ae.length-1;Be>=0;Be--)if(ae[Be]===E||ae[Be].listener===E){xe=ae[Be].listener,ze=Be;break}if(ze<0)return this;ze===0?ae.shift():U(ae,ze),ae.length===1&&(be[W]=ae[0]),be.removeListener!==void 0&&this.emit("removeListener",W,xe||E)}return this},h.prototype.off=h.prototype.removeListener,h.prototype.removeAllListeners=function(W){var E,ae,be;if(ae=this._events,ae===void 0)return this;if(ae.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ae[W]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ae[W]),this;if(arguments.length===0){var ze=Object.keys(ae),Be;for(be=0;be<ze.length;++be)Be=ze[be],Be!=="removeListener"&&this.removeAllListeners(Be);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(E=ae[W],typeof E=="function")this.removeListener(W,E);else if(E!==void 0)for(be=E.length-1;be>=0;be--)this.removeListener(W,E[be]);return this};function B(H,W,E){var ae=H._events;if(ae===void 0)return[];var be=ae[W];return be===void 0?[]:typeof be=="function"?E?[be.listener||be]:[be]:E?Z(be):P(be,be.length)}h.prototype.listeners=function(W){return B(this,W,!0)},h.prototype.rawListeners=function(W){return B(this,W,!1)},h.listenerCount=function(H,W){return typeof H.listenerCount=="function"?H.listenerCount(W):L.call(H,W)},h.prototype.listenerCount=L;function L(H){var W=this._events;if(W!==void 0){var E=W[H];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}h.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function P(H,W){for(var E=new Array(W),ae=0;ae<W;++ae)E[ae]=H[ae];return E}function U(H,W){for(;W+1<H.length;W++)H[W]=H[W+1];H.pop()}function Z(H){for(var W=new Array(H.length),E=0;E<W.length;++E)W[E]=H[E].listener||H[E];return W}function _e(H,W){return new Promise(function(E,ae){function be(Be){H.removeListener(W,ze),ae(Be)}function ze(){typeof H.removeListener=="function"&&H.removeListener("error",be),E([].slice.call(arguments))}Ne(H,W,ze,{once:!0}),W!=="error"&&st(H,be,{once:!0})})}function st(H,W,E){typeof H.on=="function"&&Ne(H,"error",W,E)}function Ne(H,W,E,ae){if(typeof H.on=="function")ae.once?H.once(W,E):H.on(W,E);else if(typeof H.addEventListener=="function")H.addEventListener(W,function be(ze){ae.once&&H.removeEventListener(W,be),E(ze)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof H)}return Vr.exports}var Gh=hf();function cf(e){if(typeof Buffer<"u")return Buffer.from(e).toString("base64");let t="";for(const i of e)t+=String.fromCharCode(i);return btoa(t)}function uf(e){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));const t=atob(e),i=new Uint8Array(t.length);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}function df(e){return new TextEncoder().encode(JSON.stringify(e))}function ff(e){const t=JSON.parse(new TextDecoder().decode(e));if(!t||typeof t!="object"||typeof t.type!="string"||typeof t.id!="string")throw new Error("Invalid channel message: missing type or id field");return t}function _f(e){const t=JSON.parse(e);if(!t||typeof t!="object"||typeof t.relay!="string"||typeof t.session!="string"||typeof t.v!="number")throw new Error("Invalid pairing data: missing required fields");if(t.transport!==void 0&&t.transport!=="ws"&&t.transport!=="ably")throw new Error('Invalid pairing data: transport must be "ws" or "ably"');if(t.token!==void 0&&typeof t.token!="string")throw new Error("Invalid pairing data: token must be a string");if(t.transport==="ably"&&!t.token)throw new Error("Invalid pairing data: Ably transport requires a token");return t}function gf(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Kn={exports:{}};const pf={},mf=Object.freeze(Object.defineProperty({__proto__:null,default:pf},Symbol.toStringTag,{value:"Module"})),vf=lf(mf);var Hl;function yf(){return Hl||(Hl=1,(function(e){(function(t){var i=function(p){var S,y=new Float64Array(16);if(p)for(S=0;S<p.length;S++)y[S]=p[S];return y},n=function(){throw new Error("no PRNG")},a=new Uint8Array(16),h=new Uint8Array(32);h[0]=9;var d=i(),g=i([1]),v=i([56129,1]),m=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),R=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),k=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),B=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),L=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function P(p,S,y,u){p[S]=y>>24&255,p[S+1]=y>>16&255,p[S+2]=y>>8&255,p[S+3]=y&255,p[S+4]=u>>24&255,p[S+5]=u>>16&255,p[S+6]=u>>8&255,p[S+7]=u&255}function U(p,S,y,u,w){var T,I=0;for(T=0;T<w;T++)I|=p[S+T]^y[u+T];return(1&I-1>>>8)-1}function Z(p,S,y,u){return U(p,S,y,u,16)}function _e(p,S,y,u){return U(p,S,y,u,32)}function st(p,S,y,u){for(var w=u[0]&255|(u[1]&255)<<8|(u[2]&255)<<16|(u[3]&255)<<24,T=y[0]&255|(y[1]&255)<<8|(y[2]&255)<<16|(y[3]&255)<<24,I=y[4]&255|(y[5]&255)<<8|(y[6]&255)<<16|(y[7]&255)<<24,G=y[8]&255|(y[9]&255)<<8|(y[10]&255)<<16|(y[11]&255)<<24,X=y[12]&255|(y[13]&255)<<8|(y[14]&255)<<16|(y[15]&255)<<24,we=u[4]&255|(u[5]&255)<<8|(u[6]&255)<<16|(u[7]&255)<<24,le=S[0]&255|(S[1]&255)<<8|(S[2]&255)<<16|(S[3]&255)<<24,Ke=S[4]&255|(S[5]&255)<<8|(S[6]&255)<<16|(S[7]&255)<<24,fe=S[8]&255|(S[9]&255)<<8|(S[10]&255)<<16|(S[11]&255)<<24,ke=S[12]&255|(S[13]&255)<<8|(S[14]&255)<<16|(S[15]&255)<<24,Me=u[8]&255|(u[9]&255)<<8|(u[10]&255)<<16|(u[11]&255)<<24,He=y[16]&255|(y[17]&255)<<8|(y[18]&255)<<16|(y[19]&255)<<24,J=y[20]&255|(y[21]&255)<<8|(y[22]&255)<<16|(y[23]&255)<<24,Oe=y[24]&255|(y[25]&255)<<8|(y[26]&255)<<16|(y[27]&255)<<24,Te=y[28]&255|(y[29]&255)<<8|(y[30]&255)<<16|(y[31]&255)<<24,Ee=u[12]&255|(u[13]&255)<<8|(u[14]&255)<<16|(u[15]&255)<<24,ge=w,ie=T,he=I,ye=G,ve=X,ne=we,D=le,N=Ke,K=fe,j=ke,$=Me,Y=He,Ce=J,Ie=Oe,We=Te,Ue=Ee,x,Ge=0;Ge<20;Ge+=2)x=ge+Ce|0,ve^=x<<7|x>>>25,x=ve+ge|0,K^=x<<9|x>>>23,x=K+ve|0,Ce^=x<<13|x>>>19,x=Ce+K|0,ge^=x<<18|x>>>14,x=ne+ie|0,j^=x<<7|x>>>25,x=j+ne|0,Ie^=x<<9|x>>>23,x=Ie+j|0,ie^=x<<13|x>>>19,x=ie+Ie|0,ne^=x<<18|x>>>14,x=$+D|0,We^=x<<7|x>>>25,x=We+$|0,he^=x<<9|x>>>23,x=he+We|0,D^=x<<13|x>>>19,x=D+he|0,$^=x<<18|x>>>14,x=Ue+Y|0,ye^=x<<7|x>>>25,x=ye+Ue|0,N^=x<<9|x>>>23,x=N+ye|0,Y^=x<<13|x>>>19,x=Y+N|0,Ue^=x<<18|x>>>14,x=ge+ye|0,ie^=x<<7|x>>>25,x=ie+ge|0,he^=x<<9|x>>>23,x=he+ie|0,ye^=x<<13|x>>>19,x=ye+he|0,ge^=x<<18|x>>>14,x=ne+ve|0,D^=x<<7|x>>>25,x=D+ne|0,N^=x<<9|x>>>23,x=N+D|0,ve^=x<<13|x>>>19,x=ve+N|0,ne^=x<<18|x>>>14,x=$+j|0,Y^=x<<7|x>>>25,x=Y+$|0,K^=x<<9|x>>>23,x=K+Y|0,j^=x<<13|x>>>19,x=j+K|0,$^=x<<18|x>>>14,x=Ue+We|0,Ce^=x<<7|x>>>25,x=Ce+Ue|0,Ie^=x<<9|x>>>23,x=Ie+Ce|0,We^=x<<13|x>>>19,x=We+Ie|0,Ue^=x<<18|x>>>14;ge=ge+w|0,ie=ie+T|0,he=he+I|0,ye=ye+G|0,ve=ve+X|0,ne=ne+we|0,D=D+le|0,N=N+Ke|0,K=K+fe|0,j=j+ke|0,$=$+Me|0,Y=Y+He|0,Ce=Ce+J|0,Ie=Ie+Oe|0,We=We+Te|0,Ue=Ue+Ee|0,p[0]=ge>>>0&255,p[1]=ge>>>8&255,p[2]=ge>>>16&255,p[3]=ge>>>24&255,p[4]=ie>>>0&255,p[5]=ie>>>8&255,p[6]=ie>>>16&255,p[7]=ie>>>24&255,p[8]=he>>>0&255,p[9]=he>>>8&255,p[10]=he>>>16&255,p[11]=he>>>24&255,p[12]=ye>>>0&255,p[13]=ye>>>8&255,p[14]=ye>>>16&255,p[15]=ye>>>24&255,p[16]=ve>>>0&255,p[17]=ve>>>8&255,p[18]=ve>>>16&255,p[19]=ve>>>24&255,p[20]=ne>>>0&255,p[21]=ne>>>8&255,p[22]=ne>>>16&255,p[23]=ne>>>24&255,p[24]=D>>>0&255,p[25]=D>>>8&255,p[26]=D>>>16&255,p[27]=D>>>24&255,p[28]=N>>>0&255,p[29]=N>>>8&255,p[30]=N>>>16&255,p[31]=N>>>24&255,p[32]=K>>>0&255,p[33]=K>>>8&255,p[34]=K>>>16&255,p[35]=K>>>24&255,p[36]=j>>>0&255,p[37]=j>>>8&255,p[38]=j>>>16&255,p[39]=j>>>24&255,p[40]=$>>>0&255,p[41]=$>>>8&255,p[42]=$>>>16&255,p[43]=$>>>24&255,p[44]=Y>>>0&255,p[45]=Y>>>8&255,p[46]=Y>>>16&255,p[47]=Y>>>24&255,p[48]=Ce>>>0&255,p[49]=Ce>>>8&255,p[50]=Ce>>>16&255,p[51]=Ce>>>24&255,p[52]=Ie>>>0&255,p[53]=Ie>>>8&255,p[54]=Ie>>>16&255,p[55]=Ie>>>24&255,p[56]=We>>>0&255,p[57]=We>>>8&255,p[58]=We>>>16&255,p[59]=We>>>24&255,p[60]=Ue>>>0&255,p[61]=Ue>>>8&255,p[62]=Ue>>>16&255,p[63]=Ue>>>24&255}function Ne(p,S,y,u){for(var w=u[0]&255|(u[1]&255)<<8|(u[2]&255)<<16|(u[3]&255)<<24,T=y[0]&255|(y[1]&255)<<8|(y[2]&255)<<16|(y[3]&255)<<24,I=y[4]&255|(y[5]&255)<<8|(y[6]&255)<<16|(y[7]&255)<<24,G=y[8]&255|(y[9]&255)<<8|(y[10]&255)<<16|(y[11]&255)<<24,X=y[12]&255|(y[13]&255)<<8|(y[14]&255)<<16|(y[15]&255)<<24,we=u[4]&255|(u[5]&255)<<8|(u[6]&255)<<16|(u[7]&255)<<24,le=S[0]&255|(S[1]&255)<<8|(S[2]&255)<<16|(S[3]&255)<<24,Ke=S[4]&255|(S[5]&255)<<8|(S[6]&255)<<16|(S[7]&255)<<24,fe=S[8]&255|(S[9]&255)<<8|(S[10]&255)<<16|(S[11]&255)<<24,ke=S[12]&255|(S[13]&255)<<8|(S[14]&255)<<16|(S[15]&255)<<24,Me=u[8]&255|(u[9]&255)<<8|(u[10]&255)<<16|(u[11]&255)<<24,He=y[16]&255|(y[17]&255)<<8|(y[18]&255)<<16|(y[19]&255)<<24,J=y[20]&255|(y[21]&255)<<8|(y[22]&255)<<16|(y[23]&255)<<24,Oe=y[24]&255|(y[25]&255)<<8|(y[26]&255)<<16|(y[27]&255)<<24,Te=y[28]&255|(y[29]&255)<<8|(y[30]&255)<<16|(y[31]&255)<<24,Ee=u[12]&255|(u[13]&255)<<8|(u[14]&255)<<16|(u[15]&255)<<24,ge=w,ie=T,he=I,ye=G,ve=X,ne=we,D=le,N=Ke,K=fe,j=ke,$=Me,Y=He,Ce=J,Ie=Oe,We=Te,Ue=Ee,x,Ge=0;Ge<20;Ge+=2)x=ge+Ce|0,ve^=x<<7|x>>>25,x=ve+ge|0,K^=x<<9|x>>>23,x=K+ve|0,Ce^=x<<13|x>>>19,x=Ce+K|0,ge^=x<<18|x>>>14,x=ne+ie|0,j^=x<<7|x>>>25,x=j+ne|0,Ie^=x<<9|x>>>23,x=Ie+j|0,ie^=x<<13|x>>>19,x=ie+Ie|0,ne^=x<<18|x>>>14,x=$+D|0,We^=x<<7|x>>>25,x=We+$|0,he^=x<<9|x>>>23,x=he+We|0,D^=x<<13|x>>>19,x=D+he|0,$^=x<<18|x>>>14,x=Ue+Y|0,ye^=x<<7|x>>>25,x=ye+Ue|0,N^=x<<9|x>>>23,x=N+ye|0,Y^=x<<13|x>>>19,x=Y+N|0,Ue^=x<<18|x>>>14,x=ge+ye|0,ie^=x<<7|x>>>25,x=ie+ge|0,he^=x<<9|x>>>23,x=he+ie|0,ye^=x<<13|x>>>19,x=ye+he|0,ge^=x<<18|x>>>14,x=ne+ve|0,D^=x<<7|x>>>25,x=D+ne|0,N^=x<<9|x>>>23,x=N+D|0,ve^=x<<13|x>>>19,x=ve+N|0,ne^=x<<18|x>>>14,x=$+j|0,Y^=x<<7|x>>>25,x=Y+$|0,K^=x<<9|x>>>23,x=K+Y|0,j^=x<<13|x>>>19,x=j+K|0,$^=x<<18|x>>>14,x=Ue+We|0,Ce^=x<<7|x>>>25,x=Ce+Ue|0,Ie^=x<<9|x>>>23,x=Ie+Ce|0,We^=x<<13|x>>>19,x=We+Ie|0,Ue^=x<<18|x>>>14;p[0]=ge>>>0&255,p[1]=ge>>>8&255,p[2]=ge>>>16&255,p[3]=ge>>>24&255,p[4]=ne>>>0&255,p[5]=ne>>>8&255,p[6]=ne>>>16&255,p[7]=ne>>>24&255,p[8]=$>>>0&255,p[9]=$>>>8&255,p[10]=$>>>16&255,p[11]=$>>>24&255,p[12]=Ue>>>0&255,p[13]=Ue>>>8&255,p[14]=Ue>>>16&255,p[15]=Ue>>>24&255,p[16]=D>>>0&255,p[17]=D>>>8&255,p[18]=D>>>16&255,p[19]=D>>>24&255,p[20]=N>>>0&255,p[21]=N>>>8&255,p[22]=N>>>16&255,p[23]=N>>>24&255,p[24]=K>>>0&255,p[25]=K>>>8&255,p[26]=K>>>16&255,p[27]=K>>>24&255,p[28]=j>>>0&255,p[29]=j>>>8&255,p[30]=j>>>16&255,p[31]=j>>>24&255}function H(p,S,y,u){st(p,S,y,u)}function W(p,S,y,u){Ne(p,S,y,u)}var E=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function ae(p,S,y,u,w,T,I){var G=new Uint8Array(16),X=new Uint8Array(64),we,le;for(le=0;le<16;le++)G[le]=0;for(le=0;le<8;le++)G[le]=T[le];for(;w>=64;){for(H(X,G,I,E),le=0;le<64;le++)p[S+le]=y[u+le]^X[le];for(we=1,le=8;le<16;le++)we=we+(G[le]&255)|0,G[le]=we&255,we>>>=8;w-=64,S+=64,u+=64}if(w>0)for(H(X,G,I,E),le=0;le<w;le++)p[S+le]=y[u+le]^X[le];return 0}function be(p,S,y,u,w){var T=new Uint8Array(16),I=new Uint8Array(64),G,X;for(X=0;X<16;X++)T[X]=0;for(X=0;X<8;X++)T[X]=u[X];for(;y>=64;){for(H(I,T,w,E),X=0;X<64;X++)p[S+X]=I[X];for(G=1,X=8;X<16;X++)G=G+(T[X]&255)|0,T[X]=G&255,G>>>=8;y-=64,S+=64}if(y>0)for(H(I,T,w,E),X=0;X<y;X++)p[S+X]=I[X];return 0}function ze(p,S,y,u,w){var T=new Uint8Array(32);W(T,u,w,E);for(var I=new Uint8Array(8),G=0;G<8;G++)I[G]=u[G+16];return be(p,S,y,I,T)}function Be(p,S,y,u,w,T,I){var G=new Uint8Array(32);W(G,T,I,E);for(var X=new Uint8Array(8),we=0;we<8;we++)X[we]=T[we+16];return ae(p,S,y,u,w,X,G)}var xe=function(p){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var S,y,u,w,T,I,G,X;S=p[0]&255|(p[1]&255)<<8,this.r[0]=S&8191,y=p[2]&255|(p[3]&255)<<8,this.r[1]=(S>>>13|y<<3)&8191,u=p[4]&255|(p[5]&255)<<8,this.r[2]=(y>>>10|u<<6)&7939,w=p[6]&255|(p[7]&255)<<8,this.r[3]=(u>>>7|w<<9)&8191,T=p[8]&255|(p[9]&255)<<8,this.r[4]=(w>>>4|T<<12)&255,this.r[5]=T>>>1&8190,I=p[10]&255|(p[11]&255)<<8,this.r[6]=(T>>>14|I<<2)&8191,G=p[12]&255|(p[13]&255)<<8,this.r[7]=(I>>>11|G<<5)&8065,X=p[14]&255|(p[15]&255)<<8,this.r[8]=(G>>>8|X<<8)&8191,this.r[9]=X>>>5&127,this.pad[0]=p[16]&255|(p[17]&255)<<8,this.pad[1]=p[18]&255|(p[19]&255)<<8,this.pad[2]=p[20]&255|(p[21]&255)<<8,this.pad[3]=p[22]&255|(p[23]&255)<<8,this.pad[4]=p[24]&255|(p[25]&255)<<8,this.pad[5]=p[26]&255|(p[27]&255)<<8,this.pad[6]=p[28]&255|(p[29]&255)<<8,this.pad[7]=p[30]&255|(p[31]&255)<<8};xe.prototype.blocks=function(p,S,y){for(var u=this.fin?0:2048,w,T,I,G,X,we,le,Ke,fe,ke,Me,He,J,Oe,Te,Ee,ge,ie,he,ye=this.h[0],ve=this.h[1],ne=this.h[2],D=this.h[3],N=this.h[4],K=this.h[5],j=this.h[6],$=this.h[7],Y=this.h[8],Ce=this.h[9],Ie=this.r[0],We=this.r[1],Ue=this.r[2],x=this.r[3],Ge=this.r[4],Fe=this.r[5],Je=this.r[6],Pe=this.r[7],Xe=this.r[8],Ze=this.r[9];y>=16;)w=p[S+0]&255|(p[S+1]&255)<<8,ye+=w&8191,T=p[S+2]&255|(p[S+3]&255)<<8,ve+=(w>>>13|T<<3)&8191,I=p[S+4]&255|(p[S+5]&255)<<8,ne+=(T>>>10|I<<6)&8191,G=p[S+6]&255|(p[S+7]&255)<<8,D+=(I>>>7|G<<9)&8191,X=p[S+8]&255|(p[S+9]&255)<<8,N+=(G>>>4|X<<12)&8191,K+=X>>>1&8191,we=p[S+10]&255|(p[S+11]&255)<<8,j+=(X>>>14|we<<2)&8191,le=p[S+12]&255|(p[S+13]&255)<<8,$+=(we>>>11|le<<5)&8191,Ke=p[S+14]&255|(p[S+15]&255)<<8,Y+=(le>>>8|Ke<<8)&8191,Ce+=Ke>>>5|u,fe=0,ke=fe,ke+=ye*Ie,ke+=ve*(5*Ze),ke+=ne*(5*Xe),ke+=D*(5*Pe),ke+=N*(5*Je),fe=ke>>>13,ke&=8191,ke+=K*(5*Fe),ke+=j*(5*Ge),ke+=$*(5*x),ke+=Y*(5*Ue),ke+=Ce*(5*We),fe+=ke>>>13,ke&=8191,Me=fe,Me+=ye*We,Me+=ve*Ie,Me+=ne*(5*Ze),Me+=D*(5*Xe),Me+=N*(5*Pe),fe=Me>>>13,Me&=8191,Me+=K*(5*Je),Me+=j*(5*Fe),Me+=$*(5*Ge),Me+=Y*(5*x),Me+=Ce*(5*Ue),fe+=Me>>>13,Me&=8191,He=fe,He+=ye*Ue,He+=ve*We,He+=ne*Ie,He+=D*(5*Ze),He+=N*(5*Xe),fe=He>>>13,He&=8191,He+=K*(5*Pe),He+=j*(5*Je),He+=$*(5*Fe),He+=Y*(5*Ge),He+=Ce*(5*x),fe+=He>>>13,He&=8191,J=fe,J+=ye*x,J+=ve*Ue,J+=ne*We,J+=D*Ie,J+=N*(5*Ze),fe=J>>>13,J&=8191,J+=K*(5*Xe),J+=j*(5*Pe),J+=$*(5*Je),J+=Y*(5*Fe),J+=Ce*(5*Ge),fe+=J>>>13,J&=8191,Oe=fe,Oe+=ye*Ge,Oe+=ve*x,Oe+=ne*Ue,Oe+=D*We,Oe+=N*Ie,fe=Oe>>>13,Oe&=8191,Oe+=K*(5*Ze),Oe+=j*(5*Xe),Oe+=$*(5*Pe),Oe+=Y*(5*Je),Oe+=Ce*(5*Fe),fe+=Oe>>>13,Oe&=8191,Te=fe,Te+=ye*Fe,Te+=ve*Ge,Te+=ne*x,Te+=D*Ue,Te+=N*We,fe=Te>>>13,Te&=8191,Te+=K*Ie,Te+=j*(5*Ze),Te+=$*(5*Xe),Te+=Y*(5*Pe),Te+=Ce*(5*Je),fe+=Te>>>13,Te&=8191,Ee=fe,Ee+=ye*Je,Ee+=ve*Fe,Ee+=ne*Ge,Ee+=D*x,Ee+=N*Ue,fe=Ee>>>13,Ee&=8191,Ee+=K*We,Ee+=j*Ie,Ee+=$*(5*Ze),Ee+=Y*(5*Xe),Ee+=Ce*(5*Pe),fe+=Ee>>>13,Ee&=8191,ge=fe,ge+=ye*Pe,ge+=ve*Je,ge+=ne*Fe,ge+=D*Ge,ge+=N*x,fe=ge>>>13,ge&=8191,ge+=K*Ue,ge+=j*We,ge+=$*Ie,ge+=Y*(5*Ze),ge+=Ce*(5*Xe),fe+=ge>>>13,ge&=8191,ie=fe,ie+=ye*Xe,ie+=ve*Pe,ie+=ne*Je,ie+=D*Fe,ie+=N*Ge,fe=ie>>>13,ie&=8191,ie+=K*x,ie+=j*Ue,ie+=$*We,ie+=Y*Ie,ie+=Ce*(5*Ze),fe+=ie>>>13,ie&=8191,he=fe,he+=ye*Ze,he+=ve*Xe,he+=ne*Pe,he+=D*Je,he+=N*Fe,fe=he>>>13,he&=8191,he+=K*Ge,he+=j*x,he+=$*Ue,he+=Y*We,he+=Ce*Ie,fe+=he>>>13,he&=8191,fe=(fe<<2)+fe|0,fe=fe+ke|0,ke=fe&8191,fe=fe>>>13,Me+=fe,ye=ke,ve=Me,ne=He,D=J,N=Oe,K=Te,j=Ee,$=ge,Y=ie,Ce=he,S+=16,y-=16;this.h[0]=ye,this.h[1]=ve,this.h[2]=ne,this.h[3]=D,this.h[4]=N,this.h[5]=K,this.h[6]=j,this.h[7]=$,this.h[8]=Y,this.h[9]=Ce},xe.prototype.finish=function(p,S){var y=new Uint16Array(10),u,w,T,I;if(this.leftover){for(I=this.leftover,this.buffer[I++]=1;I<16;I++)this.buffer[I]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(u=this.h[1]>>>13,this.h[1]&=8191,I=2;I<10;I++)this.h[I]+=u,u=this.h[I]>>>13,this.h[I]&=8191;for(this.h[0]+=u*5,u=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=u,u=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=u,y[0]=this.h[0]+5,u=y[0]>>>13,y[0]&=8191,I=1;I<10;I++)y[I]=this.h[I]+u,u=y[I]>>>13,y[I]&=8191;for(y[9]-=8192,w=(u^1)-1,I=0;I<10;I++)y[I]&=w;for(w=~w,I=0;I<10;I++)this.h[I]=this.h[I]&w|y[I];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,T=this.h[0]+this.pad[0],this.h[0]=T&65535,I=1;I<8;I++)T=(this.h[I]+this.pad[I]|0)+(T>>>16)|0,this.h[I]=T&65535;p[S+0]=this.h[0]>>>0&255,p[S+1]=this.h[0]>>>8&255,p[S+2]=this.h[1]>>>0&255,p[S+3]=this.h[1]>>>8&255,p[S+4]=this.h[2]>>>0&255,p[S+5]=this.h[2]>>>8&255,p[S+6]=this.h[3]>>>0&255,p[S+7]=this.h[3]>>>8&255,p[S+8]=this.h[4]>>>0&255,p[S+9]=this.h[4]>>>8&255,p[S+10]=this.h[5]>>>0&255,p[S+11]=this.h[5]>>>8&255,p[S+12]=this.h[6]>>>0&255,p[S+13]=this.h[6]>>>8&255,p[S+14]=this.h[7]>>>0&255,p[S+15]=this.h[7]>>>8&255},xe.prototype.update=function(p,S,y){var u,w;if(this.leftover){for(w=16-this.leftover,w>y&&(w=y),u=0;u<w;u++)this.buffer[this.leftover+u]=p[S+u];if(y-=w,S+=w,this.leftover+=w,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(y>=16&&(w=y-y%16,this.blocks(p,S,w),S+=w,y-=w),y){for(u=0;u<y;u++)this.buffer[this.leftover+u]=p[S+u];this.leftover+=y}};function ce(p,S,y,u,w,T){var I=new xe(T);return I.update(y,u,w),I.finish(p,S),0}function f(p,S,y,u,w,T){var I=new Uint8Array(16);return ce(I,0,y,u,w,T),Z(p,S,I,0)}function re(p,S,y,u,w){var T;if(y<32)return-1;for(Be(p,0,S,0,y,u,w),ce(p,16,p,32,y-32,p),T=0;T<16;T++)p[T]=0;return 0}function oe(p,S,y,u,w){var T,I=new Uint8Array(32);if(y<32||(ze(I,0,32,u,w),f(S,16,S,32,y-32,I)!==0))return-1;for(Be(p,0,S,0,y,u,w),T=0;T<32;T++)p[T]=0;return 0}function A(p,S){var y;for(y=0;y<16;y++)p[y]=S[y]|0}function Se(p){var S,y,u=1;for(S=0;S<16;S++)y=p[S]+u+65535,u=Math.floor(y/65536),p[S]=y-u*65536;p[0]+=u-1+37*(u-1)}function te(p,S,y){for(var u,w=~(y-1),T=0;T<16;T++)u=w&(p[T]^S[T]),p[T]^=u,S[T]^=u}function se(p,S){var y,u,w,T=i(),I=i();for(y=0;y<16;y++)I[y]=S[y];for(Se(I),Se(I),Se(I),u=0;u<2;u++){for(T[0]=I[0]-65517,y=1;y<15;y++)T[y]=I[y]-65535-(T[y-1]>>16&1),T[y-1]&=65535;T[15]=I[15]-32767-(T[14]>>16&1),w=T[15]>>16&1,T[14]&=65535,te(I,T,1-w)}for(y=0;y<16;y++)p[2*y]=I[y]&255,p[2*y+1]=I[y]>>8}function ct(p,S){var y=new Uint8Array(32),u=new Uint8Array(32);return se(y,p),se(u,S),_e(y,0,u,0)}function zt(p){var S=new Uint8Array(32);return se(S,p),S[0]&1}function Mt(p,S){var y;for(y=0;y<16;y++)p[y]=S[2*y]+(S[2*y+1]<<8);p[15]&=32767}function ut(p,S,y){for(var u=0;u<16;u++)p[u]=S[u]+y[u]}function je(p,S,y){for(var u=0;u<16;u++)p[u]=S[u]-y[u]}function Ae(p,S,y){var u,w,T=0,I=0,G=0,X=0,we=0,le=0,Ke=0,fe=0,ke=0,Me=0,He=0,J=0,Oe=0,Te=0,Ee=0,ge=0,ie=0,he=0,ye=0,ve=0,ne=0,D=0,N=0,K=0,j=0,$=0,Y=0,Ce=0,Ie=0,We=0,Ue=0,x=y[0],Ge=y[1],Fe=y[2],Je=y[3],Pe=y[4],Xe=y[5],Ze=y[6],gt=y[7],rt=y[8],ft=y[9],mt=y[10],qe=y[11],ue=y[12],Ot=y[13],nt=y[14],Bt=y[15];u=S[0],T+=u*x,I+=u*Ge,G+=u*Fe,X+=u*Je,we+=u*Pe,le+=u*Xe,Ke+=u*Ze,fe+=u*gt,ke+=u*rt,Me+=u*ft,He+=u*mt,J+=u*qe,Oe+=u*ue,Te+=u*Ot,Ee+=u*nt,ge+=u*Bt,u=S[1],I+=u*x,G+=u*Ge,X+=u*Fe,we+=u*Je,le+=u*Pe,Ke+=u*Xe,fe+=u*Ze,ke+=u*gt,Me+=u*rt,He+=u*ft,J+=u*mt,Oe+=u*qe,Te+=u*ue,Ee+=u*Ot,ge+=u*nt,ie+=u*Bt,u=S[2],G+=u*x,X+=u*Ge,we+=u*Fe,le+=u*Je,Ke+=u*Pe,fe+=u*Xe,ke+=u*Ze,Me+=u*gt,He+=u*rt,J+=u*ft,Oe+=u*mt,Te+=u*qe,Ee+=u*ue,ge+=u*Ot,ie+=u*nt,he+=u*Bt,u=S[3],X+=u*x,we+=u*Ge,le+=u*Fe,Ke+=u*Je,fe+=u*Pe,ke+=u*Xe,Me+=u*Ze,He+=u*gt,J+=u*rt,Oe+=u*ft,Te+=u*mt,Ee+=u*qe,ge+=u*ue,ie+=u*Ot,he+=u*nt,ye+=u*Bt,u=S[4],we+=u*x,le+=u*Ge,Ke+=u*Fe,fe+=u*Je,ke+=u*Pe,Me+=u*Xe,He+=u*Ze,J+=u*gt,Oe+=u*rt,Te+=u*ft,Ee+=u*mt,ge+=u*qe,ie+=u*ue,he+=u*Ot,ye+=u*nt,ve+=u*Bt,u=S[5],le+=u*x,Ke+=u*Ge,fe+=u*Fe,ke+=u*Je,Me+=u*Pe,He+=u*Xe,J+=u*Ze,Oe+=u*gt,Te+=u*rt,Ee+=u*ft,ge+=u*mt,ie+=u*qe,he+=u*ue,ye+=u*Ot,ve+=u*nt,ne+=u*Bt,u=S[6],Ke+=u*x,fe+=u*Ge,ke+=u*Fe,Me+=u*Je,He+=u*Pe,J+=u*Xe,Oe+=u*Ze,Te+=u*gt,Ee+=u*rt,ge+=u*ft,ie+=u*mt,he+=u*qe,ye+=u*ue,ve+=u*Ot,ne+=u*nt,D+=u*Bt,u=S[7],fe+=u*x,ke+=u*Ge,Me+=u*Fe,He+=u*Je,J+=u*Pe,Oe+=u*Xe,Te+=u*Ze,Ee+=u*gt,ge+=u*rt,ie+=u*ft,he+=u*mt,ye+=u*qe,ve+=u*ue,ne+=u*Ot,D+=u*nt,N+=u*Bt,u=S[8],ke+=u*x,Me+=u*Ge,He+=u*Fe,J+=u*Je,Oe+=u*Pe,Te+=u*Xe,Ee+=u*Ze,ge+=u*gt,ie+=u*rt,he+=u*ft,ye+=u*mt,ve+=u*qe,ne+=u*ue,D+=u*Ot,N+=u*nt,K+=u*Bt,u=S[9],Me+=u*x,He+=u*Ge,J+=u*Fe,Oe+=u*Je,Te+=u*Pe,Ee+=u*Xe,ge+=u*Ze,ie+=u*gt,he+=u*rt,ye+=u*ft,ve+=u*mt,ne+=u*qe,D+=u*ue,N+=u*Ot,K+=u*nt,j+=u*Bt,u=S[10],He+=u*x,J+=u*Ge,Oe+=u*Fe,Te+=u*Je,Ee+=u*Pe,ge+=u*Xe,ie+=u*Ze,he+=u*gt,ye+=u*rt,ve+=u*ft,ne+=u*mt,D+=u*qe,N+=u*ue,K+=u*Ot,j+=u*nt,$+=u*Bt,u=S[11],J+=u*x,Oe+=u*Ge,Te+=u*Fe,Ee+=u*Je,ge+=u*Pe,ie+=u*Xe,he+=u*Ze,ye+=u*gt,ve+=u*rt,ne+=u*ft,D+=u*mt,N+=u*qe,K+=u*ue,j+=u*Ot,$+=u*nt,Y+=u*Bt,u=S[12],Oe+=u*x,Te+=u*Ge,Ee+=u*Fe,ge+=u*Je,ie+=u*Pe,he+=u*Xe,ye+=u*Ze,ve+=u*gt,ne+=u*rt,D+=u*ft,N+=u*mt,K+=u*qe,j+=u*ue,$+=u*Ot,Y+=u*nt,Ce+=u*Bt,u=S[13],Te+=u*x,Ee+=u*Ge,ge+=u*Fe,ie+=u*Je,he+=u*Pe,ye+=u*Xe,ve+=u*Ze,ne+=u*gt,D+=u*rt,N+=u*ft,K+=u*mt,j+=u*qe,$+=u*ue,Y+=u*Ot,Ce+=u*nt,Ie+=u*Bt,u=S[14],Ee+=u*x,ge+=u*Ge,ie+=u*Fe,he+=u*Je,ye+=u*Pe,ve+=u*Xe,ne+=u*Ze,D+=u*gt,N+=u*rt,K+=u*ft,j+=u*mt,$+=u*qe,Y+=u*ue,Ce+=u*Ot,Ie+=u*nt,We+=u*Bt,u=S[15],ge+=u*x,ie+=u*Ge,he+=u*Fe,ye+=u*Je,ve+=u*Pe,ne+=u*Xe,D+=u*Ze,N+=u*gt,K+=u*rt,j+=u*ft,$+=u*mt,Y+=u*qe,Ce+=u*ue,Ie+=u*Ot,We+=u*nt,Ue+=u*Bt,T+=38*ie,I+=38*he,G+=38*ye,X+=38*ve,we+=38*ne,le+=38*D,Ke+=38*N,fe+=38*K,ke+=38*j,Me+=38*$,He+=38*Y,J+=38*Ce,Oe+=38*Ie,Te+=38*We,Ee+=38*Ue,w=1,u=T+w+65535,w=Math.floor(u/65536),T=u-w*65536,u=I+w+65535,w=Math.floor(u/65536),I=u-w*65536,u=G+w+65535,w=Math.floor(u/65536),G=u-w*65536,u=X+w+65535,w=Math.floor(u/65536),X=u-w*65536,u=we+w+65535,w=Math.floor(u/65536),we=u-w*65536,u=le+w+65535,w=Math.floor(u/65536),le=u-w*65536,u=Ke+w+65535,w=Math.floor(u/65536),Ke=u-w*65536,u=fe+w+65535,w=Math.floor(u/65536),fe=u-w*65536,u=ke+w+65535,w=Math.floor(u/65536),ke=u-w*65536,u=Me+w+65535,w=Math.floor(u/65536),Me=u-w*65536,u=He+w+65535,w=Math.floor(u/65536),He=u-w*65536,u=J+w+65535,w=Math.floor(u/65536),J=u-w*65536,u=Oe+w+65535,w=Math.floor(u/65536),Oe=u-w*65536,u=Te+w+65535,w=Math.floor(u/65536),Te=u-w*65536,u=Ee+w+65535,w=Math.floor(u/65536),Ee=u-w*65536,u=ge+w+65535,w=Math.floor(u/65536),ge=u-w*65536,T+=w-1+37*(w-1),w=1,u=T+w+65535,w=Math.floor(u/65536),T=u-w*65536,u=I+w+65535,w=Math.floor(u/65536),I=u-w*65536,u=G+w+65535,w=Math.floor(u/65536),G=u-w*65536,u=X+w+65535,w=Math.floor(u/65536),X=u-w*65536,u=we+w+65535,w=Math.floor(u/65536),we=u-w*65536,u=le+w+65535,w=Math.floor(u/65536),le=u-w*65536,u=Ke+w+65535,w=Math.floor(u/65536),Ke=u-w*65536,u=fe+w+65535,w=Math.floor(u/65536),fe=u-w*65536,u=ke+w+65535,w=Math.floor(u/65536),ke=u-w*65536,u=Me+w+65535,w=Math.floor(u/65536),Me=u-w*65536,u=He+w+65535,w=Math.floor(u/65536),He=u-w*65536,u=J+w+65535,w=Math.floor(u/65536),J=u-w*65536,u=Oe+w+65535,w=Math.floor(u/65536),Oe=u-w*65536,u=Te+w+65535,w=Math.floor(u/65536),Te=u-w*65536,u=Ee+w+65535,w=Math.floor(u/65536),Ee=u-w*65536,u=ge+w+65535,w=Math.floor(u/65536),ge=u-w*65536,T+=w-1+37*(w-1),p[0]=T,p[1]=I,p[2]=G,p[3]=X,p[4]=we,p[5]=le,p[6]=Ke,p[7]=fe,p[8]=ke,p[9]=Me,p[10]=He,p[11]=J,p[12]=Oe,p[13]=Te,p[14]=Ee,p[15]=ge}function at(p,S){Ae(p,S,S)}function oi(p,S){var y=i(),u;for(u=0;u<16;u++)y[u]=S[u];for(u=253;u>=0;u--)at(y,y),u!==2&&u!==4&&Ae(y,y,S);for(u=0;u<16;u++)p[u]=y[u]}function Ni(p,S){var y=i(),u;for(u=0;u<16;u++)y[u]=S[u];for(u=250;u>=0;u--)at(y,y),u!==1&&Ae(y,y,S);for(u=0;u<16;u++)p[u]=y[u]}function qt(p,S,y){var u=new Uint8Array(32),w=new Float64Array(80),T,I,G=i(),X=i(),we=i(),le=i(),Ke=i(),fe=i();for(I=0;I<31;I++)u[I]=S[I];for(u[31]=S[31]&127|64,u[0]&=248,Mt(w,y),I=0;I<16;I++)X[I]=w[I],le[I]=G[I]=we[I]=0;for(G[0]=le[0]=1,I=254;I>=0;--I)T=u[I>>>3]>>>(I&7)&1,te(G,X,T),te(we,le,T),ut(Ke,G,we),je(G,G,we),ut(we,X,le),je(X,X,le),at(le,Ke),at(fe,G),Ae(G,we,G),Ae(we,X,Ke),ut(Ke,G,we),je(G,G,we),at(X,G),je(we,le,fe),Ae(G,we,v),ut(G,G,le),Ae(we,we,G),Ae(G,le,fe),Ae(le,X,w),at(X,Ke),te(G,X,T),te(we,le,T);for(I=0;I<16;I++)w[I+16]=G[I],w[I+32]=we[I],w[I+48]=X[I],w[I+64]=le[I];var ke=w.subarray(32),Me=w.subarray(16);return oi(ke,ke),Ae(Me,Me,ke),se(p,Me),0}function ai(p,S){return qt(p,S,h)}function fi(p,S){return n(S,32),ai(p,S)}function Gt(p,S,y){var u=new Uint8Array(32);return qt(u,y,S),W(p,a,u,E)}var et=re,_i=oe;function Dr(p,S,y,u,w,T){var I=new Uint8Array(32);return Gt(I,w,T),et(p,S,y,u,I)}function Nr(p,S,y,u,w,T){var I=new Uint8Array(32);return Gt(I,w,T),_i(p,S,y,u,I)}var Hr=[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 Gs(p,S,y,u){for(var w=new Int32Array(16),T=new Int32Array(16),I,G,X,we,le,Ke,fe,ke,Me,He,J,Oe,Te,Ee,ge,ie,he,ye,ve,ne,D,N,K,j,$,Y,Ce=p[0],Ie=p[1],We=p[2],Ue=p[3],x=p[4],Ge=p[5],Fe=p[6],Je=p[7],Pe=S[0],Xe=S[1],Ze=S[2],gt=S[3],rt=S[4],ft=S[5],mt=S[6],qe=S[7],ue=0;u>=128;){for(ve=0;ve<16;ve++)ne=8*ve+ue,w[ve]=y[ne+0]<<24|y[ne+1]<<16|y[ne+2]<<8|y[ne+3],T[ve]=y[ne+4]<<24|y[ne+5]<<16|y[ne+6]<<8|y[ne+7];for(ve=0;ve<80;ve++)if(I=Ce,G=Ie,X=We,we=Ue,le=x,Ke=Ge,fe=Fe,ke=Je,Me=Pe,He=Xe,J=Ze,Oe=gt,Te=rt,Ee=ft,ge=mt,ie=qe,D=Je,N=qe,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=(x>>>14|rt<<18)^(x>>>18|rt<<14)^(rt>>>9|x<<23),N=(rt>>>14|x<<18)^(rt>>>18|x<<14)^(x>>>9|rt<<23),K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,D=x&Ge^~x&Fe,N=rt&ft^~rt&mt,K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,D=Hr[ve*2],N=Hr[ve*2+1],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,D=w[ve%16],N=T[ve%16],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,he=$&65535|Y<<16,ye=K&65535|j<<16,D=he,N=ye,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=(Ce>>>28|Pe<<4)^(Pe>>>2|Ce<<30)^(Pe>>>7|Ce<<25),N=(Pe>>>28|Ce<<4)^(Ce>>>2|Pe<<30)^(Ce>>>7|Pe<<25),K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,D=Ce&Ie^Ce&We^Ie&We,N=Pe&Xe^Pe&Ze^Xe&Ze,K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,ke=$&65535|Y<<16,ie=K&65535|j<<16,D=we,N=Oe,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=he,N=ye,K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,we=$&65535|Y<<16,Oe=K&65535|j<<16,Ie=I,We=G,Ue=X,x=we,Ge=le,Fe=Ke,Je=fe,Ce=ke,Xe=Me,Ze=He,gt=J,rt=Oe,ft=Te,mt=Ee,qe=ge,Pe=ie,ve%16===15)for(ne=0;ne<16;ne++)D=w[ne],N=T[ne],K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=w[(ne+9)%16],N=T[(ne+9)%16],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,he=w[(ne+1)%16],ye=T[(ne+1)%16],D=(he>>>1|ye<<31)^(he>>>8|ye<<24)^he>>>7,N=(ye>>>1|he<<31)^(ye>>>8|he<<24)^(ye>>>7|he<<25),K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,he=w[(ne+14)%16],ye=T[(ne+14)%16],D=(he>>>19|ye<<13)^(ye>>>29|he<<3)^he>>>6,N=(ye>>>19|he<<13)^(he>>>29|ye<<3)^(ye>>>6|he<<26),K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,w[ne]=$&65535|Y<<16,T[ne]=K&65535|j<<16;D=Ce,N=Pe,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[0],N=S[0],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[0]=Ce=$&65535|Y<<16,S[0]=Pe=K&65535|j<<16,D=Ie,N=Xe,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[1],N=S[1],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[1]=Ie=$&65535|Y<<16,S[1]=Xe=K&65535|j<<16,D=We,N=Ze,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[2],N=S[2],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[2]=We=$&65535|Y<<16,S[2]=Ze=K&65535|j<<16,D=Ue,N=gt,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[3],N=S[3],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[3]=Ue=$&65535|Y<<16,S[3]=gt=K&65535|j<<16,D=x,N=rt,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[4],N=S[4],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[4]=x=$&65535|Y<<16,S[4]=rt=K&65535|j<<16,D=Ge,N=ft,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[5],N=S[5],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[5]=Ge=$&65535|Y<<16,S[5]=ft=K&65535|j<<16,D=Fe,N=mt,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[6],N=S[6],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[6]=Fe=$&65535|Y<<16,S[6]=mt=K&65535|j<<16,D=Je,N=qe,K=N&65535,j=N>>>16,$=D&65535,Y=D>>>16,D=p[7],N=S[7],K+=N&65535,j+=N>>>16,$+=D&65535,Y+=D>>>16,j+=K>>>16,$+=j>>>16,Y+=$>>>16,p[7]=Je=$&65535|Y<<16,S[7]=qe=K&65535|j<<16,ue+=128,u-=128}return u}function gi(p,S,y){var u=new Int32Array(8),w=new Int32Array(8),T=new Uint8Array(256),I,G=y;for(u[0]=1779033703,u[1]=3144134277,u[2]=1013904242,u[3]=2773480762,u[4]=1359893119,u[5]=2600822924,u[6]=528734635,u[7]=1541459225,w[0]=4089235720,w[1]=2227873595,w[2]=4271175723,w[3]=1595750129,w[4]=2917565137,w[5]=725511199,w[6]=4215389547,w[7]=327033209,Gs(u,w,S,y),y%=128,I=0;I<y;I++)T[I]=S[G-y+I];for(T[y]=128,y=256-128*(y<112?1:0),T[y-9]=0,P(T,y-8,G/536870912|0,G<<3),Gs(u,w,T,y),I=0;I<8;I++)P(p,8*I,u[I],w[I]);return 0}function vi(p,S){var y=i(),u=i(),w=i(),T=i(),I=i(),G=i(),X=i(),we=i(),le=i();je(y,p[1],p[0]),je(le,S[1],S[0]),Ae(y,y,le),ut(u,p[0],p[1]),ut(le,S[0],S[1]),Ae(u,u,le),Ae(w,p[3],S[3]),Ae(w,w,R),Ae(T,p[2],S[2]),ut(T,T,T),je(I,u,y),je(G,T,w),ut(X,T,w),ut(we,u,y),Ae(p[0],I,G),Ae(p[1],we,X),Ae(p[2],X,G),Ae(p[3],I,we)}function vs(p,S,y){var u;for(u=0;u<4;u++)te(p[u],S[u],y)}function Hi(p,S){var y=i(),u=i(),w=i();oi(w,S[2]),Ae(y,S[0],w),Ae(u,S[1],w),se(p,u),p[31]^=zt(y)<<7}function rs(p,S,y){var u,w;for(A(p[0],d),A(p[1],g),A(p[2],g),A(p[3],d),w=255;w>=0;--w)u=y[w/8|0]>>(w&7)&1,vs(p,S,u),vi(S,p),vi(p,p),vs(p,S,u)}function tt(p,S){var y=[i(),i(),i(),i()];A(y[0],k),A(y[1],B),A(y[2],g),Ae(y[3],k,B),rs(p,y,S)}function ys(p,S,y){var u=new Uint8Array(64),w=[i(),i(),i(),i()],T;for(y||n(S,32),gi(u,S,32),u[0]&=248,u[31]&=127,u[31]|=64,tt(w,u),Hi(p,w),T=0;T<32;T++)S[T+32]=p[T];return 0}var ns=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Ui(p,S){var y,u,w,T;for(u=63;u>=32;--u){for(y=0,w=u-32,T=u-12;w<T;++w)S[w]+=y-16*S[u]*ns[w-(u-32)],y=Math.floor((S[w]+128)/256),S[w]-=y*256;S[w]+=y,S[u]=0}for(y=0,w=0;w<32;w++)S[w]+=y-(S[31]>>4)*ns[w],y=S[w]>>8,S[w]&=255;for(w=0;w<32;w++)S[w]-=y*ns[w];for(u=0;u<32;u++)S[u+1]+=S[u]>>8,p[u]=S[u]&255}function Ss(p){var S=new Float64Array(64),y;for(y=0;y<64;y++)S[y]=p[y];for(y=0;y<64;y++)p[y]=0;Ui(p,S)}function js(p,S,y,u){var w=new Uint8Array(64),T=new Uint8Array(64),I=new Uint8Array(64),G,X,we=new Float64Array(64),le=[i(),i(),i(),i()];gi(w,u,32),w[0]&=248,w[31]&=127,w[31]|=64;var Ke=y+64;for(G=0;G<y;G++)p[64+G]=S[G];for(G=0;G<32;G++)p[32+G]=w[32+G];for(gi(I,p.subarray(32),y+32),Ss(I),tt(le,I),Hi(p,le),G=32;G<64;G++)p[G]=u[G];for(gi(T,p,y+64),Ss(T),G=0;G<64;G++)we[G]=0;for(G=0;G<32;G++)we[G]=I[G];for(G=0;G<32;G++)for(X=0;X<32;X++)we[G+X]+=T[G]*w[X];return Ui(p.subarray(32),we),Ke}function Vt(p,S){var y=i(),u=i(),w=i(),T=i(),I=i(),G=i(),X=i();return A(p[2],g),Mt(p[1],S),at(w,p[1]),Ae(T,w,m),je(w,w,p[2]),ut(T,p[2],T),at(I,T),at(G,I),Ae(X,G,I),Ae(y,X,w),Ae(y,y,T),Ni(y,y),Ae(y,y,w),Ae(y,y,T),Ae(y,y,T),Ae(p[0],y,T),at(u,p[0]),Ae(u,u,T),ct(u,w)&&Ae(p[0],p[0],L),at(u,p[0]),Ae(u,u,T),ct(u,w)?-1:(zt(p[0])===S[31]>>7&&je(p[0],d,p[0]),Ae(p[3],p[0],p[1]),0)}function bt(p,S,y,u){var w,T=new Uint8Array(32),I=new Uint8Array(64),G=[i(),i(),i(),i()],X=[i(),i(),i(),i()];if(y<64||Vt(X,u))return-1;for(w=0;w<y;w++)p[w]=S[w];for(w=0;w<32;w++)p[w+32]=u[w];if(gi(I,p,y),Ss(I),rs(G,X,I),tt(X,S.subarray(32)),vi(G,X),Hi(T,G),y-=64,_e(S,0,T,0)){for(w=0;w<y;w++)p[w]=0;return-1}for(w=0;w<y;w++)p[w]=S[w+64];return y}var Kt=32,Wi=24,Fi=32,Oi=16,zi=32,qi=32,Ti=32,Gi=32,bs=32,os=Wi,Ur=Fi,ws=Oi,dt=64,yi=32,ji=64,Cs=32,$s=64;t.lowlevel={crypto_core_hsalsa20:W,crypto_stream_xor:Be,crypto_stream:ze,crypto_stream_salsa20_xor:ae,crypto_stream_salsa20:be,crypto_onetimeauth:ce,crypto_onetimeauth_verify:f,crypto_verify_16:Z,crypto_verify_32:_e,crypto_secretbox:re,crypto_secretbox_open:oe,crypto_scalarmult:qt,crypto_scalarmult_base:ai,crypto_box_beforenm:Gt,crypto_box_afternm:et,crypto_box:Dr,crypto_box_open:Nr,crypto_box_keypair:fi,crypto_hash:gi,crypto_sign:js,crypto_sign_keypair:ys,crypto_sign_open:bt,crypto_secretbox_KEYBYTES:Kt,crypto_secretbox_NONCEBYTES:Wi,crypto_secretbox_ZEROBYTES:Fi,crypto_secretbox_BOXZEROBYTES:Oi,crypto_scalarmult_BYTES:zi,crypto_scalarmult_SCALARBYTES:qi,crypto_box_PUBLICKEYBYTES:Ti,crypto_box_SECRETKEYBYTES:Gi,crypto_box_BEFORENMBYTES:bs,crypto_box_NONCEBYTES:os,crypto_box_ZEROBYTES:Ur,crypto_box_BOXZEROBYTES:ws,crypto_sign_BYTES:dt,crypto_sign_PUBLICKEYBYTES:yi,crypto_sign_SECRETKEYBYTES:ji,crypto_sign_SEEDBYTES:Cs,crypto_hash_BYTES:$s,gf:i,D:m,L:ns,pack25519:se,unpack25519:Mt,M:Ae,A:ut,S:at,Z:je,pow2523:Ni,add:vi,set25519:A,modL:Ui,scalarmult:rs,scalarbase:tt};function Qt(p,S){if(p.length!==Kt)throw new Error("bad key size");if(S.length!==Wi)throw new Error("bad nonce size")}function Cn(p,S){if(p.length!==Ti)throw new Error("bad public key size");if(S.length!==Gi)throw new Error("bad secret key size")}function Yt(){for(var p=0;p<arguments.length;p++)if(!(arguments[p]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Vs(p){for(var S=0;S<p.length;S++)p[S]=0}t.randomBytes=function(p){var S=new Uint8Array(p);return n(S,p),S},t.secretbox=function(p,S,y){Yt(p,S,y),Qt(y,S);for(var u=new Uint8Array(Fi+p.length),w=new Uint8Array(u.length),T=0;T<p.length;T++)u[T+Fi]=p[T];return re(w,u,u.length,S,y),w.subarray(Oi)},t.secretbox.open=function(p,S,y){Yt(p,S,y),Qt(y,S);for(var u=new Uint8Array(Oi+p.length),w=new Uint8Array(u.length),T=0;T<p.length;T++)u[T+Oi]=p[T];return u.length<32||oe(w,u,u.length,S,y)!==0?null:w.subarray(Fi)},t.secretbox.keyLength=Kt,t.secretbox.nonceLength=Wi,t.secretbox.overheadLength=Oi,t.scalarMult=function(p,S){if(Yt(p,S),p.length!==qi)throw new Error("bad n size");if(S.length!==zi)throw new Error("bad p size");var y=new Uint8Array(zi);return qt(y,p,S),y},t.scalarMult.base=function(p){if(Yt(p),p.length!==qi)throw new Error("bad n size");var S=new Uint8Array(zi);return ai(S,p),S},t.scalarMult.scalarLength=qi,t.scalarMult.groupElementLength=zi,t.box=function(p,S,y,u){var w=t.box.before(y,u);return t.secretbox(p,S,w)},t.box.before=function(p,S){Yt(p,S),Cn(p,S);var y=new Uint8Array(bs);return Gt(y,p,S),y},t.box.after=t.secretbox,t.box.open=function(p,S,y,u){var w=t.box.before(y,u);return t.secretbox.open(p,S,w)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var p=new Uint8Array(Ti),S=new Uint8Array(Gi);return fi(p,S),{publicKey:p,secretKey:S}},t.box.keyPair.fromSecretKey=function(p){if(Yt(p),p.length!==Gi)throw new Error("bad secret key size");var S=new Uint8Array(Ti);return ai(S,p),{publicKey:S,secretKey:new Uint8Array(p)}},t.box.publicKeyLength=Ti,t.box.secretKeyLength=Gi,t.box.sharedKeyLength=bs,t.box.nonceLength=os,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(p,S){if(Yt(p,S),S.length!==ji)throw new Error("bad secret key size");var y=new Uint8Array(dt+p.length);return js(y,p,p.length,S),y},t.sign.open=function(p,S){if(Yt(p,S),S.length!==yi)throw new Error("bad public key size");var y=new Uint8Array(p.length),u=bt(y,p,p.length,S);if(u<0)return null;for(var w=new Uint8Array(u),T=0;T<w.length;T++)w[T]=y[T];return w},t.sign.detached=function(p,S){for(var y=t.sign(p,S),u=new Uint8Array(dt),w=0;w<u.length;w++)u[w]=y[w];return u},t.sign.detached.verify=function(p,S,y){if(Yt(p,S,y),S.length!==dt)throw new Error("bad signature size");if(y.length!==yi)throw new Error("bad public key size");var u=new Uint8Array(dt+p.length),w=new Uint8Array(dt+p.length),T;for(T=0;T<dt;T++)u[T]=S[T];for(T=0;T<p.length;T++)u[T+dt]=p[T];return bt(w,u,u.length,y)>=0},t.sign.keyPair=function(){var p=new Uint8Array(yi),S=new Uint8Array(ji);return ys(p,S),{publicKey:p,secretKey:S}},t.sign.keyPair.fromSecretKey=function(p){if(Yt(p),p.length!==ji)throw new Error("bad secret key size");for(var S=new Uint8Array(yi),y=0;y<S.length;y++)S[y]=p[32+y];return{publicKey:S,secretKey:new Uint8Array(p)}},t.sign.keyPair.fromSeed=function(p){if(Yt(p),p.length!==Cs)throw new Error("bad seed size");for(var S=new Uint8Array(yi),y=new Uint8Array(ji),u=0;u<32;u++)y[u]=p[u];return ys(S,y,!0),{publicKey:S,secretKey:y}},t.sign.publicKeyLength=yi,t.sign.secretKeyLength=ji,t.sign.seedLength=Cs,t.sign.signatureLength=dt,t.hash=function(p){Yt(p);var S=new Uint8Array($s);return gi(S,p,p.length),S},t.hash.hashLength=$s,t.verify=function(p,S){return Yt(p,S),p.length===0||S.length===0||p.length!==S.length?!1:U(p,0,S,0,p.length)===0},t.setPRNG=function(p){n=p},(function(){var p=typeof self<"u"?self.crypto||self.msCrypto:null;if(p&&p.getRandomValues){var S=65536;t.setPRNG(function(y,u){var w,T=new Uint8Array(u);for(w=0;w<u;w+=S)p.getRandomValues(T.subarray(w,w+Math.min(u-w,S)));for(w=0;w<u;w++)y[w]=T[w];Vs(T)})}else typeof gf<"u"&&(p=vf,p&&p.randomBytes&&t.setPRNG(function(y,u){var w,T=p.randomBytes(u);for(w=0;w<u;w++)y[w]=T[w];Vs(T)}))})()})(e.exports?e.exports:self.nacl=self.nacl||{})})(Kn)),Kn.exports}var Sf=yf();const uo=af(Sf),Ws=24,bf=16;function wf(e,t){const i=uo.randomBytes(Ws),n=uo.secretbox(e,i,t),a=new Uint8Array(Ws+n.length);return a.set(i),a.set(n,Ws),a}function Cf(e,t){if(e.length<Ws+bf)throw new Error("Sealed data too short");const i=e.slice(0,Ws),n=e.slice(Ws),a=uo.secretbox.open(n,i,t);if(!a)throw new Error("Decryption failed - data may be tampered with");return a}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function xf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function fo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function vn(e,...t){if(!xf(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function _a(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");fo(e.outputLen),fo(e.blockLen)}function cn(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 kf(e,t){vn(e);const i=t.outputLen;if(e.length<i)throw new Error("digestInto() expects output buffer of length at least "+i)}function xr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Yn(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function wi(e,t){return e<<32-t|e>>>t}function Ef(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function kr(e){return typeof e=="string"&&(e=Ef(e)),vn(e),e}class jh{}function Rf(e){const t=n=>e().update(kr(n)).digest(),i=e();return t.outputLen=i.outputLen,t.blockLen=i.blockLen,t.create=()=>e(),t}function Af(e,t,i,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,i,n);const a=BigInt(32),h=BigInt(4294967295),d=Number(i>>a&h),g=Number(i&h),v=n?4:0,m=n?0:4;e.setUint32(t+v,d,n),e.setUint32(t+m,g,n)}function Mf(e,t,i){return e&t^~e&i}function Of(e,t,i){return e&t^e&i^t&i}class Tf extends jh{constructor(t,i,n,a){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=i,this.padOffset=n,this.isLE=a,this.buffer=new Uint8Array(t),this.view=Yn(this.buffer)}update(t){cn(this),t=kr(t),vn(t);const{view:i,buffer:n,blockLen:a}=this,h=t.length;for(let d=0;d<h;){const g=Math.min(a-this.pos,h-d);if(g===a){const v=Yn(t);for(;a<=h-d;d+=a)this.process(v,d);continue}n.set(t.subarray(d,d+g),this.pos),this.pos+=g,d+=g,this.pos===a&&(this.process(i,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){cn(this),kf(t,this),this.finished=!0;const{buffer:i,view:n,blockLen:a,isLE:h}=this;let{pos:d}=this;i[d++]=128,xr(this.buffer.subarray(d)),this.padOffset>a-d&&(this.process(n,0),d=0);for(let k=d;k<a;k++)i[k]=0;Af(n,a-8,BigInt(this.length*8),h),this.process(n,0);const g=Yn(t),v=this.outputLen;if(v%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const m=v/4,R=this.get();if(m>R.length)throw new Error("_sha2: outputLen bigger than state");for(let k=0;k<m;k++)g.setUint32(4*k,R[k],h)}digest(){const{buffer:t,outputLen:i}=this;this.digestInto(t);const n=t.slice(0,i);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:i,buffer:n,length:a,finished:h,destroyed:d,pos:g}=this;return t.destroyed=d,t.finished=h,t.length=a,t.pos=g,a%i&&t.buffer.set(n),t}clone(){return this._cloneInto()}}const Yi=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pf=Uint32Array.from([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]),Ji=new Uint32Array(64);class Lf extends Tf{constructor(t=32){super(64,t,8,!1),this.A=Yi[0]|0,this.B=Yi[1]|0,this.C=Yi[2]|0,this.D=Yi[3]|0,this.E=Yi[4]|0,this.F=Yi[5]|0,this.G=Yi[6]|0,this.H=Yi[7]|0}get(){const{A:t,B:i,C:n,D:a,E:h,F:d,G:g,H:v}=this;return[t,i,n,a,h,d,g,v]}set(t,i,n,a,h,d,g,v){this.A=t|0,this.B=i|0,this.C=n|0,this.D=a|0,this.E=h|0,this.F=d|0,this.G=g|0,this.H=v|0}process(t,i){for(let k=0;k<16;k++,i+=4)Ji[k]=t.getUint32(i,!1);for(let k=16;k<64;k++){const B=Ji[k-15],L=Ji[k-2],P=wi(B,7)^wi(B,18)^B>>>3,U=wi(L,17)^wi(L,19)^L>>>10;Ji[k]=U+Ji[k-7]+P+Ji[k-16]|0}let{A:n,B:a,C:h,D:d,E:g,F:v,G:m,H:R}=this;for(let k=0;k<64;k++){const B=wi(g,6)^wi(g,11)^wi(g,25),L=R+B+Mf(g,v,m)+Pf[k]+Ji[k]|0,U=(wi(n,2)^wi(n,13)^wi(n,22))+Of(n,a,h)|0;R=m,m=v,v=g,g=d+L|0,d=h,h=a,a=n,n=L+U|0}n=n+this.A|0,a=a+this.B|0,h=h+this.C|0,d=d+this.D|0,g=g+this.E|0,v=v+this.F|0,m=m+this.G|0,R=R+this.H|0,this.set(n,a,h,d,g,v,m,R)}roundClean(){xr(Ji)}destroy(){this.set(0,0,0,0,0,0,0,0),xr(this.buffer)}}const Bf=Rf(()=>new Lf),Tr=Bf;class $h extends jh{constructor(t,i){super(),this.finished=!1,this.destroyed=!1,_a(t);const n=kr(i);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const a=this.blockLen,h=new Uint8Array(a);h.set(n.length>a?t.create().update(n).digest():n);for(let d=0;d<h.length;d++)h[d]^=54;this.iHash.update(h),this.oHash=t.create();for(let d=0;d<h.length;d++)h[d]^=106;this.oHash.update(h),xr(h)}update(t){return cn(this),this.iHash.update(t),this}digestInto(t){cn(this),vn(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:i,iHash:n,finished:a,destroyed:h,blockLen:d,outputLen:g}=this;return t=t,t.finished=a,t.destroyed=h,t.blockLen=d,t.outputLen=g,t.oHash=i._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const ga=(e,t,i)=>new $h(e,t).update(i).digest();ga.create=(e,t)=>new $h(e,t);function If(e,t,i){return _a(e),i===void 0&&(i=new Uint8Array(e.outputLen)),ga(e,kr(i),kr(t))}const Jn=Uint8Array.from([0]),Df=Uint8Array.of();function Nf(e,t,i,n=32){_a(e),fo(n);const a=e.outputLen;if(n>255*a)throw new Error("Length should be <= 255*HashLen");const h=Math.ceil(n/a),d=new Uint8Array(h*a),g=ga.create(e,t),v=g._cloneInto(),m=new Uint8Array(g.outputLen);for(let R=0;R<h;R++)Jn[0]=R+1,v.update(R===0?Df:m).update(i).update(Jn).digestInto(m),d.set(m,a*R),g._cloneInto(v);return g.destroy(),v.destroy(),xr(m,Jn),d.slice(0,n)}const Hf=(e,t,i,n,a)=>Nf(e,If(e,t,i),n,a);function Uf(e){const t=Tr(new TextEncoder().encode(`airloom-session:${e}`));return Array.from(t.slice(0,16),i=>i.toString(16).padStart(2,"0")).join("")}function pa(e,t){const i=new TextEncoder().encode("airloom-v1");return Hf(Tr,e,i,"airloom-encryption",32)}function Wf(e){return e.replace(/[-\s]/g,"").toUpperCase()}class Ff{constructor(t,i,n){Qe(this,"_ended",!1);this.id=t,this.sendFn=i,this.meta=n}write(t){if(this._ended)throw new Error("Cannot write after stream has ended");this.sendFn({type:"stream_chunk",id:this.id,data:t})}end(){this._ended||(this._ended=!0,this.sendFn({type:"stream_end",id:this.id}))}get ended(){return this._ended}}class zf extends Gh.EventEmitter{constructor(i,n){super();Qe(this,"id");Qe(this,"meta");Qe(this,"_ended",!1);this.id=i,this.meta=n}_pushChunk(i){this._ended||this.emit("data",i)}_end(){this._ended||(this._ended=!0,this.emit("end"))}get ended(){return this._ended}}class qf extends Gh.EventEmitter{constructor(i){super();Qe(this,"adapter");Qe(this,"encryptionKey");Qe(this,"role");Qe(this,"streams",new Map);Qe(this,"_ready",!1);Qe(this,"msgCounter",0);this.adapter=i.adapter,this.encryptionKey=i.encryptionKey??null,this.role=i.role,this.setupHandlers()}setupHandlers(){this.adapter.onMessage(i=>{this.handlePayload(i)}),this.adapter.onPeerJoined(()=>{this.encryptionKey&&(this._ready=!0,this.emit("ready"))}),this.adapter.onPeerLeft(()=>{this._ready=!1,this.emit("peer_left")}),this.adapter.onError(i=>this.emit("error",i)),this.adapter.onDisconnect(()=>this.emit("disconnect"))}handlePayload(i){try{if(!this.encryptionKey){this.emit("error",new Error("Received data but no encryption key"));return}const n=uf(i),a=Cf(n,this.encryptionKey),h=ff(a);this.handleMessage(h)}catch(n){this.emit("error",n)}}handleMessage(i){switch(i.type){case"message":this.emit("message",i.data);break;case"stream_start":{const n=new zf(i.id,i.meta);this.streams.set(i.id,n),this.emit("stream",n);break}case"stream_chunk":{const n=this.streams.get(i.id);n&&n._pushChunk(i.data);break}case"stream_end":{const n=this.streams.get(i.id);n&&(n._end(),this.streams.delete(i.id));break}}}sendRaw(i){if(!this.encryptionKey)throw new Error("No encryption key established");const n=df(i),a=wf(n,this.encryptionKey);this.adapter.send(cf(a))}send(i){const n=`msg-${++this.msgCounter}`;this.sendRaw({type:"message",id:n,data:i})}createStream(i){const n=`stream-${++this.msgCounter}`;return this.sendRaw({type:"stream_start",id:n,meta:i}),new Ff(n,a=>this.sendRaw(a),i)}async connect(i){await this.adapter.connect(i,this.role)}get ready(){return this._ready}waitForReady(i=3e4){return this._ready?Promise.resolve():new Promise((n,a)=>{const h=()=>{clearTimeout(m),this.removeListener("ready",d),this.removeListener("error",g),this.removeListener("disconnect",v)},d=()=>{h(),n()},g=R=>{h(),a(R)},v=()=>{h(),a(new Error("Disconnected before ready"))},m=setTimeout(()=>{h(),a(new Error("Timed out waiting for peer"))},i);this.once("ready",d),this.once("error",g),this.once("disconnect",v)})}close(){for(const i of this.streams.values())i._end();this.streams.clear(),this.adapter.close(),this.removeAllListeners()}}class Gf{constructor(t){Qe(this,"ws",null);Qe(this,"url");Qe(this,"_connected",!1);Qe(this,"messageHandlers",[]);Qe(this,"peerJoinedHandlers",[]);Qe(this,"peerLeftHandlers",[]);Qe(this,"errorHandlers",[]);Qe(this,"disconnectHandlers",[]);Qe(this,"reconnectAttempts",0);Qe(this,"maxReconnectAttempts",5);Qe(this,"reconnectTimer",null);Qe(this,"shouldReconnect",!1);Qe(this,"sessionToken",null);Qe(this,"role",null);this.url=t}get connected(){return this._connected}async connect(t,i){return this.sessionToken=t,this.role=i,this.doConnect()}async doConnect(){const t=await this.createWebSocket(this.url);return new Promise((i,n)=>{t.onopen=()=>{this._connected=!0,this.shouldReconnect=!0,this.reconnectAttempts=0;const a=this.role==="host"?{type:"create",sessionToken:this.sessionToken}:{type:"join",sessionToken:this.sessionToken};t.send(JSON.stringify(a)),i()},t.onmessage=a=>{const h=a.data,d=typeof h=="string"?h:typeof Buffer<"u"&&Buffer.isBuffer(h)?h.toString("utf-8"):new TextDecoder().decode(h);try{const g=JSON.parse(d);switch(g.type){case"created":case"joined":break;case"peer_joined":this.peerJoinedHandlers.forEach(v=>v());break;case"peer_left":this.peerLeftHandlers.forEach(v=>v());break;case"forward":this.messageHandlers.forEach(v=>v(g.payload));break;case"error":this.errorHandlers.forEach(v=>v(new Error(g.message)));break}}catch(g){this.errorHandlers.forEach(v=>v(g instanceof Error?g:new Error(String(g))))}},t.onclose=()=>{const a=this._connected;this._connected=!1,a&&this.disconnectHandlers.forEach(h=>h()),this.shouldReconnect&&!this.reconnectTimer&&this.attemptReconnect()},t.onerror=a=>{const h=a instanceof Error?a:new Error("WebSocket error");this.errorHandlers.forEach(d=>d(h)),this._connected||(this.shouldReconnect=!1,n(h))},this.ws=t})}async createWebSocket(t){if(typeof globalThis.WebSocket<"u")return new globalThis.WebSocket(t);try{const{default:i}=await qh(async()=>{const{default:n}=await import("./browser-CNNk1Yyj.js").then(a=>a.b);return{default:n}},[],import.meta.url);return new i(t)}catch{throw new Error('No WebSocket implementation available. Install the "ws" package for Node.js.')}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts||!this.sessionToken||!this.role)return;this.reconnectAttempts++;const t=Math.min(1e3*Math.pow(2,this.reconnectAttempts-1),3e4);this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.doConnect().catch(()=>{})},t)}send(t){!this.ws||!this._connected||this.ws.send(JSON.stringify({type:"forward",payload:t}))}onMessage(t){this.messageHandlers.push(t)}onPeerJoined(t){this.peerJoinedHandlers.push(t)}onPeerLeft(t){this.peerLeftHandlers.push(t)}onError(t){this.errorHandlers.push(t)}onDisconnect(t){this.disconnectHandlers.push(t)}close(){var t;this.shouldReconnect=!1,this.maxReconnectAttempts=0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.ws)==null||t.close(),this.ws=null,this._connected=!1}}var en={exports:{}};/*@license Copyright 2015-2022 Ably Real-time Ltd (ably.com)
|
|
2
2
|
|
|
3
3
|
Ably JavaScript Library v2.20.0
|
|
4
4
|
https://github.com/ably/ably-js
|
|
@@ -48,5 +48,5 @@ WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){t
|
|
|
48
48
|
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
49
49
|
* http://bellard.org/jslinux/
|
|
50
50
|
* Copyright (c) 2011 Fabrice Bellard
|
|
51
|
-
*/var rm=2,nm=1,om=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var k;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((k=this._terminal.options.overviewRuler)==null?void 0:k.width)||14,i=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(i.getPropertyValue("height")),a=Math.max(0,parseInt(i.getPropertyValue("width"))),h=window.getComputedStyle(this._terminal.element),d={top:parseInt(h.getPropertyValue("padding-top")),bottom:parseInt(h.getPropertyValue("padding-bottom")),right:parseInt(h.getPropertyValue("padding-right")),left:parseInt(h.getPropertyValue("padding-left"))},g=d.top+d.bottom,v=d.right+d.left,m=n-g,R=a-v-t;return{cols:Math.max(rm,Math.floor(R/e.css.cell.width)),rows:Math.max(nm,Math.floor(m/e.css.cell.height))}}};function Ei(e){console.log(e)}"serviceWorker"in navigator&&(navigator.serviceWorker.getRegistrations().then(e=>e.forEach(t=>t.unregister())),caches.keys().then(e=>e.forEach(t=>caches.delete(t))));const qc=document.getElementById("connectScreen"),Ra=document.getElementById("terminalScreen"),am=document.getElementById("scanBtn"),lm=document.getElementById("joinBtn"),_s=document.getElementById("codeInput"),oa=document.getElementById("relayInput"),aa=document.getElementById("connectError"),la=document.getElementById("connectStatus"),hm=document.getElementById("disconnectBtn"),Bh=document.getElementById("terminalStatus"),Ih=document.getElementById("qrReader"),Dh=document.getElementById("terminalContainer"),Gc=document.getElementById("terminal"),cm=document.getElementById("focusTerminalBtn"),um=document.getElementById("ctrlCBtn"),dm=document.getElementById("escBtn"),fm=document.getElementById("tabBtn");let ot=null,Ye=null,Mr=null,Hs=null,ss=!1,Us=!1;function ha(e,t){try{localStorage.setItem("airloom:lastRelay",t)}catch{}}function ca(e){try{localStorage.setItem("airloom:lastSession",JSON.stringify(e))}catch{}}function jc(){try{const e=localStorage.getItem("airloom:lastSession");return e?JSON.parse(e):null}catch{return null}}function _m(){try{localStorage.removeItem("airloom:lastSession")}catch{}}function $c(){try{const e=localStorage.getItem("airloom:lastRelay");e&&!oa.value&&(oa.value=e)}catch{}}const gm={background:"#05070c",foreground:"#e6edf3",cursor:"#7c8aff",cursorAccent:"#05070c",selectionBackground:"rgba(124,138,255,0.28)",black:"#0a0d14",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#7c8aff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#c9d1d9",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#a5b4ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},pm={background:"#
|
|
52
|
-
`))}function mm(){ss=!1,Us=!1,ua=0,da=0,ot==null||ot.close(),ot=null,Hs==null||Hs.disconnect(),Hs=null,Ye==null||Ye.dispose(),Ye=null,Mr=null,Gc.innerHTML="",Ra.style.display="none",qc.style.display="flex",$c()}$c();const Hh=document.getElementById("app");let Uh=0;function hn(){if(!window.visualViewport)return;const e=window.visualViewport;Hh.style.height=`${e.height}px`,Hh.style.top=`${e.offsetTop}px`,Ra.classList.toggle("landscape",e.width>e.height),cancelAnimationFrame(Uh),Uh=requestAnimationFrame(()=>Aa())}window.visualViewport&&(window.visualViewport.addEventListener("resize",hn),window.visualViewport.addEventListener("scroll",hn),hn());window.addEventListener("orientationchange",()=>setTimeout(hn,300));_s.addEventListener("input",()=>{let e=_s.value.replace(/[^A-Za-z0-9]/g,"").toUpperCase();e.length>4&&(e=e.slice(0,4)+"-"+e.slice(4,8)),_s.value=e});lm.addEventListener("click",()=>Kc());_s.addEventListener("keydown",e=>{e.key==="Enter"&&Kc()});am.addEventListener("click",async()=>{try{const{Html5Qrcode:e}=await qh(async()=>{const{Html5Qrcode:i}=await import("./index-
|
|
51
|
+
*/var rm=2,nm=1,om=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var k;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((k=this._terminal.options.overviewRuler)==null?void 0:k.width)||14,i=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(i.getPropertyValue("height")),a=Math.max(0,parseInt(i.getPropertyValue("width"))),h=window.getComputedStyle(this._terminal.element),d={top:parseInt(h.getPropertyValue("padding-top")),bottom:parseInt(h.getPropertyValue("padding-bottom")),right:parseInt(h.getPropertyValue("padding-right")),left:parseInt(h.getPropertyValue("padding-left"))},g=d.top+d.bottom,v=d.right+d.left,m=n-g,R=a-v-t;return{cols:Math.max(rm,Math.floor(R/e.css.cell.width)),rows:Math.max(nm,Math.floor(m/e.css.cell.height))}}};function Ei(e){console.log(e)}"serviceWorker"in navigator&&(navigator.serviceWorker.getRegistrations().then(e=>e.forEach(t=>t.unregister())),caches.keys().then(e=>e.forEach(t=>caches.delete(t))));const qc=document.getElementById("connectScreen"),Ra=document.getElementById("terminalScreen"),am=document.getElementById("scanBtn"),lm=document.getElementById("joinBtn"),_s=document.getElementById("codeInput"),oa=document.getElementById("relayInput"),aa=document.getElementById("connectError"),la=document.getElementById("connectStatus"),hm=document.getElementById("disconnectBtn"),Bh=document.getElementById("terminalStatus"),Ih=document.getElementById("qrReader"),Dh=document.getElementById("terminalContainer"),Gc=document.getElementById("terminal"),cm=document.getElementById("focusTerminalBtn"),um=document.getElementById("ctrlCBtn"),dm=document.getElementById("escBtn"),fm=document.getElementById("tabBtn");let ot=null,Ye=null,Mr=null,Hs=null,ss=!1,Us=!1;function ha(e,t){try{localStorage.setItem("airloom:lastRelay",t)}catch{}}function ca(e){try{localStorage.setItem("airloom:lastSession",JSON.stringify(e))}catch{}}function jc(){try{const e=localStorage.getItem("airloom:lastSession");return e?JSON.parse(e):null}catch{return null}}function _m(){try{localStorage.removeItem("airloom:lastSession")}catch{}}function $c(){try{const e=localStorage.getItem("airloom:lastRelay");e&&!oa.value&&(oa.value=e)}catch{}}const gm={background:"#05070c",foreground:"#e6edf3",cursor:"#7c8aff",cursorAccent:"#05070c",selectionBackground:"rgba(124,138,255,0.28)",black:"#0a0d14",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#7c8aff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#c9d1d9",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#a5b4ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},pm={background:"#ffffff",foreground:"#1c1c1e",cursor:"#5856d6",cursorAccent:"#ffffff",selectionBackground:"rgba(88,86,214,0.20)",black:"#1c1c1e",red:"#c41a16",green:"#007400",yellow:"#826b28",blue:"#0000ff",magenta:"#a90d91",cyan:"#3e8a8a",white:"#e5e5ea",brightBlack:"#6e6e73",brightRed:"#eb4d3d",brightGreen:"#36b738",brightYellow:"#b79a14",brightBlue:"#0451a5",brightMagenta:"#c42275",brightCyan:"#318495",brightWhite:"#f2f2f7"};function Vc(){return window.matchMedia("(prefers-color-scheme: light)").matches?pm:gm}function Nh(){if(!Ye){Ye=new sm({cursorBlink:!0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:14,lineHeight:1.25,allowTransparency:!0,scrollback:5e3,theme:Vc()}),Mr=new om,Ye.loadAddon(Mr),Ye.open(Gc);for(const e of[4,10,11,12,17,19])Ye.parser.registerOscHandler(e,()=>!0);Ye.onData(e=>{!ss||!ot||ot.send({type:"terminal_input",data:e})}),Dh.addEventListener("click",()=>Ye==null?void 0:Ye.focus()),Hs=new ResizeObserver(()=>Aa()),Hs.observe(Dh)}}window.matchMedia("(prefers-color-scheme: light)").addEventListener("change",()=>{Ye&&(Ye.options.theme=Vc())});let ua=0,da=0;function Aa(e=!1){if(!Ye||!Mr){Ei("[viewer] fitAndSyncTerminal: no term or fitAddon");return}if(Mr.fit(),!ot||!ss){Ei("[viewer] fitAndSyncTerminal: no channel or not ready");return}const t=Ye.cols,i=Ye.rows;if(!e&&t===ua&&i===da){Ei(`[viewer] Skipping resize: same dimensions (${t}x${i})`);return}ua=t,da=i;const n=e?{type:"terminal_open",cols:t,rows:i}:{type:"terminal_resize",cols:t,rows:i};Ei(`[viewer] Sending ${n.type} (${t}x${i})`),ot.send(n)}function co(e,t="status-badge"){Bh.textContent=e,Bh.className=t}function Bs(e){Ye&&Ye.writeln(e.replace(/\n/g,`\r
|
|
52
|
+
`))}function mm(){ss=!1,Us=!1,ua=0,da=0,ot==null||ot.close(),ot=null,Hs==null||Hs.disconnect(),Hs=null,Ye==null||Ye.dispose(),Ye=null,Mr=null,Gc.innerHTML="",Ra.style.display="none",qc.style.display="flex",$c()}$c();const Hh=document.getElementById("app");let Uh=0;function hn(){if(!window.visualViewport)return;const e=window.visualViewport;Hh.style.height=`${e.height}px`,Hh.style.top=`${e.offsetTop}px`,Ra.classList.toggle("landscape",e.width>e.height),cancelAnimationFrame(Uh),Uh=requestAnimationFrame(()=>Aa())}window.visualViewport&&(window.visualViewport.addEventListener("resize",hn),window.visualViewport.addEventListener("scroll",hn),hn());window.addEventListener("orientationchange",()=>setTimeout(hn,300));_s.addEventListener("input",()=>{let e=_s.value.replace(/[^A-Za-z0-9]/g,"").toUpperCase();e.length>4&&(e=e.slice(0,4)+"-"+e.slice(4,8)),_s.value=e});lm.addEventListener("click",()=>Kc());_s.addEventListener("keydown",e=>{e.key==="Enter"&&Kc()});am.addEventListener("click",async()=>{try{const{Html5Qrcode:e}=await qh(async()=>{const{Html5Qrcode:i}=await import("./index-BrCBwFcp.js");return{Html5Qrcode:i}},[],import.meta.url);Ih.style.display="block";const t=new e("qrReader");await t.start({facingMode:"environment"},{fps:10,qrbox:{width:250,height:250}},async i=>{await t.stop(),Ih.style.display="none",Yc(i)},()=>{})}catch{Or("Camera access denied or not available")}});cm.addEventListener("click",()=>Ye==null?void 0:Ye.focus());um.addEventListener("click",()=>{Ye==null||Ye.focus(),ss&&ot&&ot.send({type:"terminal_input",data:""})});dm.addEventListener("click",()=>{Ye==null||Ye.focus(),ss&&ot&&ot.send({type:"terminal_input",data:"\x1B"})});fm.addEventListener("click",()=>{Ye==null||Ye.focus(),ss&&ot&&ot.send({type:"terminal_input",data:" "})});hm.addEventListener("click",()=>{ot==null||ot.send({type:"terminal_close"}),mm()});(async()=>{const e=location.hash.slice(1);if(e){history.replaceState(null,"",location.pathname+location.search);try{const a=atob(e.replace(/-/g,"+").replace(/_/g,"/"));await Yc(a)}catch{}ot||mn();return}const t=jc();if(!t)return;fa("Reconnecting...");const i=Tr(new TextEncoder().encode("airloom-key:"+t.session)),n=pa(i);try{await Cr(t.relay,t.session,n,t.transport,t.token,8e3)}catch(a){Ei(`[viewer] Auto-reconnect failed: ${a instanceof Error?a.message:a}`)}ot||(_m(),mn(),Jc())})();async function Kc(){if(Us)return;const e=Wf(_s.value);if(e.length!==8){Or("Code must be 8 characters");return}const t=Uf(e),i=Tr(new TextEncoder().encode("airloom-key:"+t)),n=pa(i),a=jc(),h=[...new Set([location.origin,a==null?void 0:a.hostOrigin].filter(Boolean))];for(const g of h)try{const v=await fetch(`${g}/api/pair?session=${encodeURIComponent(t)}`);if(v.ok){const m=await v.json();ha(_s.value,m.relay),ca({session:t,token:m.token,transport:m.transport,relay:m.relay,hostOrigin:g}),await Cr(m.relay,t,n,m.transport,m.token);return}}catch{}if(a!=null&&a.token&&a.transport==="ably"){ca({...a,session:t}),await Cr(a.relay,t,n,"ably",a.token);return}const d=oa.value.trim()||"ws://localhost:4500";ha(_s.value,d),await Cr(d,t,n)}async function Yc(e){try{const t=_f(e);ha(null,t.relay);const i=t.transport??"ws";ca({session:t.session,token:t.token,transport:i,relay:t.relay,hostOrigin:location.origin});const n=Tr(new TextEncoder().encode("airloom-key:"+t.session)),a=pa(n);await Cr(t.relay,t.session,a,i,t.token)}catch(t){const i=t instanceof Error?t.message:"Unknown error";Or("Invalid QR code: "+i)}}function vm(e){const t=e.meta;return(t==null?void 0:t.kind)==="terminal"}async function Cr(e,t,i,n="ws",a,h=0){Us=!0,fa("Connecting..."),mn();try{let d;if(n==="ably"){if(!a){Or("Ably transport requires a token");return}d=new Kf({token:a})}else d=new Gf(e);ot=new qf({adapter:d,role:"viewer",encryptionKey:i});let g=null;h>0&&(g=setTimeout(()=>{if(!ss){Us=!1;const v=ot;ot=null,v==null||v.close(),mn(),Jc()}},h)),ot.on("ready",()=>{g&&(clearTimeout(g),g=null),Us=!1,Ei("[viewer] Channel ready"),ss=!0,qc.style.display="none",Ra.style.display="flex",co("Connected"),Nh(),Ei("[viewer] Terminal ensured, calling fitAndSyncTerminal(true)"),requestAnimationFrame(()=>{Aa(!0),Ye==null||Ye.focus()})}),ot.on("peer_left",()=>{co("Disconnected","status-badge disconnected"),Bs(""),Bs("[host disconnected]")}),ot.on("message",v=>{if(!(!v||typeof v!="object"||!("type"in v))&&v.type==="terminal_exit"){const m=v,R=typeof m.exitCode=="number"?`exit ${m.exitCode}`:"terminated";Bs(""),Bs(`[terminal ${R}]`)}}),ot.on("stream",v=>{if(!vm(v)){Ei("[viewer] Non-terminal stream, ignoring");return}Ei("[viewer] Terminal stream received"),Nh(),v.on("data",m=>{Ye==null||Ye.write(m)}),v.on("end",()=>{Ei("[viewer] Stream ended"),Bs("[session closed]")})}),ot.on("error",v=>{console.error("Channel error:",v),Bs(`[error: ${v.message}]`)}),ot.on("disconnect",()=>co("Reconnecting…","status-badge reconnecting")),await ot.connect(t),fa("Connected to relay, waiting for host...")}catch(d){Us=!1;const g=ot;ot=null;try{g==null||g.close()}catch{}const v=d instanceof Error?d.message:"Unknown error";Or("Connection failed: "+v)}}function Or(e){aa.textContent=e,aa.style.display="block"}function mn(){aa.style.display="none"}function Jc(){la.style.display="none"}function fa(e){la.textContent=e,la.style.display="block"}export{Ki as c,af as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as vn}from"./index-C64jxT85.js";var z;(function(f){f[f.QR_CODE=0]="QR_CODE",f[f.AZTEC=1]="AZTEC",f[f.CODABAR=2]="CODABAR",f[f.CODE_39=3]="CODE_39",f[f.CODE_93=4]="CODE_93",f[f.CODE_128=5]="CODE_128",f[f.DATA_MATRIX=6]="DATA_MATRIX",f[f.MAXICODE=7]="MAXICODE",f[f.ITF=8]="ITF",f[f.EAN_13=9]="EAN_13",f[f.EAN_8=10]="EAN_8",f[f.PDF_417=11]="PDF_417",f[f.RSS_14=12]="RSS_14",f[f.RSS_EXPANDED=13]="RSS_EXPANDED",f[f.UPC_A=14]="UPC_A",f[f.UPC_E=15]="UPC_E",f[f.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(z||(z={}));var _r=new Map([[z.QR_CODE,"QR_CODE"],[z.AZTEC,"AZTEC"],[z.CODABAR,"CODABAR"],[z.CODE_39,"CODE_39"],[z.CODE_93,"CODE_93"],[z.CODE_128,"CODE_128"],[z.DATA_MATRIX,"DATA_MATRIX"],[z.MAXICODE,"MAXICODE"],[z.ITF,"ITF"],[z.EAN_13,"EAN_13"],[z.EAN_8,"EAN_8"],[z.PDF_417,"PDF_417"],[z.RSS_14,"RSS_14"],[z.RSS_EXPANDED,"RSS_EXPANDED"],[z.UPC_A,"UPC_A"],[z.UPC_E,"UPC_E"],[z.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),Dr;(function(f){f[f.UNKNOWN=0]="UNKNOWN",f[f.URL=1]="URL"})(Dr||(Dr={}));function _i(f){return Object.values(z).includes(f)}var Vt;(function(f){f[f.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",f[f.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(Vt||(Vt={}));var Et=(function(){function f(){}return f.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",f.SCAN_DEFAULT_FPS=2,f.DEFAULT_DISABLE_FLIP=!1,f.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,f.DEFAULT_SUPPORTED_SCAN_TYPE=[Vt.SCAN_TYPE_CAMERA,Vt.SCAN_TYPE_FILE],f})(),Yr=(function(){function f(u,l){this.format=u,this.formatName=l}return f.prototype.toString=function(){return this.formatName},f.create=function(u){if(!_r.has(u))throw"".concat(u," not in html5QrcodeSupportedFormatsTextMap");return new f(u,_r.get(u))},f})(),Rr=(function(){function f(){}return f.createFromText=function(u){var l={text:u};return{decodedText:u,result:l}},f.createFromQrcodeResult=function(u){return{decodedText:u.text,result:u}},f})(),or;(function(f){f[f.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",f[f.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",f[f.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(or||(or={}));var Xr=(function(){function f(){}return f.createFrom=function(u){return{errorMessage:u,type:or.UNKWOWN_ERROR}},f})(),Zr=(function(){function f(u){this.verbose=u}return f.prototype.log=function(u){this.verbose&&console.log(u)},f.prototype.warn=function(u){this.verbose&&console.warn(u)},f.prototype.logError=function(u,l){(this.verbose||l===!0)&&console.error(u)},f.prototype.logErrors=function(u){if(u.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(u)},f})();function Nt(f){return typeof f>"u"||f===null}function Di(f,u,l){return f>l?l:f<u?u:f}var an=(function(){function f(){}return f.codeParseError=function(u){return"QR code parse error, error = ".concat(u)},f.errorGettingUserMedia=function(u){return"Error getting userMedia, error = ".concat(u)},f.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},f.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},f.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},f.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},f.scannerPaused=function(){return"Scanner paused"},f})(),xe=(function(){function f(){}return f.scanningStatus=function(){return"Scanning"},f.idleStatus=function(){return"Idle"},f.errorStatus=function(){return"Error"},f.permissionStatus=function(){return"Permission"},f.noCameraFoundErrorStatus=function(){return"No Cameras"},f.lastMatch=function(u){return"Last Match: ".concat(u)},f.codeScannerTitle=function(){return"Code Scanner"},f.cameraPermissionTitle=function(){return"Request Camera Permissions"},f.cameraPermissionRequesting=function(){return"Requesting camera permissions..."},f.noCameraFound=function(){return"No camera found"},f.scanButtonStopScanningText=function(){return"Stop Scanning"},f.scanButtonStartScanningText=function(){return"Start Scanning"},f.torchOnButton=function(){return"Switch On Torch"},f.torchOffButton=function(){return"Switch Off Torch"},f.torchOnFailedMessage=function(){return"Failed to turn on torch"},f.torchOffFailedMessage=function(){return"Failed to turn off torch"},f.scanButtonScanningStarting=function(){return"Launching Camera..."},f.textIfCameraScanSelected=function(){return"Scan an Image File"},f.textIfFileScanSelected=function(){return"Scan using camera directly"},f.selectCamera=function(){return"Select Camera"},f.fileSelectionChooseImage=function(){return"Choose Image"},f.fileSelectionChooseAnother=function(){return"Choose Another"},f.fileSelectionNoImageSelected=function(){return"No image choosen"},f.anonymousCameraPrefix=function(){return"Anonymous Camera"},f.dragAndDropMessage=function(){return"Or drop an image to scan"},f.dragAndDropMessageOnlyImages=function(){return"Or drop an image to scan (other files not supported)"},f.zoom=function(){return"zoom"},f.loadingImage=function(){return"Loading image..."},f.cameraScanAltText=function(){return"Camera based scan"},f.fileScanAltText=function(){return"Fule based scan"},f})(),Lr=(function(){function f(){}return f.poweredBy=function(){return"Powered by "},f.reportIssues=function(){return"Report issues"},f})(),Qr=(function(){function f(){}return f.isMediaStreamConstraintsValid=function(u,l){if(typeof u!="object"){var w=typeof u;return l.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(w,"."),!0),!1}for(var E=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],x=new Set(E),T=Object.keys(u),D=0,L=T;D<L.length;D++){var C=L[D];if(x.has(C))return l.logError("".concat(C," is not supported videoConstaints."),!0),!1}return!0},f})(),mn={exports:{}},Ri=mn.exports,Br;function Li(){return Br||(Br=1,(function(f,u){(function(l,w){w(u)})(Ri,(function(l){function w(d){return d==null}var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,e){d.__proto__=e}||function(d,e){for(var t in e)e.hasOwnProperty(t)&&(d[t]=e[t])};function x(d,e){E(d,e);function t(){this.constructor=d}d.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function T(d,e){var t=Object.setPrototypeOf;t?t(d,e):d.__proto__=e}function D(d,e){e===void 0&&(e=d.constructor);var t=Error.captureStackTrace;t&&t(d,e)}var L=(function(d){x(e,d);function e(t){var n=this.constructor,r=d.call(this,t)||this;return Object.defineProperty(r,"name",{value:n.name,enumerable:!1}),T(r,n.prototype),D(r),r}return e})(Error);class C extends L{constructor(e=void 0){super(e),this.message=e}getKind(){return this.constructor.kind}}C.kind="Exception";class _ extends C{}_.kind="ArgumentException";class O extends C{}O.kind="IllegalArgumentException";class ie{constructor(e){if(this.binarizer=e,e===null)throw new O("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(e,t){return this.binarizer.getBlackRow(e,t)}getBlackMatrix(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(e,t,n,r){const i=this.binarizer.getLuminanceSource().crop(e,t,n,r);return new ie(this.binarizer.createBinarizer(i))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new ie(this.binarizer.createBinarizer(e))}rotateCounterClockwise45(){const e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new ie(this.binarizer.createBinarizer(e))}toString(){try{return this.getBlackMatrix().toString()}catch{return""}}}class J extends C{static getChecksumInstance(){return new J}}J.kind="ChecksumException";class Be{constructor(e){this.source=e}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class K{static arraycopy(e,t,n,r,i){for(;i--;)n[r++]=e[t++]}static currentTimeMillis(){return Date.now()}}class Ie extends C{}Ie.kind="IndexOutOfBoundsException";class Ze extends Ie{constructor(e=void 0,t=void 0){super(t),this.index=e,this.message=t}}Ze.kind="ArrayIndexOutOfBoundsException";class le{static fill(e,t){for(let n=0,r=e.length;n<r;n++)e[n]=t}static fillWithin(e,t,n,r){le.rangeCheck(e.length,t,n);for(let i=t;i<n;i++)e[i]=r}static rangeCheck(e,t,n){if(t>n)throw new O("fromIndex("+t+") > toIndex("+n+")");if(t<0)throw new Ze(t);if(n>e)throw new Ze(n)}static asList(...e){return e}static create(e,t,n){return Array.from({length:e}).map(i=>Array.from({length:t}).fill(n))}static createInt32Array(e,t,n){return Array.from({length:e}).map(i=>Int32Array.from({length:t}).fill(n))}static equals(e,t){if(!e||!t||!e.length||!t.length||e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}static hashCode(e){if(e===null)return 0;let t=1;for(const n of e)t=31*t+n;return t}static fillUint8Array(e,t){for(let n=0;n!==e.length;n++)e[n]=t}static copyOf(e,t){return e.slice(0,t)}static copyOfUint8Array(e,t){if(e.length<=t){const n=new Uint8Array(t);return n.set(e),n}return e.slice(0,t)}static copyOfRange(e,t,n){const r=n-t,i=new Int32Array(r);return K.arraycopy(e,t,i,0,r),i}static binarySearch(e,t,n){n===void 0&&(n=le.numberComparator);let r=0,i=e.length-1;for(;r<=i;){const s=i+r>>1,o=n(t,e[s]);if(o>0)r=s+1;else if(o<0)i=s-1;else return s}return-r-1}static numberComparator(e,t){return e-t}}class Q{static numberOfTrailingZeros(e){let t;if(e===0)return 32;let n=31;return t=e<<16,t!==0&&(n-=16,e=t),t=e<<8,t!==0&&(n-=8,e=t),t=e<<4,t!==0&&(n-=4,e=t),t=e<<2,t!==0&&(n-=2,e=t),n-(e<<1>>>31)}static numberOfLeadingZeros(e){if(e===0)return 32;let t=1;return e>>>16||(t+=16,e<<=16),e>>>24||(t+=8,e<<=8),e>>>28||(t+=4,e<<=4),e>>>30||(t+=2,e<<=2),t-=e>>>31,t}static toHexString(e){return e.toString(16)}static toBinaryString(e){return String(parseInt(String(e),2))}static bitCount(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),e=e+(e>>>4)&252645135,e=e+(e>>>8),e=e+(e>>>16),e&63}static truncDivision(e,t){return Math.trunc(e/t)}static parseInt(e,t=void 0){return parseInt(e,t)}}Q.MIN_VALUE_32_BITS=-2147483648,Q.MAX_VALUE=Number.MAX_SAFE_INTEGER;class ce{constructor(e,t){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,t==null?this.bits=ce.makeArray(e):this.bits=t)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(e){if(e>this.bits.length*32){const t=ce.makeArray(e);K.arraycopy(this.bits,0,t,0,this.bits.length),this.bits=t}}get(e){return(this.bits[Math.floor(e/32)]&1<<(e&31))!==0}set(e){this.bits[Math.floor(e/32)]|=1<<(e&31)}flip(e){this.bits[Math.floor(e/32)]^=1<<(e&31)}getNextSet(e){const t=this.size;if(e>=t)return t;const n=this.bits;let r=Math.floor(e/32),i=n[r];i&=~((1<<(e&31))-1);const s=n.length;for(;i===0;){if(++r===s)return t;i=n[r]}const o=r*32+Q.numberOfTrailingZeros(i);return o>t?t:o}getNextUnset(e){const t=this.size;if(e>=t)return t;const n=this.bits;let r=Math.floor(e/32),i=~n[r];i&=~((1<<(e&31))-1);const s=n.length;for(;i===0;){if(++r===s)return t;i=~n[r]}const o=r*32+Q.numberOfTrailingZeros(i);return o>t?t:o}setBulk(e,t){this.bits[Math.floor(e/32)]=t}setRange(e,t){if(t<e||e<0||t>this.size)throw new O;if(t===e)return;t--;const n=Math.floor(e/32),r=Math.floor(t/32),i=this.bits;for(let s=n;s<=r;s++){const o=s>n?0:e&31,c=(2<<(s<r?31:t&31))-(1<<o);i[s]|=c}}clear(){const e=this.bits.length,t=this.bits;for(let n=0;n<e;n++)t[n]=0}isRange(e,t,n){if(t<e||e<0||t>this.size)throw new O;if(t===e)return!0;t--;const r=Math.floor(e/32),i=Math.floor(t/32),s=this.bits;for(let o=r;o<=i;o++){const a=o>r?0:e&31,h=(2<<(o<i?31:t&31))-(1<<a)&4294967295;if((s[o]&h)!==(n?h:0))return!1}return!0}appendBit(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++}appendBits(e,t){if(t<0||t>32)throw new O("Num bits must be between 0 and 32");this.ensureCapacity(this.size+t);for(let n=t;n>0;n--)this.appendBit((e>>n-1&1)===1)}appendBitArray(e){const t=e.size;this.ensureCapacity(this.size+t);for(let n=0;n<t;n++)this.appendBit(e.get(n))}xor(e){if(this.size!==e.size)throw new O("Sizes don't match");const t=this.bits;for(let n=0,r=t.length;n<r;n++)t[n]^=e.bits[n]}toBytes(e,t,n,r){for(let i=0;i<r;i++){let s=0;for(let o=0;o<8;o++)this.get(e)&&(s|=1<<7-o),e++;t[n+i]=s}}getBitArray(){return this.bits}reverse(){const e=new Int32Array(this.bits.length),t=Math.floor((this.size-1)/32),n=t+1,r=this.bits;for(let i=0;i<n;i++){let s=r[i];s=s>>1&1431655765|(s&1431655765)<<1,s=s>>2&858993459|(s&858993459)<<2,s=s>>4&252645135|(s&252645135)<<4,s=s>>8&16711935|(s&16711935)<<8,s=s>>16&65535|(s&65535)<<16,e[t-i]=s}if(this.size!==n*32){const i=n*32-this.size;let s=e[0]>>>i;for(let o=1;o<n;o++){const a=e[o];s|=a<<32-i,e[o-1]=s,s=a>>>i}e[n-1]=s}this.bits=e}static makeArray(e){return new Int32Array(Math.floor((e+31)/32))}equals(e){if(!(e instanceof ce))return!1;const t=e;return this.size===t.size&&le.equals(this.bits,t.bits)}hashCode(){return 31*this.size+le.hashCode(this.bits)}toString(){let e="";for(let t=0,n=this.size;t<n;t++)(t&7)===0&&(e+=" "),e+=this.get(t)?"X":".";return e}clone(){return new ce(this.size,this.bits.slice())}}var _t;(function(d){d[d.OTHER=0]="OTHER",d[d.PURE_BARCODE=1]="PURE_BARCODE",d[d.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",d[d.TRY_HARDER=3]="TRY_HARDER",d[d.CHARACTER_SET=4]="CHARACTER_SET",d[d.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",d[d.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",d[d.ASSUME_GS1=7]="ASSUME_GS1",d[d.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",d[d.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",d[d.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(_t||(_t={}));var we=_t;class U extends C{static getFormatInstance(){return new U}}U.kind="FormatException";var ge;(function(d){d[d.Cp437=0]="Cp437",d[d.ISO8859_1=1]="ISO8859_1",d[d.ISO8859_2=2]="ISO8859_2",d[d.ISO8859_3=3]="ISO8859_3",d[d.ISO8859_4=4]="ISO8859_4",d[d.ISO8859_5=5]="ISO8859_5",d[d.ISO8859_6=6]="ISO8859_6",d[d.ISO8859_7=7]="ISO8859_7",d[d.ISO8859_8=8]="ISO8859_8",d[d.ISO8859_9=9]="ISO8859_9",d[d.ISO8859_10=10]="ISO8859_10",d[d.ISO8859_11=11]="ISO8859_11",d[d.ISO8859_13=12]="ISO8859_13",d[d.ISO8859_14=13]="ISO8859_14",d[d.ISO8859_15=14]="ISO8859_15",d[d.ISO8859_16=15]="ISO8859_16",d[d.SJIS=16]="SJIS",d[d.Cp1250=17]="Cp1250",d[d.Cp1251=18]="Cp1251",d[d.Cp1252=19]="Cp1252",d[d.Cp1256=20]="Cp1256",d[d.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",d[d.UTF8=22]="UTF8",d[d.ASCII=23]="ASCII",d[d.Big5=24]="Big5",d[d.GB18030=25]="GB18030",d[d.EUC_KR=26]="EUC_KR"})(ge||(ge={}));class k{constructor(e,t,n,...r){this.valueIdentifier=e,this.name=n,typeof t=="number"?this.values=Int32Array.from([t]):this.values=t,this.otherEncodingNames=r,k.VALUE_IDENTIFIER_TO_ECI.set(e,this),k.NAME_TO_ECI.set(n,this);const i=this.values;for(let s=0,o=i.length;s!==o;s++){const a=i[s];k.VALUES_TO_ECI.set(a,this)}for(const s of r)k.NAME_TO_ECI.set(s,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(e){if(e<0||e>=900)throw new U("incorect value");const t=k.VALUES_TO_ECI.get(e);if(t===void 0)throw new U("incorect value");return t}static getCharacterSetECIByName(e){const t=k.NAME_TO_ECI.get(e);if(t===void 0)throw new U("incorect value");return t}equals(e){if(!(e instanceof k))return!1;const t=e;return this.getName()===t.getName()}}k.VALUE_IDENTIFIER_TO_ECI=new Map,k.VALUES_TO_ECI=new Map,k.NAME_TO_ECI=new Map,k.Cp437=new k(ge.Cp437,Int32Array.from([0,2]),"Cp437"),k.ISO8859_1=new k(ge.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),k.ISO8859_2=new k(ge.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),k.ISO8859_3=new k(ge.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),k.ISO8859_4=new k(ge.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),k.ISO8859_5=new k(ge.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),k.ISO8859_6=new k(ge.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),k.ISO8859_7=new k(ge.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),k.ISO8859_8=new k(ge.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),k.ISO8859_9=new k(ge.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),k.ISO8859_10=new k(ge.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),k.ISO8859_11=new k(ge.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),k.ISO8859_13=new k(ge.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),k.ISO8859_14=new k(ge.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),k.ISO8859_15=new k(ge.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),k.ISO8859_16=new k(ge.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),k.SJIS=new k(ge.SJIS,20,"SJIS","Shift_JIS"),k.Cp1250=new k(ge.Cp1250,21,"Cp1250","windows-1250"),k.Cp1251=new k(ge.Cp1251,22,"Cp1251","windows-1251"),k.Cp1252=new k(ge.Cp1252,23,"Cp1252","windows-1252"),k.Cp1256=new k(ge.Cp1256,24,"Cp1256","windows-1256"),k.UnicodeBigUnmarked=new k(ge.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),k.UTF8=new k(ge.UTF8,26,"UTF8","UTF-8"),k.ASCII=new k(ge.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),k.Big5=new k(ge.Big5,28,"Big5"),k.GB18030=new k(ge.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),k.EUC_KR=new k(ge.EUC_KR,30,"EUC_KR","EUC-KR");class Qt extends C{}Qt.kind="UnsupportedOperationException";class tt{static decode(e,t){const n=this.encodingName(t);return this.customDecoder?this.customDecoder(e,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(e,n):new TextDecoder(n).decode(e)}static shouldDecodeOnFallback(e){return!tt.isBrowser()&&e==="ISO-8859-1"}static encode(e,t){const n=this.encodingName(t);return this.customEncoder?this.customEncoder(e,n):typeof TextEncoder>"u"?this.encodeFallback(e):new TextEncoder().encode(e)}static isBrowser(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"}static encodingName(e){return typeof e=="string"?e:e.getName()}static encodingCharacterSet(e){return e instanceof k?e:k.getCharacterSetECIByName(e)}static decodeFallback(e,t){const n=this.encodingCharacterSet(t);if(tt.isDecodeFallbackSupported(n)){let r="";for(let i=0,s=e.length;i<s;i++){let o=e[i].toString(16);o.length<2&&(o="0"+o),r+="%"+o}return decodeURIComponent(r)}if(n.equals(k.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new Qt(`Encoding ${this.encodingName(t)} not supported by fallback.`)}static isDecodeFallbackSupported(e){return e.equals(k.UTF8)||e.equals(k.ISO8859_1)||e.equals(k.ASCII)}static encodeFallback(e){const n=btoa(unescape(encodeURIComponent(e))).split(""),r=[];for(let i=0;i<n.length;i++)r.push(n[i].charCodeAt(0));return new Uint8Array(r)}}class q{static castAsNonUtf8Char(e,t=null){const n=t?t.getName():this.ISO88591;return tt.decode(new Uint8Array([e]),n)}static guessEncoding(e,t){if(t!=null&&t.get(we.CHARACTER_SET)!==void 0)return t.get(we.CHARACTER_SET).toString();const n=e.length;let r=!0,i=!0,s=!0,o=0,a=0,c=0,h=0,g=0,A=0,m=0,I=0,S=0,y=0,M=0;const P=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191;for(let F=0;F<n&&(r||i||s);F++){const v=e[F]&255;s&&(o>0?(v&128)===0?s=!1:o--:(v&128)!==0&&((v&64)===0?s=!1:(o++,(v&32)===0?a++:(o++,(v&16)===0?c++:(o++,(v&8)===0?h++:s=!1))))),r&&(v>127&&v<160?r=!1:v>159&&(v<192||v===215||v===247)&&M++),i&&(g>0?v<64||v===127||v>252?i=!1:g--:v===128||v===160||v>239?i=!1:v>160&&v<224?(A++,I=0,m++,m>S&&(S=m)):v>127?(g++,m=0,I++,I>y&&(y=I)):(m=0,I=0))}return s&&o>0&&(s=!1),i&&g>0&&(i=!1),s&&(P||a+c+h>0)?q.UTF8:i&&(q.ASSUME_SHIFT_JIS||S>=3||y>=3)?q.SHIFT_JIS:r&&i?S===2&&A===2||M*10>=n?q.SHIFT_JIS:q.ISO88591:r?q.ISO88591:i?q.SHIFT_JIS:s?q.UTF8:q.PLATFORM_DEFAULT_ENCODING}static format(e,...t){let n=-1;function r(s,o,a,c,h,g){if(s==="%%")return"%";if(t[++n]===void 0)return;s=c?parseInt(c.substr(1)):void 0;let A=h?parseInt(h.substr(1)):void 0,m;switch(g){case"s":m=t[n];break;case"c":m=t[n][0];break;case"f":m=parseFloat(t[n]).toFixed(s);break;case"p":m=parseFloat(t[n]).toPrecision(s);break;case"e":m=parseFloat(t[n]).toExponential(s);break;case"x":m=parseInt(t[n]).toString(A||16);break;case"d":m=parseFloat(parseInt(t[n],A||10).toPrecision(s)).toFixed(0);break}m=typeof m=="object"?JSON.stringify(m):(+m).toString(A);let I=parseInt(a),S=a&&a[0]+""=="0"?"0":" ";for(;m.length<I;)m=o!==void 0?m+S:S+m;return m}let i=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(i,r)}static getBytes(e,t){return tt.encode(e,t)}static getCharCode(e,t=0){return e.charCodeAt(t)}static getCharAt(e){return String.fromCharCode(e)}}q.SHIFT_JIS=k.SJIS.getName(),q.GB2312="GB2312",q.ISO88591=k.ISO8859_1.getName(),q.EUC_JP="EUC_JP",q.UTF8=k.UTF8.getName(),q.PLATFORM_DEFAULT_ENCODING=q.UTF8,q.ASSUME_SHIFT_JIS=!1;class Ae{constructor(e=""){this.value=e}enableDecoding(e){return this.encoding=e,this}append(e){return typeof e=="string"?this.value+=e.toString():this.encoding?this.value+=q.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this}appendChars(e,t,n){for(let r=t;t<t+n;r++)this.append(e[r]);return this}length(){return this.value.length}charAt(e){return this.value.charAt(e)}deleteCharAt(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)}setCharAt(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+1)}substring(e,t){return this.value.substring(e,t)}setLengthToZero(){this.value=""}toString(){return this.value}insert(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+t.length)}}class Ue{constructor(e,t,n,r){if(this.width=e,this.height=t,this.rowSize=n,this.bits=r,t==null&&(t=e),this.height=t,e<1||t<1)throw new O("Both dimensions must be greater than 0");n==null&&(n=Math.floor((e+31)/32)),this.rowSize=n,r==null&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(e){const t=e.length,n=e[0].length,r=new Ue(n,t);for(let i=0;i<t;i++){const s=e[i];for(let o=0;o<n;o++)s[o]&&r.set(o,i)}return r}static parseFromString(e,t,n){if(e===null)throw new O("stringRepresentation cannot be null");const r=new Array(e.length);let i=0,s=0,o=-1,a=0,c=0;for(;c<e.length;)if(e.charAt(c)===`
|
|
1
|
+
import{c as vn}from"./index-BIIt6Ahm.js";var z;(function(f){f[f.QR_CODE=0]="QR_CODE",f[f.AZTEC=1]="AZTEC",f[f.CODABAR=2]="CODABAR",f[f.CODE_39=3]="CODE_39",f[f.CODE_93=4]="CODE_93",f[f.CODE_128=5]="CODE_128",f[f.DATA_MATRIX=6]="DATA_MATRIX",f[f.MAXICODE=7]="MAXICODE",f[f.ITF=8]="ITF",f[f.EAN_13=9]="EAN_13",f[f.EAN_8=10]="EAN_8",f[f.PDF_417=11]="PDF_417",f[f.RSS_14=12]="RSS_14",f[f.RSS_EXPANDED=13]="RSS_EXPANDED",f[f.UPC_A=14]="UPC_A",f[f.UPC_E=15]="UPC_E",f[f.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(z||(z={}));var _r=new Map([[z.QR_CODE,"QR_CODE"],[z.AZTEC,"AZTEC"],[z.CODABAR,"CODABAR"],[z.CODE_39,"CODE_39"],[z.CODE_93,"CODE_93"],[z.CODE_128,"CODE_128"],[z.DATA_MATRIX,"DATA_MATRIX"],[z.MAXICODE,"MAXICODE"],[z.ITF,"ITF"],[z.EAN_13,"EAN_13"],[z.EAN_8,"EAN_8"],[z.PDF_417,"PDF_417"],[z.RSS_14,"RSS_14"],[z.RSS_EXPANDED,"RSS_EXPANDED"],[z.UPC_A,"UPC_A"],[z.UPC_E,"UPC_E"],[z.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),Dr;(function(f){f[f.UNKNOWN=0]="UNKNOWN",f[f.URL=1]="URL"})(Dr||(Dr={}));function _i(f){return Object.values(z).includes(f)}var Vt;(function(f){f[f.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",f[f.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(Vt||(Vt={}));var Et=(function(){function f(){}return f.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",f.SCAN_DEFAULT_FPS=2,f.DEFAULT_DISABLE_FLIP=!1,f.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,f.DEFAULT_SUPPORTED_SCAN_TYPE=[Vt.SCAN_TYPE_CAMERA,Vt.SCAN_TYPE_FILE],f})(),Yr=(function(){function f(u,l){this.format=u,this.formatName=l}return f.prototype.toString=function(){return this.formatName},f.create=function(u){if(!_r.has(u))throw"".concat(u," not in html5QrcodeSupportedFormatsTextMap");return new f(u,_r.get(u))},f})(),Rr=(function(){function f(){}return f.createFromText=function(u){var l={text:u};return{decodedText:u,result:l}},f.createFromQrcodeResult=function(u){return{decodedText:u.text,result:u}},f})(),or;(function(f){f[f.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",f[f.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",f[f.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(or||(or={}));var Xr=(function(){function f(){}return f.createFrom=function(u){return{errorMessage:u,type:or.UNKWOWN_ERROR}},f})(),Zr=(function(){function f(u){this.verbose=u}return f.prototype.log=function(u){this.verbose&&console.log(u)},f.prototype.warn=function(u){this.verbose&&console.warn(u)},f.prototype.logError=function(u,l){(this.verbose||l===!0)&&console.error(u)},f.prototype.logErrors=function(u){if(u.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(u)},f})();function Nt(f){return typeof f>"u"||f===null}function Di(f,u,l){return f>l?l:f<u?u:f}var an=(function(){function f(){}return f.codeParseError=function(u){return"QR code parse error, error = ".concat(u)},f.errorGettingUserMedia=function(u){return"Error getting userMedia, error = ".concat(u)},f.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},f.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},f.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},f.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},f.scannerPaused=function(){return"Scanner paused"},f})(),xe=(function(){function f(){}return f.scanningStatus=function(){return"Scanning"},f.idleStatus=function(){return"Idle"},f.errorStatus=function(){return"Error"},f.permissionStatus=function(){return"Permission"},f.noCameraFoundErrorStatus=function(){return"No Cameras"},f.lastMatch=function(u){return"Last Match: ".concat(u)},f.codeScannerTitle=function(){return"Code Scanner"},f.cameraPermissionTitle=function(){return"Request Camera Permissions"},f.cameraPermissionRequesting=function(){return"Requesting camera permissions..."},f.noCameraFound=function(){return"No camera found"},f.scanButtonStopScanningText=function(){return"Stop Scanning"},f.scanButtonStartScanningText=function(){return"Start Scanning"},f.torchOnButton=function(){return"Switch On Torch"},f.torchOffButton=function(){return"Switch Off Torch"},f.torchOnFailedMessage=function(){return"Failed to turn on torch"},f.torchOffFailedMessage=function(){return"Failed to turn off torch"},f.scanButtonScanningStarting=function(){return"Launching Camera..."},f.textIfCameraScanSelected=function(){return"Scan an Image File"},f.textIfFileScanSelected=function(){return"Scan using camera directly"},f.selectCamera=function(){return"Select Camera"},f.fileSelectionChooseImage=function(){return"Choose Image"},f.fileSelectionChooseAnother=function(){return"Choose Another"},f.fileSelectionNoImageSelected=function(){return"No image choosen"},f.anonymousCameraPrefix=function(){return"Anonymous Camera"},f.dragAndDropMessage=function(){return"Or drop an image to scan"},f.dragAndDropMessageOnlyImages=function(){return"Or drop an image to scan (other files not supported)"},f.zoom=function(){return"zoom"},f.loadingImage=function(){return"Loading image..."},f.cameraScanAltText=function(){return"Camera based scan"},f.fileScanAltText=function(){return"Fule based scan"},f})(),Lr=(function(){function f(){}return f.poweredBy=function(){return"Powered by "},f.reportIssues=function(){return"Report issues"},f})(),Qr=(function(){function f(){}return f.isMediaStreamConstraintsValid=function(u,l){if(typeof u!="object"){var w=typeof u;return l.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(w,"."),!0),!1}for(var E=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],x=new Set(E),T=Object.keys(u),D=0,L=T;D<L.length;D++){var C=L[D];if(x.has(C))return l.logError("".concat(C," is not supported videoConstaints."),!0),!1}return!0},f})(),mn={exports:{}},Ri=mn.exports,Br;function Li(){return Br||(Br=1,(function(f,u){(function(l,w){w(u)})(Ri,(function(l){function w(d){return d==null}var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,e){d.__proto__=e}||function(d,e){for(var t in e)e.hasOwnProperty(t)&&(d[t]=e[t])};function x(d,e){E(d,e);function t(){this.constructor=d}d.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function T(d,e){var t=Object.setPrototypeOf;t?t(d,e):d.__proto__=e}function D(d,e){e===void 0&&(e=d.constructor);var t=Error.captureStackTrace;t&&t(d,e)}var L=(function(d){x(e,d);function e(t){var n=this.constructor,r=d.call(this,t)||this;return Object.defineProperty(r,"name",{value:n.name,enumerable:!1}),T(r,n.prototype),D(r),r}return e})(Error);class C extends L{constructor(e=void 0){super(e),this.message=e}getKind(){return this.constructor.kind}}C.kind="Exception";class _ extends C{}_.kind="ArgumentException";class O extends C{}O.kind="IllegalArgumentException";class ie{constructor(e){if(this.binarizer=e,e===null)throw new O("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(e,t){return this.binarizer.getBlackRow(e,t)}getBlackMatrix(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(e,t,n,r){const i=this.binarizer.getLuminanceSource().crop(e,t,n,r);return new ie(this.binarizer.createBinarizer(i))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new ie(this.binarizer.createBinarizer(e))}rotateCounterClockwise45(){const e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new ie(this.binarizer.createBinarizer(e))}toString(){try{return this.getBlackMatrix().toString()}catch{return""}}}class J extends C{static getChecksumInstance(){return new J}}J.kind="ChecksumException";class Be{constructor(e){this.source=e}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class K{static arraycopy(e,t,n,r,i){for(;i--;)n[r++]=e[t++]}static currentTimeMillis(){return Date.now()}}class Ie extends C{}Ie.kind="IndexOutOfBoundsException";class Ze extends Ie{constructor(e=void 0,t=void 0){super(t),this.index=e,this.message=t}}Ze.kind="ArrayIndexOutOfBoundsException";class le{static fill(e,t){for(let n=0,r=e.length;n<r;n++)e[n]=t}static fillWithin(e,t,n,r){le.rangeCheck(e.length,t,n);for(let i=t;i<n;i++)e[i]=r}static rangeCheck(e,t,n){if(t>n)throw new O("fromIndex("+t+") > toIndex("+n+")");if(t<0)throw new Ze(t);if(n>e)throw new Ze(n)}static asList(...e){return e}static create(e,t,n){return Array.from({length:e}).map(i=>Array.from({length:t}).fill(n))}static createInt32Array(e,t,n){return Array.from({length:e}).map(i=>Int32Array.from({length:t}).fill(n))}static equals(e,t){if(!e||!t||!e.length||!t.length||e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}static hashCode(e){if(e===null)return 0;let t=1;for(const n of e)t=31*t+n;return t}static fillUint8Array(e,t){for(let n=0;n!==e.length;n++)e[n]=t}static copyOf(e,t){return e.slice(0,t)}static copyOfUint8Array(e,t){if(e.length<=t){const n=new Uint8Array(t);return n.set(e),n}return e.slice(0,t)}static copyOfRange(e,t,n){const r=n-t,i=new Int32Array(r);return K.arraycopy(e,t,i,0,r),i}static binarySearch(e,t,n){n===void 0&&(n=le.numberComparator);let r=0,i=e.length-1;for(;r<=i;){const s=i+r>>1,o=n(t,e[s]);if(o>0)r=s+1;else if(o<0)i=s-1;else return s}return-r-1}static numberComparator(e,t){return e-t}}class Q{static numberOfTrailingZeros(e){let t;if(e===0)return 32;let n=31;return t=e<<16,t!==0&&(n-=16,e=t),t=e<<8,t!==0&&(n-=8,e=t),t=e<<4,t!==0&&(n-=4,e=t),t=e<<2,t!==0&&(n-=2,e=t),n-(e<<1>>>31)}static numberOfLeadingZeros(e){if(e===0)return 32;let t=1;return e>>>16||(t+=16,e<<=16),e>>>24||(t+=8,e<<=8),e>>>28||(t+=4,e<<=4),e>>>30||(t+=2,e<<=2),t-=e>>>31,t}static toHexString(e){return e.toString(16)}static toBinaryString(e){return String(parseInt(String(e),2))}static bitCount(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),e=e+(e>>>4)&252645135,e=e+(e>>>8),e=e+(e>>>16),e&63}static truncDivision(e,t){return Math.trunc(e/t)}static parseInt(e,t=void 0){return parseInt(e,t)}}Q.MIN_VALUE_32_BITS=-2147483648,Q.MAX_VALUE=Number.MAX_SAFE_INTEGER;class ce{constructor(e,t){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,t==null?this.bits=ce.makeArray(e):this.bits=t)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(e){if(e>this.bits.length*32){const t=ce.makeArray(e);K.arraycopy(this.bits,0,t,0,this.bits.length),this.bits=t}}get(e){return(this.bits[Math.floor(e/32)]&1<<(e&31))!==0}set(e){this.bits[Math.floor(e/32)]|=1<<(e&31)}flip(e){this.bits[Math.floor(e/32)]^=1<<(e&31)}getNextSet(e){const t=this.size;if(e>=t)return t;const n=this.bits;let r=Math.floor(e/32),i=n[r];i&=~((1<<(e&31))-1);const s=n.length;for(;i===0;){if(++r===s)return t;i=n[r]}const o=r*32+Q.numberOfTrailingZeros(i);return o>t?t:o}getNextUnset(e){const t=this.size;if(e>=t)return t;const n=this.bits;let r=Math.floor(e/32),i=~n[r];i&=~((1<<(e&31))-1);const s=n.length;for(;i===0;){if(++r===s)return t;i=~n[r]}const o=r*32+Q.numberOfTrailingZeros(i);return o>t?t:o}setBulk(e,t){this.bits[Math.floor(e/32)]=t}setRange(e,t){if(t<e||e<0||t>this.size)throw new O;if(t===e)return;t--;const n=Math.floor(e/32),r=Math.floor(t/32),i=this.bits;for(let s=n;s<=r;s++){const o=s>n?0:e&31,c=(2<<(s<r?31:t&31))-(1<<o);i[s]|=c}}clear(){const e=this.bits.length,t=this.bits;for(let n=0;n<e;n++)t[n]=0}isRange(e,t,n){if(t<e||e<0||t>this.size)throw new O;if(t===e)return!0;t--;const r=Math.floor(e/32),i=Math.floor(t/32),s=this.bits;for(let o=r;o<=i;o++){const a=o>r?0:e&31,h=(2<<(o<i?31:t&31))-(1<<a)&4294967295;if((s[o]&h)!==(n?h:0))return!1}return!0}appendBit(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++}appendBits(e,t){if(t<0||t>32)throw new O("Num bits must be between 0 and 32");this.ensureCapacity(this.size+t);for(let n=t;n>0;n--)this.appendBit((e>>n-1&1)===1)}appendBitArray(e){const t=e.size;this.ensureCapacity(this.size+t);for(let n=0;n<t;n++)this.appendBit(e.get(n))}xor(e){if(this.size!==e.size)throw new O("Sizes don't match");const t=this.bits;for(let n=0,r=t.length;n<r;n++)t[n]^=e.bits[n]}toBytes(e,t,n,r){for(let i=0;i<r;i++){let s=0;for(let o=0;o<8;o++)this.get(e)&&(s|=1<<7-o),e++;t[n+i]=s}}getBitArray(){return this.bits}reverse(){const e=new Int32Array(this.bits.length),t=Math.floor((this.size-1)/32),n=t+1,r=this.bits;for(let i=0;i<n;i++){let s=r[i];s=s>>1&1431655765|(s&1431655765)<<1,s=s>>2&858993459|(s&858993459)<<2,s=s>>4&252645135|(s&252645135)<<4,s=s>>8&16711935|(s&16711935)<<8,s=s>>16&65535|(s&65535)<<16,e[t-i]=s}if(this.size!==n*32){const i=n*32-this.size;let s=e[0]>>>i;for(let o=1;o<n;o++){const a=e[o];s|=a<<32-i,e[o-1]=s,s=a>>>i}e[n-1]=s}this.bits=e}static makeArray(e){return new Int32Array(Math.floor((e+31)/32))}equals(e){if(!(e instanceof ce))return!1;const t=e;return this.size===t.size&&le.equals(this.bits,t.bits)}hashCode(){return 31*this.size+le.hashCode(this.bits)}toString(){let e="";for(let t=0,n=this.size;t<n;t++)(t&7)===0&&(e+=" "),e+=this.get(t)?"X":".";return e}clone(){return new ce(this.size,this.bits.slice())}}var _t;(function(d){d[d.OTHER=0]="OTHER",d[d.PURE_BARCODE=1]="PURE_BARCODE",d[d.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",d[d.TRY_HARDER=3]="TRY_HARDER",d[d.CHARACTER_SET=4]="CHARACTER_SET",d[d.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",d[d.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",d[d.ASSUME_GS1=7]="ASSUME_GS1",d[d.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",d[d.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",d[d.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(_t||(_t={}));var we=_t;class U extends C{static getFormatInstance(){return new U}}U.kind="FormatException";var ge;(function(d){d[d.Cp437=0]="Cp437",d[d.ISO8859_1=1]="ISO8859_1",d[d.ISO8859_2=2]="ISO8859_2",d[d.ISO8859_3=3]="ISO8859_3",d[d.ISO8859_4=4]="ISO8859_4",d[d.ISO8859_5=5]="ISO8859_5",d[d.ISO8859_6=6]="ISO8859_6",d[d.ISO8859_7=7]="ISO8859_7",d[d.ISO8859_8=8]="ISO8859_8",d[d.ISO8859_9=9]="ISO8859_9",d[d.ISO8859_10=10]="ISO8859_10",d[d.ISO8859_11=11]="ISO8859_11",d[d.ISO8859_13=12]="ISO8859_13",d[d.ISO8859_14=13]="ISO8859_14",d[d.ISO8859_15=14]="ISO8859_15",d[d.ISO8859_16=15]="ISO8859_16",d[d.SJIS=16]="SJIS",d[d.Cp1250=17]="Cp1250",d[d.Cp1251=18]="Cp1251",d[d.Cp1252=19]="Cp1252",d[d.Cp1256=20]="Cp1256",d[d.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",d[d.UTF8=22]="UTF8",d[d.ASCII=23]="ASCII",d[d.Big5=24]="Big5",d[d.GB18030=25]="GB18030",d[d.EUC_KR=26]="EUC_KR"})(ge||(ge={}));class k{constructor(e,t,n,...r){this.valueIdentifier=e,this.name=n,typeof t=="number"?this.values=Int32Array.from([t]):this.values=t,this.otherEncodingNames=r,k.VALUE_IDENTIFIER_TO_ECI.set(e,this),k.NAME_TO_ECI.set(n,this);const i=this.values;for(let s=0,o=i.length;s!==o;s++){const a=i[s];k.VALUES_TO_ECI.set(a,this)}for(const s of r)k.NAME_TO_ECI.set(s,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(e){if(e<0||e>=900)throw new U("incorect value");const t=k.VALUES_TO_ECI.get(e);if(t===void 0)throw new U("incorect value");return t}static getCharacterSetECIByName(e){const t=k.NAME_TO_ECI.get(e);if(t===void 0)throw new U("incorect value");return t}equals(e){if(!(e instanceof k))return!1;const t=e;return this.getName()===t.getName()}}k.VALUE_IDENTIFIER_TO_ECI=new Map,k.VALUES_TO_ECI=new Map,k.NAME_TO_ECI=new Map,k.Cp437=new k(ge.Cp437,Int32Array.from([0,2]),"Cp437"),k.ISO8859_1=new k(ge.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),k.ISO8859_2=new k(ge.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),k.ISO8859_3=new k(ge.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),k.ISO8859_4=new k(ge.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),k.ISO8859_5=new k(ge.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),k.ISO8859_6=new k(ge.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),k.ISO8859_7=new k(ge.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),k.ISO8859_8=new k(ge.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),k.ISO8859_9=new k(ge.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),k.ISO8859_10=new k(ge.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),k.ISO8859_11=new k(ge.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),k.ISO8859_13=new k(ge.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),k.ISO8859_14=new k(ge.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),k.ISO8859_15=new k(ge.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),k.ISO8859_16=new k(ge.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),k.SJIS=new k(ge.SJIS,20,"SJIS","Shift_JIS"),k.Cp1250=new k(ge.Cp1250,21,"Cp1250","windows-1250"),k.Cp1251=new k(ge.Cp1251,22,"Cp1251","windows-1251"),k.Cp1252=new k(ge.Cp1252,23,"Cp1252","windows-1252"),k.Cp1256=new k(ge.Cp1256,24,"Cp1256","windows-1256"),k.UnicodeBigUnmarked=new k(ge.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),k.UTF8=new k(ge.UTF8,26,"UTF8","UTF-8"),k.ASCII=new k(ge.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),k.Big5=new k(ge.Big5,28,"Big5"),k.GB18030=new k(ge.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),k.EUC_KR=new k(ge.EUC_KR,30,"EUC_KR","EUC-KR");class Qt extends C{}Qt.kind="UnsupportedOperationException";class tt{static decode(e,t){const n=this.encodingName(t);return this.customDecoder?this.customDecoder(e,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(e,n):new TextDecoder(n).decode(e)}static shouldDecodeOnFallback(e){return!tt.isBrowser()&&e==="ISO-8859-1"}static encode(e,t){const n=this.encodingName(t);return this.customEncoder?this.customEncoder(e,n):typeof TextEncoder>"u"?this.encodeFallback(e):new TextEncoder().encode(e)}static isBrowser(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"}static encodingName(e){return typeof e=="string"?e:e.getName()}static encodingCharacterSet(e){return e instanceof k?e:k.getCharacterSetECIByName(e)}static decodeFallback(e,t){const n=this.encodingCharacterSet(t);if(tt.isDecodeFallbackSupported(n)){let r="";for(let i=0,s=e.length;i<s;i++){let o=e[i].toString(16);o.length<2&&(o="0"+o),r+="%"+o}return decodeURIComponent(r)}if(n.equals(k.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new Qt(`Encoding ${this.encodingName(t)} not supported by fallback.`)}static isDecodeFallbackSupported(e){return e.equals(k.UTF8)||e.equals(k.ISO8859_1)||e.equals(k.ASCII)}static encodeFallback(e){const n=btoa(unescape(encodeURIComponent(e))).split(""),r=[];for(let i=0;i<n.length;i++)r.push(n[i].charCodeAt(0));return new Uint8Array(r)}}class q{static castAsNonUtf8Char(e,t=null){const n=t?t.getName():this.ISO88591;return tt.decode(new Uint8Array([e]),n)}static guessEncoding(e,t){if(t!=null&&t.get(we.CHARACTER_SET)!==void 0)return t.get(we.CHARACTER_SET).toString();const n=e.length;let r=!0,i=!0,s=!0,o=0,a=0,c=0,h=0,g=0,A=0,m=0,I=0,S=0,y=0,M=0;const P=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191;for(let F=0;F<n&&(r||i||s);F++){const v=e[F]&255;s&&(o>0?(v&128)===0?s=!1:o--:(v&128)!==0&&((v&64)===0?s=!1:(o++,(v&32)===0?a++:(o++,(v&16)===0?c++:(o++,(v&8)===0?h++:s=!1))))),r&&(v>127&&v<160?r=!1:v>159&&(v<192||v===215||v===247)&&M++),i&&(g>0?v<64||v===127||v>252?i=!1:g--:v===128||v===160||v>239?i=!1:v>160&&v<224?(A++,I=0,m++,m>S&&(S=m)):v>127?(g++,m=0,I++,I>y&&(y=I)):(m=0,I=0))}return s&&o>0&&(s=!1),i&&g>0&&(i=!1),s&&(P||a+c+h>0)?q.UTF8:i&&(q.ASSUME_SHIFT_JIS||S>=3||y>=3)?q.SHIFT_JIS:r&&i?S===2&&A===2||M*10>=n?q.SHIFT_JIS:q.ISO88591:r?q.ISO88591:i?q.SHIFT_JIS:s?q.UTF8:q.PLATFORM_DEFAULT_ENCODING}static format(e,...t){let n=-1;function r(s,o,a,c,h,g){if(s==="%%")return"%";if(t[++n]===void 0)return;s=c?parseInt(c.substr(1)):void 0;let A=h?parseInt(h.substr(1)):void 0,m;switch(g){case"s":m=t[n];break;case"c":m=t[n][0];break;case"f":m=parseFloat(t[n]).toFixed(s);break;case"p":m=parseFloat(t[n]).toPrecision(s);break;case"e":m=parseFloat(t[n]).toExponential(s);break;case"x":m=parseInt(t[n]).toString(A||16);break;case"d":m=parseFloat(parseInt(t[n],A||10).toPrecision(s)).toFixed(0);break}m=typeof m=="object"?JSON.stringify(m):(+m).toString(A);let I=parseInt(a),S=a&&a[0]+""=="0"?"0":" ";for(;m.length<I;)m=o!==void 0?m+S:S+m;return m}let i=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(i,r)}static getBytes(e,t){return tt.encode(e,t)}static getCharCode(e,t=0){return e.charCodeAt(t)}static getCharAt(e){return String.fromCharCode(e)}}q.SHIFT_JIS=k.SJIS.getName(),q.GB2312="GB2312",q.ISO88591=k.ISO8859_1.getName(),q.EUC_JP="EUC_JP",q.UTF8=k.UTF8.getName(),q.PLATFORM_DEFAULT_ENCODING=q.UTF8,q.ASSUME_SHIFT_JIS=!1;class Ae{constructor(e=""){this.value=e}enableDecoding(e){return this.encoding=e,this}append(e){return typeof e=="string"?this.value+=e.toString():this.encoding?this.value+=q.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this}appendChars(e,t,n){for(let r=t;t<t+n;r++)this.append(e[r]);return this}length(){return this.value.length}charAt(e){return this.value.charAt(e)}deleteCharAt(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)}setCharAt(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+1)}substring(e,t){return this.value.substring(e,t)}setLengthToZero(){this.value=""}toString(){return this.value}insert(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+t.length)}}class Ue{constructor(e,t,n,r){if(this.width=e,this.height=t,this.rowSize=n,this.bits=r,t==null&&(t=e),this.height=t,e<1||t<1)throw new O("Both dimensions must be greater than 0");n==null&&(n=Math.floor((e+31)/32)),this.rowSize=n,r==null&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(e){const t=e.length,n=e[0].length,r=new Ue(n,t);for(let i=0;i<t;i++){const s=e[i];for(let o=0;o<n;o++)s[o]&&r.set(o,i)}return r}static parseFromString(e,t,n){if(e===null)throw new O("stringRepresentation cannot be null");const r=new Array(e.length);let i=0,s=0,o=-1,a=0,c=0;for(;c<e.length;)if(e.charAt(c)===`
|
|
2
2
|
`||e.charAt(c)==="\r"){if(i>s){if(o===-1)o=i-s;else if(i-s!==o)throw new O("row lengths do not match");s=i,a++}c++}else if(e.substring(c,c+t.length)===t)c+=t.length,r[i]=!0,i++;else if(e.substring(c,c+n.length)===n)c+=n.length,r[i]=!1,i++;else throw new O("illegal character encountered: "+e.substring(c));if(i>s){if(o===-1)o=i-s;else if(i-s!==o)throw new O("row lengths do not match");a++}const h=new Ue(o,a);for(let g=0;g<i;g++)r[g]&&h.set(Math.floor(g%o),Math.floor(g/o));return h}get(e,t){const n=t*this.rowSize+Math.floor(e/32);return(this.bits[n]>>>(e&31)&1)!==0}set(e,t){const n=t*this.rowSize+Math.floor(e/32);this.bits[n]|=1<<(e&31)&4294967295}unset(e,t){const n=t*this.rowSize+Math.floor(e/32);this.bits[n]&=~(1<<(e&31)&4294967295)}flip(e,t){const n=t*this.rowSize+Math.floor(e/32);this.bits[n]^=1<<(e&31)&4294967295}xor(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new O("input matrix dimensions do not match");const t=new ce(Math.floor(this.width/32)+1),n=this.rowSize,r=this.bits;for(let i=0,s=this.height;i<s;i++){const o=i*n,a=e.getRow(i,t).getBitArray();for(let c=0;c<n;c++)r[o+c]^=a[c]}}clear(){const e=this.bits,t=e.length;for(let n=0;n<t;n++)e[n]=0}setRegion(e,t,n,r){if(t<0||e<0)throw new O("Left and top must be nonnegative");if(r<1||n<1)throw new O("Height and width must be at least 1");const i=e+n,s=t+r;if(s>this.height||i>this.width)throw new O("The region must fit inside the matrix");const o=this.rowSize,a=this.bits;for(let c=t;c<s;c++){const h=c*o;for(let g=e;g<i;g++)a[h+Math.floor(g/32)]|=1<<(g&31)&4294967295}}getRow(e,t){t==null||t.getSize()<this.width?t=new ce(this.width):t.clear();const n=this.rowSize,r=this.bits,i=e*n;for(let s=0;s<n;s++)t.setBulk(s*32,r[i+s]);return t}setRow(e,t){K.arraycopy(t.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)}rotate180(){const e=this.getWidth(),t=this.getHeight();let n=new ce(e),r=new ce(e);for(let i=0,s=Math.floor((t+1)/2);i<s;i++)n=this.getRow(i,n),r=this.getRow(t-1-i,r),n.reverse(),r.reverse(),this.setRow(i,r),this.setRow(t-1-i,n)}getEnclosingRectangle(){const e=this.width,t=this.height,n=this.rowSize,r=this.bits;let i=e,s=t,o=-1,a=-1;for(let c=0;c<t;c++)for(let h=0;h<n;h++){const g=r[c*n+h];if(g!==0){if(c<s&&(s=c),c>a&&(a=c),h*32<i){let A=0;for(;(g<<31-A&4294967295)===0;)A++;h*32+A<i&&(i=h*32+A)}if(h*32+31>o){let A=31;for(;!(g>>>A);)A--;h*32+A>o&&(o=h*32+A)}}}return o<i||a<s?null:Int32Array.from([i,s,o-i+1,a-s+1])}getTopLeftOnBit(){const e=this.rowSize,t=this.bits;let n=0;for(;n<t.length&&t[n]===0;)n++;if(n===t.length)return null;const r=n/e;let i=n%e*32;const s=t[n];let o=0;for(;(s<<31-o&4294967295)===0;)o++;return i+=o,Int32Array.from([i,r])}getBottomRightOnBit(){const e=this.rowSize,t=this.bits;let n=t.length-1;for(;n>=0&&t[n]===0;)n--;if(n<0)return null;const r=Math.floor(n/e);let i=Math.floor(n%e)*32;const s=t[n];let o=31;for(;!(s>>>o);)o--;return i+=o,Int32Array.from([i,r])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(e){if(!(e instanceof Ue))return!1;const t=e;return this.width===t.width&&this.height===t.height&&this.rowSize===t.rowSize&&le.equals(this.bits,t.bits)}hashCode(){let e=this.width;return e=31*e+this.width,e=31*e+this.height,e=31*e+this.rowSize,e=31*e+le.hashCode(this.bits),e}toString(e="X ",t=" ",n=`
|
|
3
3
|
`){return this.buildToString(e,t,n)}buildToString(e,t,n){let r=new Ae;for(let i=0,s=this.height;i<s;i++){for(let o=0,a=this.width;o<a;o++)r.append(this.get(o,i)?e:t);r.append(n)}return r.toString()}clone(){return new Ue(this.width,this.height,this.rowSize,this.bits.slice())}}class R extends C{static getNotFoundInstance(){return new R}}R.kind="NotFoundException";class He extends Be{constructor(e){super(e),this.luminances=He.EMPTY,this.buckets=new Int32Array(He.LUMINANCE_BUCKETS)}getBlackRow(e,t){const n=this.getLuminanceSource(),r=n.getWidth();t==null||t.getSize()<r?t=new ce(r):t.clear(),this.initArrays(r);const i=n.getRow(e,this.luminances),s=this.buckets;for(let a=0;a<r;a++)s[(i[a]&255)>>He.LUMINANCE_SHIFT]++;const o=He.estimateBlackPoint(s);if(r<3)for(let a=0;a<r;a++)(i[a]&255)<o&&t.set(a);else{let a=i[0]&255,c=i[1]&255;for(let h=1;h<r-1;h++){const g=i[h+1]&255;(c*4-a-g)/2<o&&t.set(h),a=c,c=g}}return t}getBlackMatrix(){const e=this.getLuminanceSource(),t=e.getWidth(),n=e.getHeight(),r=new Ue(t,n);this.initArrays(t);const i=this.buckets;for(let a=1;a<5;a++){const c=Math.floor(n*a/5),h=e.getRow(c,this.luminances),g=Math.floor(t*4/5);for(let A=Math.floor(t/5);A<g;A++){const m=h[A]&255;i[m>>He.LUMINANCE_SHIFT]++}}const s=He.estimateBlackPoint(i),o=e.getMatrix();for(let a=0;a<n;a++){const c=a*t;for(let h=0;h<t;h++)(o[c+h]&255)<s&&r.set(h,a)}return r}createBinarizer(e){return new He(e)}initArrays(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e));const t=this.buckets;for(let n=0;n<He.LUMINANCE_BUCKETS;n++)t[n]=0}static estimateBlackPoint(e){const t=e.length;let n=0,r=0,i=0;for(let h=0;h<t;h++)e[h]>i&&(r=h,i=e[h]),e[h]>n&&(n=e[h]);let s=0,o=0;for(let h=0;h<t;h++){const g=h-r,A=e[h]*g*g;A>o&&(s=h,o=A)}if(r>s){const h=r;r=s,s=h}if(s-r<=t/16)throw new R;let a=s-1,c=-1;for(let h=s-1;h>r;h--){const g=h-r,A=g*g*(s-h)*(n-e[h]);A>c&&(a=h,c=A)}return a<<He.LUMINANCE_SHIFT}}He.LUMINANCE_BITS=5,He.LUMINANCE_SHIFT=8-He.LUMINANCE_BITS,He.LUMINANCE_BUCKETS=1<<He.LUMINANCE_BITS,He.EMPTY=Uint8ClampedArray.from([0]);class ee extends He{constructor(e){super(e),this.matrix=null}getBlackMatrix(){if(this.matrix!==null)return this.matrix;const e=this.getLuminanceSource(),t=e.getWidth(),n=e.getHeight();if(t>=ee.MINIMUM_DIMENSION&&n>=ee.MINIMUM_DIMENSION){const r=e.getMatrix();let i=t>>ee.BLOCK_SIZE_POWER;(t&ee.BLOCK_SIZE_MASK)!==0&&i++;let s=n>>ee.BLOCK_SIZE_POWER;(n&ee.BLOCK_SIZE_MASK)!==0&&s++;const o=ee.calculateBlackPoints(r,i,s,t,n),a=new Ue(t,n);ee.calculateThresholdForBlock(r,i,s,t,n,o,a),this.matrix=a}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(e){return new ee(e)}static calculateThresholdForBlock(e,t,n,r,i,s,o){const a=i-ee.BLOCK_SIZE,c=r-ee.BLOCK_SIZE;for(let h=0;h<n;h++){let g=h<<ee.BLOCK_SIZE_POWER;g>a&&(g=a);const A=ee.cap(h,2,n-3);for(let m=0;m<t;m++){let I=m<<ee.BLOCK_SIZE_POWER;I>c&&(I=c);const S=ee.cap(m,2,t-3);let y=0;for(let P=-2;P<=2;P++){const F=s[A+P];y+=F[S-2]+F[S-1]+F[S]+F[S+1]+F[S+2]}const M=y/25;ee.thresholdBlock(e,I,g,M,r,o)}}}static cap(e,t,n){return e<t?t:e>n?n:e}static thresholdBlock(e,t,n,r,i,s){for(let o=0,a=n*i+t;o<ee.BLOCK_SIZE;o++,a+=i)for(let c=0;c<ee.BLOCK_SIZE;c++)(e[a+c]&255)<=r&&s.set(t+c,n+o)}static calculateBlackPoints(e,t,n,r,i){const s=i-ee.BLOCK_SIZE,o=r-ee.BLOCK_SIZE,a=new Array(n);for(let c=0;c<n;c++){a[c]=new Int32Array(t);let h=c<<ee.BLOCK_SIZE_POWER;h>s&&(h=s);for(let g=0;g<t;g++){let A=g<<ee.BLOCK_SIZE_POWER;A>o&&(A=o);let m=0,I=255,S=0;for(let M=0,P=h*r+A;M<ee.BLOCK_SIZE;M++,P+=r){for(let F=0;F<ee.BLOCK_SIZE;F++){const v=e[P+F]&255;m+=v,v<I&&(I=v),v>S&&(S=v)}if(S-I>ee.MIN_DYNAMIC_RANGE)for(M++,P+=r;M<ee.BLOCK_SIZE;M++,P+=r)for(let F=0;F<ee.BLOCK_SIZE;F++)m+=e[P+F]&255}let y=m>>ee.BLOCK_SIZE_POWER*2;if(S-I<=ee.MIN_DYNAMIC_RANGE&&(y=I/2,c>0&&g>0)){const M=(a[c-1][g]+2*a[c][g-1]+a[c-1][g-1])/4;I<M&&(y=M)}a[c][g]=y}}return a}}ee.BLOCK_SIZE_POWER=3,ee.BLOCK_SIZE=1<<ee.BLOCK_SIZE_POWER,ee.BLOCK_SIZE_MASK=ee.BLOCK_SIZE-1,ee.MINIMUM_DIMENSION=ee.BLOCK_SIZE*5,ee.MIN_DYNAMIC_RANGE=24;class cn{constructor(e,t){this.width=e,this.height=t}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(e,t,n,r){throw new Qt("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new Qt("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new Qt("This luminance source does not support rotation by 45 degrees.")}toString(){const e=new Uint8ClampedArray(this.width);let t=new Ae;for(let n=0;n<this.height;n++){const r=this.getRow(n,e);for(let i=0;i<this.width;i++){const s=r[i]&255;let o;s<64?o="#":s<128?o="+":s<192?o=".":o=" ",t.append(o)}t.append(`
|
|
4
4
|
`)}return t.toString()}}class Dt extends cn{constructor(e){super(e.getWidth(),e.getHeight()),this.delegate=e}getRow(e,t){const n=this.delegate.getRow(e,t),r=this.getWidth();for(let i=0;i<r;i++)n[i]=255-(n[i]&255);return n}getMatrix(){const e=this.delegate.getMatrix(),t=this.getWidth()*this.getHeight(),n=new Uint8ClampedArray(t);for(let r=0;r<t;r++)n[r]=255-(e[r]&255);return n}isCropSupported(){return this.delegate.isCropSupported()}crop(e,t,n,r){return new Dt(this.delegate.crop(e,t,n,r))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new Dt(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new Dt(this.delegate.rotateCounterClockwise45())}}class Rt extends cn{constructor(e){super(e.width,e.height),this.canvas=e,this.tempCanvasElement=null,this.buffer=Rt.makeBufferFromCanvasImageData(e)}static makeBufferFromCanvasImageData(e){const t=e.getContext("2d").getImageData(0,0,e.width,e.height);return Rt.toGrayscaleBuffer(t.data,e.width,e.height)}static toGrayscaleBuffer(e,t,n){const r=new Uint8ClampedArray(t*n);for(let i=0,s=0,o=e.length;i<o;i+=4,s++){let a;if(e[i+3]===0)a=255;else{const h=e[i],g=e[i+1],A=e[i+2];a=306*h+601*g+117*A+512>>10}r[s]=a}return r}getRow(e,t){if(e<0||e>=this.getHeight())throw new O("Requested row is outside the image: "+e);const n=this.getWidth(),r=e*n;return t===null?t=this.buffer.slice(r,r+n):(t.length<n&&(t=new Uint8ClampedArray(n)),t.set(this.buffer.slice(r,r+n))),t}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(e,t,n,r){return super.crop(e,t,n,r),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(this.tempCanvasElement===null){const e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement}rotate(e){const t=this.getTempCanvasElement(),n=t.getContext("2d"),r=e*Rt.DEGREE_TO_RADIANS,i=this.canvas.width,s=this.canvas.height,o=Math.ceil(Math.abs(Math.cos(r))*i+Math.abs(Math.sin(r))*s),a=Math.ceil(Math.abs(Math.sin(r))*i+Math.abs(Math.cos(r))*s);return t.width=o,t.height=a,n.translate(o/2,a/2),n.rotate(r),n.drawImage(this.canvas,i/-2,s/-2),this.buffer=Rt.makeBufferFromCanvasImageData(t),this}invert(){return new Dt(this)}}Rt.DEGREE_TO_RADIANS=Math.PI/180;class lr{constructor(e,t,n){this.deviceId=e,this.label=t,this.kind="videoinput",this.groupId=n||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var qe=(globalThis||vn||self||window||void 0)&&(globalThis||vn||self||window||void 0).__awaiter||function(d,e,t,n){function r(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function o(h){try{c(n.next(h))}catch(g){s(g)}}function a(h){try{c(n.throw(h))}catch(g){s(g)}}function c(h){h.done?i(h.value):r(h.value).then(o,a)}c((n=n.apply(d,e||[])).next())})};class zt{constructor(e,t=500,n){this.reader=e,this.timeBetweenScansMillis=t,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}get hasNavigator(){return typeof navigator<"u"}get isMediaDevicesSuported(){return this.hasNavigator&&!!navigator.mediaDevices}get canEnumerateDevices(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)}get timeBetweenDecodingAttempts(){return this._timeBetweenDecodingAttempts}set timeBetweenDecodingAttempts(e){this._timeBetweenDecodingAttempts=e<0?0:e}set hints(e){this._hints=e||null}get hints(){return this._hints}listVideoInputDevices(){return qe(this,void 0,void 0,function*(){if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");const e=yield navigator.mediaDevices.enumerateDevices(),t=[];for(const n of e){const r=n.kind==="video"?"videoinput":n.kind;if(r!=="videoinput")continue;const i=n.deviceId||n.id,s=n.label||`Video device ${t.length+1}`,o=n.groupId,a={deviceId:i,label:s,kind:r,groupId:o};t.push(a)}return t})}getVideoInputDevices(){return qe(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(t=>new lr(t.deviceId,t.label))})}findDeviceById(e){return qe(this,void 0,void 0,function*(){const t=yield this.listVideoInputDevices();return t?t.find(n=>n.deviceId===e):null})}decodeFromInputVideoDevice(e,t){return qe(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(e,t)})}decodeOnceFromVideoDevice(e,t){return qe(this,void 0,void 0,function*(){this.reset();let n;e?n={deviceId:{exact:e}}:n={facingMode:"environment"};const r={video:n};return yield this.decodeOnceFromConstraints(r,t)})}decodeOnceFromConstraints(e,t){return qe(this,void 0,void 0,function*(){const n=yield navigator.mediaDevices.getUserMedia(e);return yield this.decodeOnceFromStream(n,t)})}decodeOnceFromStream(e,t){return qe(this,void 0,void 0,function*(){this.reset();const n=yield this.attachStreamToVideo(e,t);return yield this.decodeOnce(n)})}decodeFromInputVideoDeviceContinuously(e,t,n){return qe(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(e,t,n)})}decodeFromVideoDevice(e,t,n){return qe(this,void 0,void 0,function*(){let r;e?r={deviceId:{exact:e}}:r={facingMode:"environment"};const i={video:r};return yield this.decodeFromConstraints(i,t,n)})}decodeFromConstraints(e,t,n){return qe(this,void 0,void 0,function*(){const r=yield navigator.mediaDevices.getUserMedia(e);return yield this.decodeFromStream(r,t,n)})}decodeFromStream(e,t,n){return qe(this,void 0,void 0,function*(){this.reset();const r=yield this.attachStreamToVideo(e,t);return yield this.decodeContinuously(r,n)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(e,t){return qe(this,void 0,void 0,function*(){const n=this.prepareVideoElement(t);return this.addVideoSource(n,e),this.videoElement=n,this.stream=e,yield this.playVideoOnLoadAsync(n),n})}playVideoOnLoadAsync(e){return new Promise((t,n)=>this.playVideoOnLoad(e,()=>t()))}playVideoOnLoad(e,t){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(e),e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",t),this.tryPlayVideo(e)}isVideoPlaying(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2}tryPlayVideo(e){return qe(this,void 0,void 0,function*(){if(this.isVideoPlaying(e)){console.warn("Trying to play video that is already playing.");return}try{yield e.play()}catch{console.warn("It was not possible to play the video.")}})}getMediaElement(e,t){const n=document.getElementById(e);if(!n)throw new _(`element with id '${e}' not found`);if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new _(`element with id '${e}' must be an ${t} element`);return n}decodeFromImage(e,t){if(!e&&!t)throw new _("either imageElement with a src set or an url must be provided");return t&&!e?this.decodeFromImageUrl(t):this.decodeFromImageElement(e)}decodeFromVideo(e,t){if(!e&&!t)throw new _("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrl(t):this.decodeFromVideoElement(e)}decodeFromVideoContinuously(e,t,n){if(e===void 0&&t===void 0)throw new _("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrlContinuously(t,n):this.decodeFromVideoElementContinuously(e,n)}decodeFromImageElement(e){if(!e)throw new _("An image element must be provided.");this.reset();const t=this.prepareImageElement(e);this.imageElement=t;let n;return this.isImageLoaded(t)?n=this.decodeOnce(t,!1,!0):n=this._decodeOnLoadImage(t),n}decodeFromVideoElement(e){const t=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(t)}decodeFromVideoElementContinuously(e,t){const n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(n,t)}_decodeFromVideoElementSetup(e){if(!e)throw new _("A video element must be provided.");this.reset();const t=this.prepareVideoElement(e);return this.videoElement=t,t}decodeFromImageUrl(e){if(!e)throw new _("An URL must be provided.");this.reset();const t=this.prepareImageElement();this.imageElement=t;const n=this._decodeOnLoadImage(t);return t.src=e,n}decodeFromVideoUrl(e){if(!e)throw new _("An URL must be provided.");this.reset();const t=this.prepareVideoElement(),n=this.decodeFromVideoElement(t);return t.src=e,n}decodeFromVideoUrlContinuously(e,t){if(!e)throw new _("An URL must be provided.");this.reset();const n=this.prepareVideoElement(),r=this.decodeFromVideoElementContinuously(n,t);return n.src=e,r}_decodeOnLoadImage(e){return new Promise((t,n)=>{this.imageLoadedListener=()=>this.decodeOnce(e,!1,!0).then(t,n),e.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(e){return qe(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(e),yield this.decodeOnce(e)})}_decodeOnLoadVideoContinuously(e,t){return qe(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(e),this.decodeContinuously(e,t)})}isImageLoaded(e){return!(!e.complete||e.naturalWidth===0)}prepareImageElement(e){let t;return typeof e>"u"&&(t=document.createElement("img"),t.width=200,t.height=200),typeof e=="string"&&(t=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(t=e),t}prepareVideoElement(e){let t;return!e&&typeof document<"u"&&(t=document.createElement("video"),t.width=200,t.height=200),typeof e=="string"&&(t=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(t=e),t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t}decodeOnce(e,t=!0,n=!0){this._stopAsyncDecode=!1;const r=(i,s)=>{if(this._stopAsyncDecode){s(new R("Video stream has ended before any code could be detected.")),this._stopAsyncDecode=void 0;return}try{const o=this.decode(e);i(o)}catch(o){const a=t&&o instanceof R,h=(o instanceof J||o instanceof U)&&n;if(a||h)return setTimeout(r,this._timeBetweenDecodingAttempts,i,s);s(o)}};return new Promise((i,s)=>r(i,s))}decodeContinuously(e,t){this._stopContinuousDecode=!1;const n=()=>{if(this._stopContinuousDecode){this._stopContinuousDecode=void 0;return}try{const r=this.decode(e);t(r,null),setTimeout(n,this.timeBetweenScansMillis)}catch(r){t(null,r);const i=r instanceof J||r instanceof U,s=r instanceof R;(i||s)&&setTimeout(n,this._timeBetweenDecodingAttempts)}};n()}decode(e){const t=this.createBinaryBitmap(e);return this.decodeBitmap(t)}_isHTMLVideoElement(e){return e.videoWidth!==0}drawFrameOnCanvas(e,t,n){t||(t={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),n||(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)}drawImageOnCanvas(e,t,n=this.captureCanvasContext){t||(t={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),n||(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)}createBinaryBitmap(e){this.getCaptureCanvasContext(e),this._isHTMLVideoElement(e)?this.drawFrameOnCanvas(e):this.drawImageOnCanvas(e);const t=this.getCaptureCanvas(e),n=new Rt(t),r=new ee(n);return new ie(r)}getCaptureCanvasContext(e){if(!this.captureCanvasContext){const n=this.getCaptureCanvas(e).getContext("2d");this.captureCanvasContext=n}return this.captureCanvasContext}getCaptureCanvas(e){if(!this.captureCanvas){const t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas}decodeBitmap(e){return this.reader.decode(e,this._hints)}createCaptureCanvas(e){if(typeof document>"u")return this._destroyCaptureCanvas(),null;const t=document.createElement("canvas");let n,r;return typeof e<"u"&&(e instanceof HTMLVideoElement?(n=e.videoWidth,r=e.videoHeight):e instanceof HTMLImageElement&&(n=e.naturalWidth||e.width,r=e.naturalHeight||e.height)),t.style.width=n+"px",t.style.height=r+"px",t.width=n,t.height=r,t}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(e=>e.stop()),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)}_destroyImageElement(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(e,t){try{e.srcObject=t}catch{e.src=URL.createObjectURL(t)}}cleanVideoSource(e){try{e.srcObject=null}catch{e.src=""}this.videoElement.removeAttribute("src")}}class Je{constructor(e,t,n=t==null?0:8*t.length,r,i,s=K.currentTimeMillis()){this.text=e,this.rawBytes=t,this.numBits=n,this.resultPoints=r,this.format=i,this.timestamp=s,this.text=e,this.rawBytes=t,n==null?this.numBits=t==null?0:8*t.length:this.numBits=n,this.resultPoints=r,this.format=i,this.resultMetadata=null,s==null?this.timestamp=K.currentTimeMillis():this.timestamp=s}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(e,t){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)}putAllMetadata(e){e!==null&&(this.resultMetadata===null?this.resultMetadata=e:this.resultMetadata=new Map(e))}addResultPoints(e){const t=this.resultPoints;if(t===null)this.resultPoints=e;else if(e!==null&&e.length>0){const n=new Array(t.length+e.length);K.arraycopy(t,0,n,0,t.length),K.arraycopy(e,0,n,t.length,e.length),this.resultPoints=n}}getTimestamp(){return this.timestamp}toString(){return this.text}}var kn;(function(d){d[d.AZTEC=0]="AZTEC",d[d.CODABAR=1]="CODABAR",d[d.CODE_39=2]="CODE_39",d[d.CODE_93=3]="CODE_93",d[d.CODE_128=4]="CODE_128",d[d.DATA_MATRIX=5]="DATA_MATRIX",d[d.EAN_8=6]="EAN_8",d[d.EAN_13=7]="EAN_13",d[d.ITF=8]="ITF",d[d.MAXICODE=9]="MAXICODE",d[d.PDF_417=10]="PDF_417",d[d.QR_CODE=11]="QR_CODE",d[d.RSS_14=12]="RSS_14",d[d.RSS_EXPANDED=13]="RSS_EXPANDED",d[d.UPC_A=14]="UPC_A",d[d.UPC_E=15]="UPC_E",d[d.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(kn||(kn={}));var Y=kn,Un;(function(d){d[d.OTHER=0]="OTHER",d[d.ORIENTATION=1]="ORIENTATION",d[d.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",d[d.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",d[d.ISSUE_NUMBER=4]="ISSUE_NUMBER",d[d.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",d[d.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",d[d.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",d[d.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",d[d.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",d[d.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(Un||(Un={}));var Ve=Un;class ln{constructor(e,t,n,r,i=-1,s=-1){this.rawBytes=e,this.text=t,this.byteSegments=n,this.ecLevel=r,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=s,this.numBits=e==null?0:8*e.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(e){this.numBits=e}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(e){this.errorsCorrected=e}getErasures(){return this.erasures}setErasures(e){this.erasures=e}getOther(){return this.other}setOther(e){this.other=e}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class un{exp(e){return this.expTable[e]}log(e){if(e===0)throw new O;return this.logTable[e]}static addOrSubtract(e,t){return e^t}}class nt{constructor(e,t){if(t.length===0)throw new O;this.field=e;const n=t.length;if(n>1&&t[0]===0){let r=1;for(;r<n&&t[r]===0;)r++;r===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-r),K.arraycopy(t,r,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(e){return this.coefficients[this.coefficients.length-1-e]}evaluateAt(e){if(e===0)return this.getCoefficient(0);const t=this.coefficients;let n;if(e===1){n=0;for(let s=0,o=t.length;s!==o;s++){const a=t[s];n=un.addOrSubtract(n,a)}return n}n=t[0];const r=t.length,i=this.field;for(let s=1;s<r;s++)n=un.addOrSubtract(i.multiply(e,n),t[s]);return n}addOrSubtract(e){if(!this.field.equals(e.field))throw new O("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;let t=this.coefficients,n=e.coefficients;if(t.length>n.length){const s=t;t=n,n=s}let r=new Int32Array(n.length);const i=n.length-t.length;K.arraycopy(n,0,r,0,i);for(let s=i;s<n.length;s++)r[s]=un.addOrSubtract(t[s-i],n[s]);return new nt(this.field,r)}multiply(e){if(!this.field.equals(e.field))throw new O("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();const t=this.coefficients,n=t.length,r=e.coefficients,i=r.length,s=new Int32Array(n+i-1),o=this.field;for(let a=0;a<n;a++){const c=t[a];for(let h=0;h<i;h++)s[a+h]=un.addOrSubtract(s[a+h],o.multiply(c,r[h]))}return new nt(o,s)}multiplyScalar(e){if(e===0)return this.field.getZero();if(e===1)return this;const t=this.coefficients.length,n=this.field,r=new Int32Array(t),i=this.coefficients;for(let s=0;s<t;s++)r[s]=n.multiply(i[s],e);return new nt(n,r)}multiplyByMonomial(e,t){if(e<0)throw new O;if(t===0)return this.field.getZero();const n=this.coefficients,r=n.length,i=new Int32Array(r+e),s=this.field;for(let o=0;o<r;o++)i[o]=s.multiply(n[o],t);return new nt(s,i)}divide(e){if(!this.field.equals(e.field))throw new O("GenericGFPolys do not have same GenericGF field");if(e.isZero())throw new O("Divide by 0");const t=this.field;let n=t.getZero(),r=this;const i=e.getCoefficient(e.getDegree()),s=t.inverse(i);for(;r.getDegree()>=e.getDegree()&&!r.isZero();){const o=r.getDegree()-e.getDegree(),a=t.multiply(r.getCoefficient(r.getDegree()),s),c=e.multiplyByMonomial(o,a),h=t.buildMonomial(o,a);n=n.addOrSubtract(h),r=r.addOrSubtract(c)}return[n,r]}toString(){let e="";for(let t=this.getDegree();t>=0;t--){let n=this.getCoefficient(t);if(n!==0){if(n<0?(e+=" - ",n=-n):e.length>0&&(e+=" + "),t===0||n!==1){const r=this.field.log(n);r===0?e+="1":r===1?e+="a":(e+="a^",e+=r)}t!==0&&(t===1?e+="x":(e+="x^",e+=t))}}return e}}class In extends C{}In.kind="ArithmeticException";class ue extends un{constructor(e,t,n){super(),this.primitive=e,this.size=t,this.generatorBase=n;const r=new Int32Array(t);let i=1;for(let o=0;o<t;o++)r[o]=i,i*=2,i>=t&&(i^=e,i&=t-1);this.expTable=r;const s=new Int32Array(t);for(let o=0;o<t-1;o++)s[r[o]]=o;this.logTable=s,this.zero=new nt(this,Int32Array.from([0])),this.one=new nt(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(e,t){if(e<0)throw new O;if(t===0)return this.zero;const n=new Int32Array(e+1);return n[0]=t,new nt(this,n)}inverse(e){if(e===0)throw new In;return this.expTable[this.size-this.logTable[e]-1]}multiply(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+Q.toHexString(this.primitive)+","+this.size+")"}equals(e){return e===this}}ue.AZTEC_DATA_12=new ue(4201,4096,1),ue.AZTEC_DATA_10=new ue(1033,1024,1),ue.AZTEC_DATA_6=new ue(67,64,1),ue.AZTEC_PARAM=new ue(19,16,1),ue.QR_CODE_FIELD_256=new ue(285,256,0),ue.DATA_MATRIX_FIELD_256=new ue(301,256,1),ue.AZTEC_DATA_8=ue.DATA_MATRIX_FIELD_256,ue.MAXICODE_FIELD_64=ue.AZTEC_DATA_6;class Kt extends C{}Kt.kind="ReedSolomonException";class pt extends C{}pt.kind="IllegalStateException";class hn{constructor(e){this.field=e}decode(e,t){const n=this.field,r=new nt(n,e),i=new Int32Array(t);let s=!0;for(let m=0;m<t;m++){const I=r.evaluateAt(n.exp(m+n.getGeneratorBase()));i[i.length-1-m]=I,I!==0&&(s=!1)}if(s)return;const o=new nt(n,i),a=this.runEuclideanAlgorithm(n.buildMonomial(t,1),o,t),c=a[0],h=a[1],g=this.findErrorLocations(c),A=this.findErrorMagnitudes(h,g);for(let m=0;m<g.length;m++){const I=e.length-1-n.log(g[m]);if(I<0)throw new Kt("Bad error location");e[I]=ue.addOrSubtract(e[I],A[m])}}runEuclideanAlgorithm(e,t,n){if(e.getDegree()<t.getDegree()){const m=e;e=t,t=m}const r=this.field;let i=e,s=t,o=r.getZero(),a=r.getOne();for(;s.getDegree()>=(n/2|0);){let m=i,I=o;if(i=s,o=a,i.isZero())throw new Kt("r_{i-1} was zero");s=m;let S=r.getZero();const y=i.getCoefficient(i.getDegree()),M=r.inverse(y);for(;s.getDegree()>=i.getDegree()&&!s.isZero();){const P=s.getDegree()-i.getDegree(),F=r.multiply(s.getCoefficient(s.getDegree()),M);S=S.addOrSubtract(r.buildMonomial(P,F)),s=s.addOrSubtract(i.multiplyByMonomial(P,F))}if(a=S.multiply(o).addOrSubtract(I),s.getDegree()>=i.getDegree())throw new pt("Division algorithm failed to reduce polynomial?")}const c=a.getCoefficient(0);if(c===0)throw new Kt("sigmaTilde(0) was zero");const h=r.inverse(c),g=a.multiplyScalar(h),A=s.multiplyScalar(h);return[g,A]}findErrorLocations(e){const t=e.getDegree();if(t===1)return Int32Array.from([e.getCoefficient(1)]);const n=new Int32Array(t);let r=0;const i=this.field;for(let s=1;s<i.getSize()&&r<t;s++)e.evaluateAt(s)===0&&(n[r]=i.inverse(s),r++);if(r!==t)throw new Kt("Error locator degree does not match number of roots");return n}findErrorMagnitudes(e,t){const n=t.length,r=new Int32Array(n),i=this.field;for(let s=0;s<n;s++){const o=i.inverse(t[s]);let a=1;for(let c=0;c<n;c++)if(s!==c){const h=i.multiply(t[c],o),g=(h&1)===0?h|1:h&-2;a=i.multiply(a,g)}r[s]=i.multiply(e.evaluateAt(o),i.inverse(a)),i.getGeneratorBase()!==0&&(r[s]=i.multiply(r[s],o))}return r}}var je;(function(d){d[d.UPPER=0]="UPPER",d[d.LOWER=1]="LOWER",d[d.MIXED=2]="MIXED",d[d.DIGIT=3]="DIGIT",d[d.PUNCT=4]="PUNCT",d[d.BINARY=5]="BINARY"})(je||(je={}));class Se{decode(e){this.ddata=e;let t=e.getBits(),n=this.extractBits(t),r=this.correctBits(n),i=Se.convertBoolArrayToByteArray(r),s=Se.getEncodedData(r),o=new ln(i,s,null,null);return o.setNumBits(r.length),o}static highLevelDecode(e){return this.getEncodedData(e)}static getEncodedData(e){let t=e.length,n=je.UPPER,r=je.UPPER,i="",s=0;for(;s<t;)if(r===je.BINARY){if(t-s<5)break;let o=Se.readCode(e,s,5);if(s+=5,o===0){if(t-s<11)break;o=Se.readCode(e,s,11)+31,s+=11}for(let a=0;a<o;a++){if(t-s<8){s=t;break}const c=Se.readCode(e,s,8);i+=q.castAsNonUtf8Char(c),s+=8}r=n}else{let o=r===je.DIGIT?4:5;if(t-s<o)break;let a=Se.readCode(e,s,o);s+=o;let c=Se.getCharacter(r,a);c.startsWith("CTRL_")?(n=r,r=Se.getTable(c.charAt(5)),c.charAt(6)==="L"&&(n=r)):(i+=c,r=n)}return i}static getTable(e){switch(e){case"L":return je.LOWER;case"P":return je.PUNCT;case"M":return je.MIXED;case"D":return je.DIGIT;case"B":return je.BINARY;case"U":default:return je.UPPER}}static getCharacter(e,t){switch(e){case je.UPPER:return Se.UPPER_TABLE[t];case je.LOWER:return Se.LOWER_TABLE[t];case je.MIXED:return Se.MIXED_TABLE[t];case je.PUNCT:return Se.PUNCT_TABLE[t];case je.DIGIT:return Se.DIGIT_TABLE[t];default:throw new pt("Bad table")}}correctBits(e){let t,n;this.ddata.getNbLayers()<=2?(n=6,t=ue.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,t=ue.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,t=ue.AZTEC_DATA_10):(n=12,t=ue.AZTEC_DATA_12);let r=this.ddata.getNbDatablocks(),i=e.length/n;if(i<r)throw new U;let s=e.length%n,o=new Int32Array(i);for(let A=0;A<i;A++,s+=n)o[A]=Se.readCode(e,s,n);try{new hn(t).decode(o,i-r)}catch(A){throw new U(A)}let a=(1<<n)-1,c=0;for(let A=0;A<r;A++){let m=o[A];if(m===0||m===a)throw new U;(m===1||m===a-1)&&c++}let h=new Array(r*n-c),g=0;for(let A=0;A<r;A++){let m=o[A];if(m===1||m===a-1)h.fill(m>1,g,g+n-1),g+=n-1;else for(let I=n-1;I>=0;--I)h[g++]=(m&1<<I)!==0}return h}extractBits(e){let t=this.ddata.isCompact(),n=this.ddata.getNbLayers(),r=(t?11:14)+n*4,i=new Int32Array(r),s=new Array(this.totalBitsInLayer(n,t));if(t)for(let o=0;o<i.length;o++)i[o]=o;else{let o=r+1+2*Q.truncDivision(Q.truncDivision(r,2)-1,15),a=r/2,c=Q.truncDivision(o,2);for(let h=0;h<a;h++){let g=h+Q.truncDivision(h,15);i[a-h-1]=c-g-1,i[a+h]=c+g+1}}for(let o=0,a=0;o<n;o++){let c=(n-o)*4+(t?9:12),h=o*2,g=r-1-h;for(let A=0;A<c;A++){let m=A*2;for(let I=0;I<2;I++)s[a+m+I]=e.get(i[h+I],i[h+A]),s[a+2*c+m+I]=e.get(i[h+A],i[g-I]),s[a+4*c+m+I]=e.get(i[g-I],i[g-A]),s[a+6*c+m+I]=e.get(i[g-A],i[h+I])}a+=c*8}return s}static readCode(e,t,n){let r=0;for(let i=t;i<t+n;i++)r<<=1,e[i]&&(r|=1);return r}static readByte(e,t){let n=e.length-t;return n>=8?Se.readCode(e,t,8):Se.readCode(e,t,n)<<8-n}static convertBoolArrayToByteArray(e){let t=new Uint8Array((e.length+7)/8);for(let n=0;n<t.length;n++)t[n]=Se.readByte(e,8*n);return t}totalBitsInLayer(e,t){return((t?88:112)+16*e)*e}}Se.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],Se.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],Se.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
*{margin:0;padding:0;box-sizing:border-box}:root{color-scheme:light dark;--bg: #0a0a0a;--surface: #1a1a1a;--border: #2a2a2a;--text: #e0e0e0;--text-muted: #888;--accent: #7c8aff;--accent-hover: #6b79ee;--error: #f44336;--success: #4caf50;--header-bg: rgba(26, 26, 26, .7);--header-border: rgba(255, 255, 255, .06);--toolbar-bg: rgba(18, 18, 18, .9);--tool-btn-bg: #222;--term-bg: #05070c;--term-border: #151922}@media(prefers-color-scheme:light){:root{--bg: #f5f5f7;--surface: #ffffff;--border: #d1d1d6;--text: #1c1c1e;--text-muted: #6e6e73;--accent: #5856d6;--accent-hover: #4a48c4;--error: #ff3b30;--success: #34c759;--header-bg: rgba(255, 255, 255, .7);--header-border: rgba(0, 0, 0, .08);--toolbar-bg: rgba(242, 242, 247, .9);--tool-btn-bg: #e5e5ea;--term-bg: #
|
|
1
|
+
*{margin:0;padding:0;box-sizing:border-box}:root{color-scheme:light dark;--bg: #0a0a0a;--surface: #1a1a1a;--border: #2a2a2a;--text: #e0e0e0;--text-muted: #888;--accent: #7c8aff;--accent-hover: #6b79ee;--error: #f44336;--success: #4caf50;--header-bg: rgba(26, 26, 26, .7);--header-border: rgba(255, 255, 255, .06);--toolbar-bg: rgba(18, 18, 18, .9);--tool-btn-bg: #222;--term-bg: #05070c;--term-border: #151922}@media(prefers-color-scheme:light){:root{--bg: #f5f5f7;--surface: #ffffff;--border: #d1d1d6;--text: #1c1c1e;--text-muted: #6e6e73;--accent: #5856d6;--accent-hover: #4a48c4;--error: #ff3b30;--success: #34c759;--header-bg: rgba(255, 255, 255, .7);--header-border: rgba(0, 0, 0, .08);--toolbar-bg: rgba(242, 242, 247, .9);--tool-btn-bg: #e5e5ea;--term-bg: #ffffff;--term-border: #d1d1d6}}html,body{height:100%;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--text);overflow:hidden;-webkit-text-size-adjust:100%}#app{position:fixed;top:0;left:0;right:0;height:100dvh;display:flex;flex-direction:column;overflow:hidden}.screen{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}.connect-content{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;gap:16px;padding-top:calc(24px + env(safe-area-inset-top,0px));padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))}.connect-content h1{font-size:2rem;color:var(--accent);font-weight:700;margin-top:-4px}.subtitle{color:var(--text-muted);font-size:.95rem;margin-top:-8px}.logo-mark-lg{width:72px;height:72px}.logo-mark-sm{width:26px;height:26px;flex-shrink:0}.connect-methods{width:100%;max-width:360px;display:flex;flex-direction:column;gap:16px}.primary-btn{display:flex;align-items:center;justify-content:center;gap:8px;padding:14px 20px;background:var(--accent);color:#fff;border:none;border-radius:12px;font-size:1rem;font-weight:600;cursor:pointer;transition:background .2s}.primary-btn:hover{background:var(--accent-hover)}.secondary-btn,.tool-btn{padding:12px 20px;background:var(--accent);color:#fff;border:none;border-radius:10px;font-size:.95rem;font-weight:600;cursor:pointer;white-space:nowrap}.secondary-btn:hover,.tool-btn:hover{background:var(--accent-hover)}.divider{display:flex;align-items:center;gap:12px;color:var(--text-muted);font-size:.85rem}.divider:before,.divider:after{content:"";flex:1;height:1px;background:var(--border)}.code-input-group{display:flex;gap:8px}.code-input-group input{flex:1;padding:12px 16px;background:var(--surface);border:1px solid var(--border);border-radius:10px;color:var(--text);font-size:1.1rem;font-family:monospace;letter-spacing:2px;text-align:center;text-transform:uppercase}.code-input-group input:focus{outline:none;border-color:var(--accent)}.relay-config input{width:100%;padding:10px 14px;background:var(--surface);border:1px solid var(--border);border-radius:8px;color:var(--text-muted);font-size:.8rem}.relay-config input:focus{outline:none;border-color:var(--accent);color:var(--text)}.error{color:var(--error);font-size:.85rem;text-align:center}.status-text{color:var(--text-muted);font-size:.85rem;text-align:center}.terminal-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:var(--header-bg);flex-shrink:0;border-bottom:1px solid var(--header-border);padding-top:calc(12px + env(safe-area-inset-top,0px));padding-left:calc(16px + env(safe-area-inset-left,0px));padding-right:calc(16px + env(safe-area-inset-right,0px));position:sticky;top:0;z-index:10;-webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%)}.header-info{display:flex;align-items:center;gap:10px}.header-info h2{font-size:1.1rem;color:var(--accent)}.status-badge{font-size:.7rem;padding:3px 8px;border-radius:10px;background:var(--success);color:#fff;font-weight:600}.status-badge.disconnected{background:var(--error)}.status-badge.reconnecting{background:#ff9800}.icon-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;padding:8px;border-radius:8px}.icon-btn:hover{background:var(--border)}.terminal-toolbar{display:flex;gap:8px;padding:10px 16px;overflow-x:auto;background:var(--toolbar-bg);border-bottom:1px solid var(--header-border);padding-left:calc(16px + env(safe-area-inset-left,0px));padding-right:calc(16px + env(safe-area-inset-right,0px))}.tool-btn{padding:8px 12px;border-radius:999px;font-size:.85rem;background:var(--tool-btn-bg)}.terminal-container{flex:1;min-height:0;padding:8px 10px max(10px,env(safe-area-inset-bottom,0px));background:var(--term-bg)}#terminal{width:100%;height:100%;background:var(--term-bg);border:1px solid var(--term-border);border-radius:12px;overflow:hidden}#terminal .xterm{height:100%;padding:8px}#terminal .xterm-viewport{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto!important;touch-action:pan-y}#qrReader{width:100%;max-width:360px;border-radius:12px;overflow:hidden}#qrReader video{border-radius:12px}#terminalScreen.landscape .terminal-header{padding-top:4px;padding-bottom:4px}#terminalScreen.landscape .logo-mark-sm,#terminalScreen.landscape .header-info h2{display:none}#terminalScreen.landscape .terminal-toolbar{padding-top:4px;padding-bottom:4px}#terminalScreen.landscape .tool-btn{padding:5px 10px;font-size:.75rem}#terminalScreen.landscape .terminal-container{padding-top:4px}/**
|
|
2
2
|
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
|
3
3
|
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
4
4
|
* https://github.com/chjj/term.js
|
package/dist/viewer/index.html
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
8
8
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
9
9
|
<title>Airloom</title>
|
|
10
|
-
<script type="module" crossorigin src="./assets/index-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
10
|
+
<script type="module" crossorigin src="./assets/index-BIIt6Ahm.js"></script>
|
|
11
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DGkPtIMJ.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<svg xmlns="http://www.w3.org/2000/svg" style="position:absolute;width:0;height:0" aria-hidden="true">
|