@memori.ai/memori-webcomponent 1.1.3 → 1.2.0

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.
@@ -47,7 +47,7 @@ var r,o,i,a,s,l,c,u,d,f,h,p,m,g,v,b,y,w,x,S,M,_,E;if(e(t.exports,"unstable_now",
47
47
  * @author Feross Aboukhadijeh <https://feross.org>
48
48
  * @license MIT
49
49
  */var r,o,i,s;e(t.exports,"Buffer",(()=>r),(e=>r=e)),e(t.exports,"SlowBuffer",(()=>o),(e=>o=e)),e(t.exports,"INSPECT_MAX_BYTES",(()=>i),(e=>i=e)),e(t.exports,"kMaxLength",(()=>s),(e=>s=e));var l=a("9Et26"),c=a("bDLoS"),u="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;r=h,o=function(e){+e!=e&&(e=0);return h.alloc(+e)},i=50;var d=2147483647;function f(e){if(e>d)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,h.prototype),t}function h(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return g(e)}return p(e,t,n)}function p(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!h.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|w(e,t),r=f(n),o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){var t=new Uint8Array(e);return b(t.buffer,t.byteOffset,t.byteLength)}return v(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return b(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return b(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return h.from(r,t,n);var o=function(e){if(h.isBuffer(e)){var t=0|y(e.length),n=f(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||K(e.length)?f(0):v(e);if("Buffer"===e.type&&Array.isArray(e.data))return v(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return h.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function m(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function g(e){return m(e),f(e<0?0:0|y(e))}function v(e){for(var t=e.length<0?0:0|y(e.length),n=f(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function b(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,h.prototype),r}function y(e){if(e>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return 0|e}function w(e,t){if(h.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(o)return r?-1:G(e).length;t=(""+t).toLowerCase(),o=!0}}function x(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function S(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function M(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),K(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=h.from(t,r)),h.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,o){var i,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*a}else-1!==u&&(i-=i-u),u=-1}else for(n+l>s&&(n=s-l),i=n;i>=0;i--){for(var d=!0,f=0;f<l;f++)if(c(e,i+f)!==c(t,f)){d=!1;break}if(d)return i}return-1}function E(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(K(s))return a;e[n+a]=s}return a}function A(e,t,n,r){return V(G(t,e.length-n),e,n,r)}function C(e,t,n,r){return V(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function k(e,t,n,r){return V(W(t),e,n,r)}function T(e,t,n,r){return V(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?l.fromByteArray(e):l.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,l,c=e[o],u=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(l=(15&c)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=d}return function(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=R));return n}(r)}s=d,h.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),h.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),h.poolSize=8192,h.from=function(e,t,n){return p(e,t,n)},Object.setPrototypeOf(h.prototype,Uint8Array.prototype),Object.setPrototypeOf(h,Uint8Array),h.alloc=function(e,t,n){return function(e,t,n){return m(e),e<=0?f(e):void 0!==t?"string"==typeof n?f(e).fill(t,n):f(e).fill(t):f(e)}(e,t,n)},h.allocUnsafe=function(e){return g(e)},h.allocUnsafeSlow=function(e){return g(e)},h.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==h.prototype},h.compare=function(e,t){if(q(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(e)||!h.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},h.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return h.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=h.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var i=e[n];if(q(i,Uint8Array))o+i.length>r.length?h.from(i).copy(r,o):Uint8Array.prototype.set.call(r,i,o);else{if(!h.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,o)}o+=i.length}return r},h.byteLength=w,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)S(this,t,t+1);return this},h.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)S(this,t,t+3),S(this,t+1,t+2);return this},h.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)S(this,t,t+7),S(this,t+1,t+6),S(this,t+2,t+5),S(this,t+3,t+4);return this},h.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?O(this,0,e):x.apply(this,arguments)},h.prototype.toLocaleString=h.prototype.toString,h.prototype.equals=function(e){if(!h.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===h.compare(this,e)},h.prototype.inspect=function(){var e="",t=i;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},u&&(h.prototype[u]=h.prototype.inspect),h.prototype.compare=function(e,t,n,r,o){if(q(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),l=this.slice(r,o),c=e.slice(t,n),u=0;u<s;++u)if(l[u]!==c[u]){i=l[u],a=c[u];break}return i<a?-1:a<i?1:0},h.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},h.prototype.indexOf=function(e,t,n){return M(this,e,t,n,!0)},h.prototype.lastIndexOf=function(e,t,n){return M(this,e,t,n,!1)},h.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return A(this,e,t,n);case"ascii":case"latin1":case"binary":return C(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function P(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function N(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function L(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=$[e[i]];return o}function B(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length-1;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function D(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,o,i){if(!h.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function F(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(e,t,n,r,o){return t=+t,n>>>=0,o||F(e,0,n,4),c.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,o){return t=+t,n>>>=0,o||F(e,0,n,8),c.write(e,t,n,r,52,8),n+8}h.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,h.prototype),r},h.prototype.readUintLE=h.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},h.prototype.readUintBE=h.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},h.prototype.readUint8=h.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},h.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},h.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},h.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},h.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),c.read(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),c.read(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),c.read(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),c.read(this,e,!1,52,8)},h.prototype.writeUintLE=h.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},h.prototype.writeUintBE=h.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},h.prototype.writeUint8=h.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,255,0),this[t]=255&e,t+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);j(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},h.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);j(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},h.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},h.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},h.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},h.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},h.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},h.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},h.prototype.copy=function(e,t,n,r){if(!h.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),o},h.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!h.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var o=e.charCodeAt(0);("utf8"===r&&o<128||"latin1"===r)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=h.isBuffer(e)?e:h.from(e,r),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var H=/[^+/0-9A-Za-z-_]/g;function G(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function W(e){return l.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function K(e){return e!=e}var $=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,o=0;o<16;++o)t[r+o]=e[n]+e[o];return t}()})),a.register("9Et26",(function(t,n){var r,o;e(t.exports,"toByteArray",(()=>r),(e=>r=e)),e(t.exports,"fromByteArray",(()=>o),(e=>o=e)),r=function(e){var t,n,r=d(e),o=r[0],i=r[1],l=new s(function(e,t,n){return 3*(t+n)/4-n}(0,o,i)),c=0,u=i>0?o-4:o;for(n=0;n<u;n+=4)t=a[e.charCodeAt(n)]<<18|a[e.charCodeAt(n+1)]<<12|a[e.charCodeAt(n+2)]<<6|a[e.charCodeAt(n+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===i&&(t=a[e.charCodeAt(n)]<<2|a[e.charCodeAt(n+1)]>>4,l[c++]=255&t);1===i&&(t=a[e.charCodeAt(n)]<<10|a[e.charCodeAt(n+1)]<<4|a[e.charCodeAt(n+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},o=function(e){for(var t,n=e.length,r=n%3,o=[],a=16383,s=0,l=n-r;s<l;s+=a)o.push(f(e,s,s+a>l?l:s+a));1===r?(t=e[n-1],o.push(i[t>>2]+i[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],o.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return o.join("")};for(var i=[],a=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,u=l.length;c<u;++c)i[c]=l[c],a[l.charCodeAt(c)]=c;function d(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function f(e,t,n){for(var r,o,a=[],s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(i[(o=r)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return a.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63})),a.register("bDLoS",(function(t,n){
50
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var r,o;e(t.exports,"read",(()=>r),(e=>r=e)),e(t.exports,"write",(()=>o),(e=>o=e)),r=function(e,t,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,c=l>>1,u=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+d],d+=f,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=f,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},o=function(e,t,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,d=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+d>=1?f/l:f*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*m}})),a.register("9gzJO",(function(e,t){var n=a("ePtPP"),r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},o=/%[sdj%]/g;e.exports.format=function(e){if(!b(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(l(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,a=String(e).replace(o,(function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),s=r[n];n<i;s=r[++n])g(s)||!x(s)?a+=" "+s:a+=" "+l(s);return a},e.exports.deprecate=function(t,r){if(void 0!==n&&!0===n.noDeprecation)return t;if(void 0===n)return function(){return e.exports.deprecate(t,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),o=!0}return t.apply(this,arguments)}};var i={},s=/^$/;function l(t,n){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&e.exports._extend(r,n),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),d(r,t,r.depth)}function c(e,t){var n=l.styles[t];return n?"["+l.colors[n][0]+"m"+e+"["+l.colors[n][1]+"m":e}function u(e,t){return e}function d(t,n,r){if(t.customInspect&&n&&_(n.inspect)&&n.inspect!==e.exports.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,t);return b(o)||(o=d(t,o,r)),o}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(v(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(t,n);if(i)return i;var a=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),M(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(_(n)){var l=n.name?": "+n.name:"";return t.stylize("[Function"+l+"]","special")}if(w(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(S(n))return t.stylize(Date.prototype.toString.call(n),"date");if(M(n))return f(n)}var c,u="",x=!1,E=["{","}"];(p(n)&&(x=!0,E=["[","]"]),_(n))&&(u=" [Function"+(n.name?": "+n.name:"")+"]");return w(n)&&(u=" "+RegExp.prototype.toString.call(n)),S(n)&&(u=" "+Date.prototype.toUTCString.call(n)),M(n)&&(u=" "+f(n)),0!==a.length||x&&0!=n.length?r<0?w(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),c=x?function(e,t,n,r,o){for(var i=[],a=0,s=t.length;a<s;++a)T(t,String(a))?i.push(h(e,t,n,r,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(h(e,t,n,r,o,!0))})),i}(t,n,r,s,a):a.map((function(e){return h(t,n,r,s,e,x)})),t.seen.pop(),function(e,t,n){var r=e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return r>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(c,u,E)):E[0]+u+E[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,o,i){var a,s,l;if((l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),T(r,o)||(a="["+o+"]"),s||(e.seen.indexOf(l.value)<0?(s=g(n)?d(e,l.value,null):d(e,l.value,n-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function v(e){return"number"==typeof e}function b(e){return"string"==typeof e}function y(e){return void 0===e}function w(e){return x(e)&&"[object RegExp]"===E(e)}function x(e){return"object"==typeof e&&null!==e}function S(e){return x(e)&&"[object Date]"===E(e)}function M(e){return x(e)&&("[object Error]"===E(e)||e instanceof Error)}function _(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}e.exports.debuglog=function(t){if(t=t.toUpperCase(),!i[t])if(s.test(t)){var r=n.pid;i[t]=function(){var n=e.exports.format.apply(e.exports,arguments);console.error("%s %d: %s",t,r,n)}}else i[t]=function(){};return i[t]},e.exports.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.exports.types=a("bM5Oe"),e.exports.isArray=p,e.exports.isBoolean=m,e.exports.isNull=g,e.exports.isNullOrUndefined=function(e){return null==e},e.exports.isNumber=v,e.exports.isString=b,e.exports.isSymbol=function(e){return"symbol"==typeof e},e.exports.isUndefined=y,e.exports.isRegExp=w,e.exports.types.isRegExp=w,e.exports.isObject=x,e.exports.isDate=S,e.exports.types.isDate=S,e.exports.isError=M,e.exports.types.isNativeError=M,e.exports.isFunction=_,e.exports.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},e.exports.isBuffer=a("jPRhY");var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),C[e.getMonth()],t].join(" ")}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports.log=function(){console.log("%s - %s",k(),e.exports.format.apply(e.exports,arguments))},e.exports.inherits=a("5jAh8"),e.exports._extend=function(e,t){if(!t||!x(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}e.exports.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(I&&e[I]){var t;if("function"!=typeof(t=e[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,I,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,o)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),I&&Object.defineProperty(t,I,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,r(e))},e.exports.promisify.custom=I,e.exports.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,t).then((function(e){n.nextTick(a.bind(null,null,e))}),(function(e){n.nextTick(O.bind(null,e,a))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,r(e)),t}})),a.register("ePtPP",(function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,c=[],u=!1,d=-1;function f(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&h())}function h(){if(!u){var e=s(f);u=!0;for(var t=c.length;t;){for(l=c,c=[];++d<t;)l&&l[d].run();d=-1,t=c.length}l=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||u||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}})),a.register("bM5Oe",(function(e,t){"use strict";var n=a("3vY4Y"),r=a("jgq2W"),o=a("8yoeR"),i=a("doLxT");function s(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=s(Object.prototype.toString),d=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),h=s(Boolean.prototype.valueOf);if(l)var p=s(BigInt.prototype.valueOf);if(c)var m=s(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function v(e){return"[object Map]"===u(e)}function b(e){return"[object Set]"===u(e)}function y(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function x(e){return"[object ArrayBuffer]"===u(e)}function S(e){return"undefined"!=typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function M(e){return"[object DataView]"===u(e)}function _(e){return"undefined"!=typeof DataView&&(M.working?M(e):e instanceof DataView)}e.exports.isArgumentsObject=n,e.exports.isGeneratorFunction=r,e.exports.isTypedArray=i,e.exports.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},e.exports.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):i(e)||_(e)},e.exports.isUint8Array=function(e){return"Uint8Array"===o(e)},e.exports.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},e.exports.isUint16Array=function(e){return"Uint16Array"===o(e)},e.exports.isUint32Array=function(e){return"Uint32Array"===o(e)},e.exports.isInt8Array=function(e){return"Int8Array"===o(e)},e.exports.isInt16Array=function(e){return"Int16Array"===o(e)},e.exports.isInt32Array=function(e){return"Int32Array"===o(e)},e.exports.isFloat32Array=function(e){return"Float32Array"===o(e)},e.exports.isFloat64Array=function(e){return"Float64Array"===o(e)},e.exports.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},e.exports.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},v.working="undefined"!=typeof Map&&v(new Map),e.exports.isMap=function(e){return"undefined"!=typeof Map&&(v.working?v(e):e instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),e.exports.isSet=function(e){return"undefined"!=typeof Set&&(b.working?b(e):e instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),e.exports.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(y.working?y(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.exports.isWeakSet=function(e){return w(e)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),e.exports.isArrayBuffer=S,M.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&M(new DataView(new ArrayBuffer(1),0,1)),e.exports.isDataView=_;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(e){return"[object SharedArrayBuffer]"===u(e)}function C(e){return void 0!==E&&(void 0===A.working&&(A.working=A(new E)),A.working?A(e):e instanceof E)}function k(e){return g(e,d)}function T(e){return g(e,f)}function I(e){return g(e,h)}function O(e){return l&&g(e,p)}function R(e){return c&&g(e,m)}e.exports.isSharedArrayBuffer=C,e.exports.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},e.exports.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},e.exports.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},e.exports.isGeneratorObject=function(e){return"[object Generator]"===u(e)},e.exports.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},e.exports.isNumberObject=k,e.exports.isStringObject=T,e.exports.isBooleanObject=I,e.exports.isBigIntObject=O,e.exports.isSymbolObject=R,e.exports.isBoxedPrimitive=function(e){return k(e)||T(e)||I(e)||O(e)||R(e)},e.exports.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(S(e)||C(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e.exports,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))})),a.register("3vY4Y",(function(e,t){"use strict";var n=a("gp4q4")(),r=a("6pFFa")("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===r(e)},i=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==r(e)&&"[object Function]"===r(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=i,e.exports=s?o:i})),a.register("gp4q4",(function(e,t){"use strict";var n=a("fPlzF");e.exports=function(){return n()&&!!Symbol.toStringTag}})),a.register("fPlzF",(function(e,t){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}})),a.register("6pFFa",(function(e,t){"use strict";var n=a("3kYrO"),r=a("1Mwz1"),o=r(n("String.prototype.indexOf"));e.exports=function(e,t){var i=n(e,!!t);return"function"==typeof i&&o(e,".prototype.")>-1?r(i):i}})),a.register("3kYrO",(function(e,t){"use strict";var n,r=SyntaxError,o=Function,i=TypeError,s=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(e){l=null}var c=function(){throw new i},u=l?function(){try{return c}catch(e){try{return l(arguments,"callee").get}catch(e){return c}}}():c,d=a("l5rv7")(),f=Object.getPrototypeOf||function(e){return e.__proto__},h={},p="undefined"==typeof Uint8Array?n:f(Uint8Array),m={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":d?f([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":d?f(f([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&d?f((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&d?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d?f(""[Symbol.iterator]()):n,"%Symbol%":d?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":u,"%TypedArray%":p,"%TypeError%":i,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function e(t){var n;if("%AsyncFunction%"===t)n=s("async function () {}");else if("%GeneratorFunction%"===t)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=s("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=f(o.prototype))}return m[t]=n,n},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=a("2JiOr"),y=a("c5f2w"),w=b.call(Function.call,Array.prototype.concat),x=b.call(Function.apply,Array.prototype.splice),S=b.call(Function.call,String.prototype.replace),M=b.call(Function.call,String.prototype.slice),_=b.call(Function.call,RegExp.prototype.exec),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,C=function(e){var t=M(e,0,1),n=M(e,-1);if("%"===t&&"%"!==n)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new r("invalid intrinsic syntax, expected opening `%`");var o=[];return S(e,E,(function(e,t,n,r){o[o.length]=n?S(r,A,"$1"):t||e})),o},k=function(e,t){var n,o=e;if(y(v,o)&&(o="%"+(n=v[o])[0]+"%"),y(m,o)){var a=m[o];if(a===h&&(a=g(o)),void 0===a&&!t)throw new i("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:a}}throw new r("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new i('"allowMissing" argument must be a boolean');if(null===_(/^%?[^%]*%?$/,e))throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=C(e),o=n.length>0?n[0]:"",a=k("%"+o+"%",t),s=a.name,c=a.value,u=!1,d=a.alias;d&&(o=d[0],x(n,w([0,1],d)));for(var f=1,h=!0;f<n.length;f+=1){var p=n[f],g=M(p,0,1),v=M(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===v||"'"===v||"`"===v)&&g!==v)throw new r("property names with quotes must have matching quotes");if("constructor"!==p&&h||(u=!0),y(m,s="%"+(o+="."+p)+"%"))c=m[s];else if(null!=c){if(!(p in c)){if(!t)throw new i("base intrinsic for "+e+" exists, but the property is not available.");return}if(l&&f+1>=n.length){var b=l(c,p);c=(h=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:c[p]}else h=y(c,p),c=c[p];h&&!u&&(m[s]=c)}}return c}})),a.register("l5rv7",(function(e,t){"use strict";var n="undefined"!=typeof Symbol&&Symbol,r=a("fPlzF");e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&r())))}})),a.register("2JiOr",(function(e,t){"use strict";var n=a("5DpJt");e.exports=Function.prototype.bind||n})),a.register("5DpJt",(function(e,t){"use strict";var n="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,o=Object.prototype.toString,i="[object Function]";e.exports=function(e){var t=this;if("function"!=typeof t||o.call(t)!==i)throw new TypeError(n+t);for(var a,s=r.call(arguments,1),l=function(){if(this instanceof a){var n=t.apply(this,s.concat(r.call(arguments)));return Object(n)===n?n:this}return t.apply(e,s.concat(r.call(arguments)))},c=Math.max(0,t.length-s.length),u=[],d=0;d<c;d++)u.push("$"+d);if(a=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(l),t.prototype){var f=function(){};f.prototype=t.prototype,a.prototype=new f,f.prototype=null}return a}})),a.register("c5f2w",(function(e,t){"use strict";var n=a("2JiOr");e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)})),a.register("1Mwz1",(function(e,t){"use strict";var n=a("2JiOr"),r=a("3kYrO"),o=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||n.call(i,o),l=r("%Object.getOwnPropertyDescriptor%",!0),c=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=s(n,i,arguments);if(l&&c){var r=l(t,"length");r.configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var d=function(){return s(n,o,arguments)};c?c(e.exports,"apply",{value:d}):e.exports.apply=d})),a.register("jgq2W",(function(e,t){"use strict";var n,r=Object.prototype.toString,o=Function.prototype.toString,i=/^\s*(?:function)?\*/,s=a("gp4q4")(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(i.test(o.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===r.call(e);if(!l)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&l(t)}return l(e)===n}})),a.register("8yoeR",(function(e,n){"use strict";var r=a("kz55o"),o=a("5gqKI"),i=a("6pFFa"),s=a("8WWik"),l=i("Object.prototype.toString"),c=a("gp4q4")(),u="undefined"==typeof globalThis?t:globalThis,d=o(),f=i("String.prototype.slice"),h={},p=Object.getPrototypeOf;c&&s&&p&&r(d,(function(e){if("function"==typeof u[e]){var t=new u[e];if(Symbol.toStringTag in t){var n=p(t),r=s(n,Symbol.toStringTag);if(!r){var o=p(n);r=s(o,Symbol.toStringTag)}h[e]=r.get}}}));var m=a("doLxT");e.exports=function(e){return!!m(e)&&(c&&Symbol.toStringTag in e?function(e){var t=!1;return r(h,(function(n,r){if(!t)try{var o=n.call(e);o===r&&(t=o)}catch(e){}})),t}(e):f(l(e),8,-1))}})),a.register("kz55o",(function(e,t){"use strict";var n=a("4Z0y4"),r=Object.prototype.toString,o=Object.prototype.hasOwnProperty,i=function(e,t,n){for(var r=0,i=e.length;r<i;r++)o.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))},s=function(e,t,n){for(var r=0,o=e.length;r<o;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)},l=function(e,t,n){for(var r in e)o.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))};e.exports=function(e,t,o){if(!n(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=o),"[object Array]"===r.call(e)?i(e,t,a):"string"==typeof e?s(e,t,a):l(e,t,a)}})),a.register("4Z0y4",(function(e,t){"use strict";var n,r,o=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,n)}catch(e){e!==r&&(i=null)}else i=null;var a=/^\s*class\b/,s=function(e){try{var t=o.call(e);return a.test(t)}catch(e){return!1}},l=function(e){try{return!s(e)&&(o.call(e),!0)}catch(e){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,d=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var h=document.all;c.call(h)===c.call(document.all)&&(f=function(e){if((d||!e)&&(void 0===e||"object"==typeof e))try{var t=c.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,n)}catch(e){if(e!==r)return!1}return!s(e)&&l(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(u)return l(e);if(s(e))return!1;var t=c.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&l(e)}})),a.register("5gqKI",(function(e,n){"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],o="undefined"==typeof globalThis?t:globalThis;e.exports=function(){for(var e=[],t=0;t<r.length;t++)"function"==typeof o[r[t]]&&(e[e.length]=r[t]);return e}})),a.register("8WWik",(function(e,t){"use strict";var n=a("3kYrO")("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n})),a.register("doLxT",(function(e,n){"use strict";var r=a("kz55o"),o=a("5gqKI"),i=a("6pFFa"),s=i("Object.prototype.toString"),l=a("gp4q4")(),c=a("8WWik"),u="undefined"==typeof globalThis?t:globalThis,d=o(),f=i("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},h=i("String.prototype.slice"),p={},m=Object.getPrototypeOf;l&&c&&m&&r(d,(function(e){var t=new u[e];if(Symbol.toStringTag in t){var n=m(t),r=c(n,Symbol.toStringTag);if(!r){var o=m(n);r=c(o,Symbol.toStringTag)}p[e]=r.get}}));e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!l||!(Symbol.toStringTag in e)){var t=h(s(e),8,-1);return f(d,t)>-1}return!!c&&function(e){var t=!1;return r(p,(function(n,r){if(!t)try{t=n.call(e)===r}catch(e){}})),t}(e)}})),a.register("jPRhY",(function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}})),a.register("5jAh8",(function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),a.register("fnFC9",(function(e,n){var r=a("fB4ch"),o=a("9QxiN"),i=a("iCrCa"),s=a("7X2JB"),l=a("8iXHm"),c=e.exports;c.request=function(e,n){e="string"==typeof e?l.parse(e):i(e);var o=-1===t.location.protocol.search(/^https?:$/)?"http:":"",a=e.protocol||o,s=e.hostname||e.host,c=e.port,u=e.path||"/";s&&-1!==s.indexOf(":")&&(s="["+s+"]"),e.url=(s?a+"//"+s:"")+(c?":"+c:"")+u,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var d=new r(e);return n&&d.on("response",n),d},c.get=function(e,t){var n=c.request(e,t);return n.end(),n},c.ClientRequest=r,c.IncomingMessage=o.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=s,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]})),a.register("fB4ch",(function(e,n){var r=a("bqBrJ").Buffer,o=a("ePtPP"),i=a("7lggT"),s=a("5jAh8"),l=a("9QxiN"),c=a("8IqCp"),u=l.IncomingMessage,d=l.readyStates;var f=e.exports=function(e){var t,n=this;c.Writable.call(n),n._opts=e,n._body=[],n._headers={},e.auth&&n.setHeader("Authorization","Basic "+r.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){n.setHeader(t,e.headers[t])}));var o=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!i.abortController)o=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!i.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}n._mode=function(e,t){return i.fetch&&t?"fetch":i.mozchunkedarraybuffer?"moz-chunked-arraybuffer":i.msstream?"ms-stream":i.arraybuffer&&e?"arraybuffer":"text"}(t,o),n._fetchTimer=null,n._socketTimeout=null,n._socketTimer=null,n.on("finish",(function(){n._onFinish()}))};s(f,c.Writable),f.prototype.setHeader=function(e,t){var n=e.toLowerCase();-1===h.indexOf(n)&&(this._headers[n]={name:e,value:t})},f.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},f.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},f.prototype._onFinish=function(){var e=this;if(!e._destroyed){var n=e._opts;"timeout"in n&&0!==n.timeout&&e.setTimeout(n.timeout);var r=e._headers,a=null;"GET"!==n.method&&"HEAD"!==n.method&&(a=new Blob(e._body,{type:(r["content-type"]||{}).value||""}));var s=[];if(Object.keys(r).forEach((function(e){var t=r[e].name,n=r[e].value;Array.isArray(n)?n.forEach((function(e){s.push([t,e])})):s.push([t,n])})),"fetch"===e._mode){var l=null;if(i.abortController){var c=new AbortController;l=c.signal,e._fetchAbortController=c,"requestTimeout"in n&&0!==n.requestTimeout&&(e._fetchTimer=t.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),n.requestTimeout))}t.fetch(e._opts.url,{method:e._opts.method,headers:s,body:a||void 0,mode:"cors",credentials:n.withCredentials?"include":"same-origin",signal:l}).then((function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()}),(function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)}))}else{var u=e._xhr=new t.XMLHttpRequest;try{u.open(e._opts.method,e._opts.url,!0)}catch(t){return void o.nextTick((function(){e.emit("error",t)}))}"responseType"in u&&(u.responseType=e._mode),"withCredentials"in u&&(u.withCredentials=!!n.withCredentials),"text"===e._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in n&&(u.timeout=n.requestTimeout,u.ontimeout=function(){e.emit("requestTimeout")}),s.forEach((function(e){u.setRequestHeader(e[0],e[1])})),e._response=null,u.onreadystatechange=function(){switch(u.readyState){case d.LOADING:case d.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(u.onprogress=function(){e._onXHRProgress()}),u.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{u.send(a)}catch(t){return void o.nextTick((function(){e.emit("error",t)}))}}}},f.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},f.prototype._connect=function(){var e=this;e._destroyed||(e._response=new u(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},f.prototype._write=function(e,t,n){this._body.push(e),n()},f.prototype._resetTimers=function(e){var n=this;t.clearTimeout(n._socketTimer),n._socketTimer=null,e?(t.clearTimeout(n._fetchTimer),n._fetchTimer=null):n._socketTimeout&&(n._socketTimer=t.setTimeout((function(){n.emit("timeout")}),n._socketTimeout))},f.prototype.abort=f.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)},f.prototype.end=function(e,t,n){"function"==typeof e&&(n=e,e=void 0),c.Writable.prototype.end.call(this,e,t,n)},f.prototype.setTimeout=function(e,t){var n=this;t&&n.once("timeout",t),n._socketTimeout=e,n._resetTimers(!1)},f.prototype.flushHeaders=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var h=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]})),a.register("7lggT",(function(n,r){var o,i,a,s,l,c,u,d;function f(){if(void 0!==d)return d;if(t.XMLHttpRequest){d=new t.XMLHttpRequest;try{d.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(e){d=null}}else d=null;return d}function h(e){var t=f();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function p(e){return"function"==typeof e}e(n.exports,"fetch",(()=>o),(e=>o=e)),e(n.exports,"writableStream",(()=>i),(e=>i=e)),e(n.exports,"abortController",(()=>a),(e=>a=e)),e(n.exports,"arraybuffer",(()=>s),(e=>s=e)),e(n.exports,"msstream",(()=>l),(e=>l=e)),e(n.exports,"mozchunkedarraybuffer",(()=>c),(e=>c=e)),e(n.exports,"overrideMimeType",(()=>u),(e=>u=e)),o=p(t.fetch)&&p(t.ReadableStream),i=p(t.WritableStream),a=p(t.AbortController),s=o||h("arraybuffer"),l=!o&&h("ms-stream"),c=!o&&h("moz-chunked-arraybuffer"),u=o||!!f()&&p(f().overrideMimeType),d=null})),a.register("9QxiN",(function(n,r){var o,i;e(n.exports,"readyStates",(()=>o),(e=>o=e)),e(n.exports,"IncomingMessage",(()=>i),(e=>i=e));var s=a("ePtPP"),l=a("bqBrJ").Buffer,c=a("7lggT"),u=a("5jAh8"),d=a("8IqCp"),f=o={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},h=i=function(e,t,n,r){var o=this;if(d.Readable.call(o),o._mode=n,o.headers={},o.rawHeaders=[],o.trailers={},o.rawTrailers=[],o.on("end",(function(){s.nextTick((function(){o.emit("close")}))})),"fetch"===n){if(o._fetchResponse=t,o.url=t.url,o.statusCode=t.status,o.statusMessage=t.statusText,t.headers.forEach((function(e,t){o.headers[t.toLowerCase()]=e,o.rawHeaders.push(t,e)})),c.writableStream){var i=new WritableStream({write:function(e){return r(!1),new Promise((function(t,n){o._destroyed?n():o.push(l.from(e))?t():o._resumeFetch=t}))},close:function(){r(!0),o._destroyed||o.push(null)},abort:function(e){r(!0),o._destroyed||o.emit("error",e)}});try{return void t.body.pipeTo(i).catch((function(e){r(!0),o._destroyed||o.emit("error",e)}))}catch(e){}}var a=t.body.getReader();!function e(){a.read().then((function(t){o._destroyed||(r(t.done),t.done?o.push(null):(o.push(l.from(t.value)),e()))})).catch((function(e){r(!0),o._destroyed||o.emit("error",e)}))}()}else{if(o._xhr=e,o._pos=0,o.url=e.responseURL,o.statusCode=e.status,o.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===o.headers[n]&&(o.headers[n]=[]),o.headers[n].push(t[2])):void 0!==o.headers[n]?o.headers[n]+=", "+t[2]:o.headers[n]=t[2],o.rawHeaders.push(t[1],t[2])}})),o._charset="x-user-defined",!c.overrideMimeType){var u=o.rawHeaders["mime-type"];if(u){var f=u.match(/;\s*charset=([^;])(;|$)/);f&&(o._charset=f[1].toLowerCase())}o._charset||(o._charset="utf-8")}}};u(h,d.Readable),h.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},h.prototype._onXHRProgress=function(e){var n=this,r=n._xhr,o=null;switch(n._mode){case"text":if((o=r.responseText).length>n._pos){var i=o.substr(n._pos);if("x-user-defined"===n._charset){for(var a=l.alloc(i.length),s=0;s<i.length;s++)a[s]=255&i.charCodeAt(s);n.push(a)}else n.push(i,n._charset);n._pos=o.length}break;case"arraybuffer":if(r.readyState!==f.DONE||!r.response)break;o=r.response,n.push(l.from(new Uint8Array(o)));break;case"moz-chunked-arraybuffer":if(o=r.response,r.readyState!==f.LOADING||!o)break;n.push(l.from(new Uint8Array(o)));break;case"ms-stream":if(o=r.response,r.readyState!==f.LOADING)break;var c=new t.MSStreamReader;c.onprogress=function(){c.result.byteLength>n._pos&&(n.push(l.from(new Uint8Array(c.result.slice(n._pos)))),n._pos=c.result.byteLength)},c.onload=function(){e(!0),n.push(null)},c.readAsArrayBuffer(o)}n._xhr.readyState===f.DONE&&"ms-stream"!==n._mode&&(e(!0),n.push(null))}})),a.register("8IqCp",(function(e,t){(t=e.exports=a("kZTRI")).Stream=t,t.Readable=t,t.Writable=a("gihud"),t.Duplex=a("jqAKP"),t.Transform=a("erC5i"),t.PassThrough=a("3dCe5"),t.finished=a("j5ZwK"),t.pipeline=a("azGNy")})),a.register("kZTRI",(function(e,n){var r,o=a("ePtPP");e.exports=A,A.ReadableState=E;a("3oV8N").EventEmitter;var i=function(e,t){return e.listeners(t).length},s=a("3vqBO"),l=a("bqBrJ").Buffer,c=t.Uint8Array||function(){};var u,d=a("1DJXa");u=d&&d.debuglog?d.debuglog("stream"):function(){};var f,h,p,m=a("k9Eb1"),g=a("6hWXN"),v=a("56mX2").getHighWaterMark,b=a("aOgJu").codes,y=b.ERR_INVALID_ARG_TYPE,w=b.ERR_STREAM_PUSH_AFTER_EOF,x=b.ERR_METHOD_NOT_IMPLEMENTED,S=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;a("5jAh8")(A,s);var M=g.errorOrDestroy,_=["error","close","destroy","pause","resume"];function E(e,t,n){r=r||a("jqAKP"),e=e||{},"boolean"!=typeof n&&(n=t instanceof r),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",n),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=a("28kcI").StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function A(e){if(r=r||a("jqAKP"),!(this instanceof A))return new A(e);var t=this instanceof r;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function C(e,t,n,r,o){u("readableAddChunk",t);var i,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,R(e)))}(e,a);else if(o||(i=function(e,t){var n;r=t,l.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],t));var r;return n}(a,t)),i)M(e,i);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r)a.endEmitted?M(e,new S):k(e,a,t,!0);else if(a.ended)M(e,new w);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?k(e,a,t,!1):P(e,a)):k(e,a,t,!1)}else r||(a.reading=!1,P(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function k(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&O(e)),P(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=g.destroy,A.prototype._undestroy=g.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=l.from(e,t),t=""),n=!0),C(this,e,t,!1,n)},A.prototype.unshift=function(e){return C(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(e){f||(f=a("28kcI").StringDecoder);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var T=1073741824;function I(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,o.nextTick(R,e))}function R(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,j(e)}function P(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(N,e,t))}function N(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(u("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function L(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function B(e){u("readable nexttick read 0"),e.read(0)}function D(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function z(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(U,t,e))}function U(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function H(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}A.prototype.read=function(e){u("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?z(this):O(this),null;if(0===(e=I(e,t))&&t.ended)return 0===t.length&&z(this),null;var r,o=t.needReadable;return u("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&u("length less than watermark",o=!0),t.ended||t.reading?u("reading or ended",o=!1):o&&(u("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=I(n,t))),null===(r=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&z(this)),null!==r&&this.emit("data",r),r},A.prototype._read=function(e){M(this,new x("_read()"))},A.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,u("pipe count=%d opts=%j",r.pipesCount,t);var a=(!t||!1!==t.end)&&e!==o.stdout&&e!==o.stderr?l:g;function s(t,o){u("onunpipe"),t===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",g),n.removeListener("data",f),d=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function l(){u("onend"),e.end()}r.endEmitted?o.nextTick(a):n.once("end",a),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,j(e))}}(n);e.on("drain",c);var d=!1;function f(t){u("ondata");var o=e.write(t);u("dest.write",o),!1===o&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==H(r.pipes,e))&&!d&&(u("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function h(t){u("onerror",t),g(),e.removeListener("error",h),0===i(e,"error")&&M(e,t)}function p(){e.removeListener("finish",m),g()}function m(){u("onfinish"),e.removeListener("close",p),g()}function g(){u("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",p),e.once("finish",m),e.emit("pipe",n),r.flowing||(u("pipe resume"),n.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=H(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},A.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,u("on readable",r.length,r.reading),r.length?O(this):r.reading||o.nextTick(B,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&o.nextTick(L,this),n},A.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||o.nextTick(L,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(D,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",(function(){if(u("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){(u("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<_.length;i++)e.on(_[i],this.emit.bind(this,_[i]));return this._read=function(t){u("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=a("5gKYZ")),h(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=F,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(e,t){return void 0===p&&(p=a("8igDo")),p(A,e,t)})})),a.register("3oV8N",(function(e,t){"use strict";var n,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}g(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,n)}(e,o,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,n,r){var o,i,a,s;if(l(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=c(e))>0&&a.length>o&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=d.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):m(o,o.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return c(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var c=l.length,u=m(l,c);for(n=0;n<c;++n)o(u[n],this,t)}return!0},a.prototype.addListener=function(e,t){return u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(this,e,t,!0)},a.prototype.once=function(e,t){return l(t),this.on(e,f(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,f(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,o,i,a;if(l(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return h(this,e,!0)},a.prototype.rawListeners=function(e){return h(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}})),a.register("3vqBO",(function(e,t){e.exports=a("3oV8N").EventEmitter})),a.register("k9Eb1",(function(e,t){"use strict";function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=a("bqBrJ").Buffer,s=a("1DJXa").inspect,l=s&&s.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,a,c;return t=e,a=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var t,n,r,o=i.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=o,r=s,i.prototype.copy.call(t,n,r),s+=a.data.length,a=a.next;return o}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?r+=o:r+=o.slice(0,e),0==(e-=i)){i===o.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=i.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,a),0==(e-=a)){a===o.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++r}return this.length-=r,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],a&&o(t.prototype,a),c&&o(t,c),e}()})),a.register("6hWXN",(function(e,t){var n=a("ePtPP");function r(e,t){i(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var a=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(i,this,e)):n.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?a._writableState?a._writableState.errorEmitted?n.nextTick(o,a):(a._writableState.errorEmitted=!0,n.nextTick(r,a,e)):n.nextTick(r,a,e):t?(n.nextTick(o,a),t(e)):n.nextTick(o,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}})),a.register("56mX2",(function(e,t){"use strict";var n=a("aOgJu").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,o){var i=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(o?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}})),a.register("aOgJu",(function(t,n){var r;e(t.exports,"codes",(()=>r),(e=>r=e));var o={};function i(e,t,n){n||(n=Error);var r=function(e){var n,r;function o(n,r,o){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,o))||this}return r=e,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,o}(n);r.prototype.name=n.name,r.prototype.code=e,o[e]=r}function a(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,o,i,s;if("string"==typeof t&&(o="not ",t.substr(!i||i<0?0:+i,o.length)===o)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))s="The ".concat(e," ").concat(r," ").concat(a(t,"type"));else{var l=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(r," ").concat(a(t,"type"))}return s+=". Received type ".concat(typeof n)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),r=o})),a.register("jqAKP",(function(e,t){var n=a("ePtPP"),r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=u;var o=a("kZTRI"),i=a("gihud");a("5jAh8")(u,o);for(var s=r(i.prototype),l=0;l<s.length;l++){var c=s[l];u.prototype[c]||(u.prototype[c]=i.prototype[c])}function u(e){if(!(this instanceof u))return new u(e);o.call(this,e),i.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",d)))}function d(){this._writableState.ended||n.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})})),a.register("gihud",(function(e,n){var r,o=a("ePtPP");function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=A,A.WritableState=E;var s={deprecate:a("aAtir")},l=a("3vqBO"),c=a("bqBrJ").Buffer,u=t.Uint8Array||function(){};var d,f=a("6hWXN"),h=a("56mX2").getHighWaterMark,p=a("aOgJu").codes,m=p.ERR_INVALID_ARG_TYPE,g=p.ERR_METHOD_NOT_IMPLEMENTED,v=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,y=p.ERR_STREAM_DESTROYED,w=p.ERR_STREAM_NULL_VALUES,x=p.ERR_STREAM_WRITE_AFTER_END,S=p.ERR_UNKNOWN_ENCODING,M=f.errorOrDestroy;function _(){}function E(e,t,n){r=r||a("jqAKP"),e=e||{},"boolean"!=typeof n&&(n=t instanceof r),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new v;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(o.nextTick(i,r),o.nextTick(R,e,t),e._writableState.errorEmitted=!0,M(e,r)):(i(r),e._writableState.errorEmitted=!0,M(e,r),R(e,t))}(e,n,r,t,i);else{var a=I(n)||e.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||T(e,n),r?o.nextTick(k,e,n,a,i):k(e,n,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function A(e){var t=this instanceof(r=r||a("jqAKP"));if(!t&&!d.call(A,this))return new A(e);this._writableState=new E(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function C(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function k(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),R(e,t)}function T(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,l=!0;n;)o[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;o.allBuffers=l,C(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,d=n.callback;if(C(e,t,!1,t.objectMode?1:c.length,c,u,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function I(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(n){t.pendingcb--,n&&M(e,n),t.prefinished=!0,e.emit("prefinish"),R(e,t)}))}function R(e,t){var n=I(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}a("5jAh8")(A,l),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===A&&(e&&e._writableState instanceof E)}})):d=function(e){return e instanceof this},A.prototype.pipe=function(){M(this,new b)},A.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(r=e,c.isBuffer(r)||r instanceof u);return s&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=_),i.ending?function(e,t){var n=new x;M(e,n),o.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i;return null===n?i=new w:"string"==typeof n||t.objectMode||(i=new m("chunk",["string","Buffer"],n)),!i||(M(e,i),o.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var l=t.length<t.highWaterMark;l||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,s,r,o,i);return l}(this,i,s,e,t,n)),a},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new S(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,n){n(new g("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,R(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=f.destroy,A.prototype._undestroy=f.undestroy,A.prototype._destroy=function(e,t){t(e)}})),a.register("aAtir",(function(e,n){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}})),a.register("28kcI",(function(t,n){var r;e(t.exports,"StringDecoder",(()=>r),(e=>r=e));var o=a("8ByQm").Buffer,i=o.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(o.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=d,t=4;break;case"utf8":this.fillLast=c,t=4;break;case"base64":this.text=f,this.end=h,t=3;break;default:return this.write=p,void(this.end=m)}this.lastNeed=0,this.lastTotal=0,this.lastChar=o.allocUnsafe(t)}function l(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function f(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function m(e){return e&&e.length?this.write(e):""}r=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var o=l(t[r]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--r<n||-2===o)return 0;if(o=l(t[r]),o>=0)return o>0&&(e.lastNeed=o-2),o;if(--r<n||-2===o)return 0;if(o=l(t[r]),o>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}})),a.register("8ByQm",(function(e,t){
50
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var r,o;e(t.exports,"read",(()=>r),(e=>r=e)),e(t.exports,"write",(()=>o),(e=>o=e)),r=function(e,t,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,c=l>>1,u=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+d],d+=f,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=f,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},o=function(e,t,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,d=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+d>=1?f/l:f*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*m}})),a.register("9gzJO",(function(e,t){var n=a("ePtPP"),r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},o=/%[sdj%]/g;e.exports.format=function(e){if(!b(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(l(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,a=String(e).replace(o,(function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),s=r[n];n<i;s=r[++n])g(s)||!x(s)?a+=" "+s:a+=" "+l(s);return a},e.exports.deprecate=function(t,r){if(void 0!==n&&!0===n.noDeprecation)return t;if(void 0===n)return function(){return e.exports.deprecate(t,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),o=!0}return t.apply(this,arguments)}};var i={},s=/^$/;function l(t,n){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&e.exports._extend(r,n),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),d(r,t,r.depth)}function c(e,t){var n=l.styles[t];return n?"["+l.colors[n][0]+"m"+e+"["+l.colors[n][1]+"m":e}function u(e,t){return e}function d(t,n,r){if(t.customInspect&&n&&_(n.inspect)&&n.inspect!==e.exports.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,t);return b(o)||(o=d(t,o,r)),o}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(v(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(t,n);if(i)return i;var a=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),M(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(_(n)){var l=n.name?": "+n.name:"";return t.stylize("[Function"+l+"]","special")}if(w(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(S(n))return t.stylize(Date.prototype.toString.call(n),"date");if(M(n))return f(n)}var c,u="",x=!1,E=["{","}"];(p(n)&&(x=!0,E=["[","]"]),_(n))&&(u=" [Function"+(n.name?": "+n.name:"")+"]");return w(n)&&(u=" "+RegExp.prototype.toString.call(n)),S(n)&&(u=" "+Date.prototype.toUTCString.call(n)),M(n)&&(u=" "+f(n)),0!==a.length||x&&0!=n.length?r<0?w(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),c=x?function(e,t,n,r,o){for(var i=[],a=0,s=t.length;a<s;++a)T(t,String(a))?i.push(h(e,t,n,r,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(h(e,t,n,r,o,!0))})),i}(t,n,r,s,a):a.map((function(e){return h(t,n,r,s,e,x)})),t.seen.pop(),function(e,t,n){var r=e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return r>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(c,u,E)):E[0]+u+E[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,o,i){var a,s,l;if((l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),T(r,o)||(a="["+o+"]"),s||(e.seen.indexOf(l.value)<0?(s=g(n)?d(e,l.value,null):d(e,l.value,n-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function v(e){return"number"==typeof e}function b(e){return"string"==typeof e}function y(e){return void 0===e}function w(e){return x(e)&&"[object RegExp]"===E(e)}function x(e){return"object"==typeof e&&null!==e}function S(e){return x(e)&&"[object Date]"===E(e)}function M(e){return x(e)&&("[object Error]"===E(e)||e instanceof Error)}function _(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}e.exports.debuglog=function(t){if(t=t.toUpperCase(),!i[t])if(s.test(t)){var r=n.pid;i[t]=function(){var n=e.exports.format.apply(e.exports,arguments);console.error("%s %d: %s",t,r,n)}}else i[t]=function(){};return i[t]},e.exports.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.exports.types=a("bM5Oe"),e.exports.isArray=p,e.exports.isBoolean=m,e.exports.isNull=g,e.exports.isNullOrUndefined=function(e){return null==e},e.exports.isNumber=v,e.exports.isString=b,e.exports.isSymbol=function(e){return"symbol"==typeof e},e.exports.isUndefined=y,e.exports.isRegExp=w,e.exports.types.isRegExp=w,e.exports.isObject=x,e.exports.isDate=S,e.exports.types.isDate=S,e.exports.isError=M,e.exports.types.isNativeError=M,e.exports.isFunction=_,e.exports.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},e.exports.isBuffer=a("jPRhY");var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),C[e.getMonth()],t].join(" ")}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports.log=function(){console.log("%s - %s",k(),e.exports.format.apply(e.exports,arguments))},e.exports.inherits=a("5jAh8"),e.exports._extend=function(e,t){if(!t||!x(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}e.exports.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(I&&e[I]){var t;if("function"!=typeof(t=e[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,I,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,o)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),I&&Object.defineProperty(t,I,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,r(e))},e.exports.promisify.custom=I,e.exports.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,t).then((function(e){n.nextTick(a.bind(null,null,e))}),(function(e){n.nextTick(O.bind(null,e,a))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,r(e)),t}})),a.register("ePtPP",(function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,c=[],u=!1,d=-1;function f(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&h())}function h(){if(!u){var e=s(f);u=!0;for(var t=c.length;t;){for(l=c,c=[];++d<t;)l&&l[d].run();d=-1,t=c.length}l=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||u||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}})),a.register("bM5Oe",(function(e,t){"use strict";var n=a("3vY4Y"),r=a("jgq2W"),o=a("8yoeR"),i=a("doLxT");function s(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=s(Object.prototype.toString),d=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),h=s(Boolean.prototype.valueOf);if(l)var p=s(BigInt.prototype.valueOf);if(c)var m=s(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function v(e){return"[object Map]"===u(e)}function b(e){return"[object Set]"===u(e)}function y(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function x(e){return"[object ArrayBuffer]"===u(e)}function S(e){return"undefined"!=typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function M(e){return"[object DataView]"===u(e)}function _(e){return"undefined"!=typeof DataView&&(M.working?M(e):e instanceof DataView)}e.exports.isArgumentsObject=n,e.exports.isGeneratorFunction=r,e.exports.isTypedArray=i,e.exports.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},e.exports.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):i(e)||_(e)},e.exports.isUint8Array=function(e){return"Uint8Array"===o(e)},e.exports.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},e.exports.isUint16Array=function(e){return"Uint16Array"===o(e)},e.exports.isUint32Array=function(e){return"Uint32Array"===o(e)},e.exports.isInt8Array=function(e){return"Int8Array"===o(e)},e.exports.isInt16Array=function(e){return"Int16Array"===o(e)},e.exports.isInt32Array=function(e){return"Int32Array"===o(e)},e.exports.isFloat32Array=function(e){return"Float32Array"===o(e)},e.exports.isFloat64Array=function(e){return"Float64Array"===o(e)},e.exports.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},e.exports.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},v.working="undefined"!=typeof Map&&v(new Map),e.exports.isMap=function(e){return"undefined"!=typeof Map&&(v.working?v(e):e instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),e.exports.isSet=function(e){return"undefined"!=typeof Set&&(b.working?b(e):e instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),e.exports.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(y.working?y(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.exports.isWeakSet=function(e){return w(e)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),e.exports.isArrayBuffer=S,M.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&M(new DataView(new ArrayBuffer(1),0,1)),e.exports.isDataView=_;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(e){return"[object SharedArrayBuffer]"===u(e)}function C(e){return void 0!==E&&(void 0===A.working&&(A.working=A(new E)),A.working?A(e):e instanceof E)}function k(e){return g(e,d)}function T(e){return g(e,f)}function I(e){return g(e,h)}function O(e){return l&&g(e,p)}function R(e){return c&&g(e,m)}e.exports.isSharedArrayBuffer=C,e.exports.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},e.exports.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},e.exports.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},e.exports.isGeneratorObject=function(e){return"[object Generator]"===u(e)},e.exports.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},e.exports.isNumberObject=k,e.exports.isStringObject=T,e.exports.isBooleanObject=I,e.exports.isBigIntObject=O,e.exports.isSymbolObject=R,e.exports.isBoxedPrimitive=function(e){return k(e)||T(e)||I(e)||O(e)||R(e)},e.exports.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(S(e)||C(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e.exports,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))})),a.register("3vY4Y",(function(e,t){"use strict";var n=a("gp4q4")(),r=a("6pFFa")("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===r(e)},i=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==r(e)&&"[object Function]"===r(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=i,e.exports=s?o:i})),a.register("gp4q4",(function(e,t){"use strict";var n=a("fPlzF");e.exports=function(){return n()&&!!Symbol.toStringTag}})),a.register("fPlzF",(function(e,t){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}})),a.register("6pFFa",(function(e,t){"use strict";var n=a("3kYrO"),r=a("1Mwz1"),o=r(n("String.prototype.indexOf"));e.exports=function(e,t){var i=n(e,!!t);return"function"==typeof i&&o(e,".prototype.")>-1?r(i):i}})),a.register("3kYrO",(function(e,t){"use strict";var n,r=SyntaxError,o=Function,i=TypeError,s=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(e){l=null}var c=function(){throw new i},u=l?function(){try{return c}catch(e){try{return l(arguments,"callee").get}catch(e){return c}}}():c,d=a("l5rv7")(),f=Object.getPrototypeOf||function(e){return e.__proto__},h={},p="undefined"==typeof Uint8Array?n:f(Uint8Array),m={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":d?f([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":d?f(f([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&d?f((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&d?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d?f(""[Symbol.iterator]()):n,"%Symbol%":d?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":u,"%TypedArray%":p,"%TypeError%":i,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function e(t){var n;if("%AsyncFunction%"===t)n=s("async function () {}");else if("%GeneratorFunction%"===t)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=s("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=f(o.prototype))}return m[t]=n,n},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=a("2JiOr"),y=a("c5f2w"),w=b.call(Function.call,Array.prototype.concat),x=b.call(Function.apply,Array.prototype.splice),S=b.call(Function.call,String.prototype.replace),M=b.call(Function.call,String.prototype.slice),_=b.call(Function.call,RegExp.prototype.exec),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,C=function(e){var t=M(e,0,1),n=M(e,-1);if("%"===t&&"%"!==n)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new r("invalid intrinsic syntax, expected opening `%`");var o=[];return S(e,E,(function(e,t,n,r){o[o.length]=n?S(r,A,"$1"):t||e})),o},k=function(e,t){var n,o=e;if(y(v,o)&&(o="%"+(n=v[o])[0]+"%"),y(m,o)){var a=m[o];if(a===h&&(a=g(o)),void 0===a&&!t)throw new i("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:a}}throw new r("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new i('"allowMissing" argument must be a boolean');if(null===_(/^%?[^%]*%?$/,e))throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=C(e),o=n.length>0?n[0]:"",a=k("%"+o+"%",t),s=a.name,c=a.value,u=!1,d=a.alias;d&&(o=d[0],x(n,w([0,1],d)));for(var f=1,h=!0;f<n.length;f+=1){var p=n[f],g=M(p,0,1),v=M(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===v||"'"===v||"`"===v)&&g!==v)throw new r("property names with quotes must have matching quotes");if("constructor"!==p&&h||(u=!0),y(m,s="%"+(o+="."+p)+"%"))c=m[s];else if(null!=c){if(!(p in c)){if(!t)throw new i("base intrinsic for "+e+" exists, but the property is not available.");return}if(l&&f+1>=n.length){var b=l(c,p);c=(h=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:c[p]}else h=y(c,p),c=c[p];h&&!u&&(m[s]=c)}}return c}})),a.register("l5rv7",(function(e,t){"use strict";var n="undefined"!=typeof Symbol&&Symbol,r=a("fPlzF");e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&r())))}})),a.register("2JiOr",(function(e,t){"use strict";var n=a("5DpJt");e.exports=Function.prototype.bind||n})),a.register("5DpJt",(function(e,t){"use strict";var n="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,o=Object.prototype.toString,i="[object Function]";e.exports=function(e){var t=this;if("function"!=typeof t||o.call(t)!==i)throw new TypeError(n+t);for(var a,s=r.call(arguments,1),l=function(){if(this instanceof a){var n=t.apply(this,s.concat(r.call(arguments)));return Object(n)===n?n:this}return t.apply(e,s.concat(r.call(arguments)))},c=Math.max(0,t.length-s.length),u=[],d=0;d<c;d++)u.push("$"+d);if(a=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(l),t.prototype){var f=function(){};f.prototype=t.prototype,a.prototype=new f,f.prototype=null}return a}})),a.register("c5f2w",(function(e,t){"use strict";var n=a("2JiOr");e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)})),a.register("1Mwz1",(function(e,t){"use strict";var n=a("2JiOr"),r=a("3kYrO"),o=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||n.call(i,o),l=r("%Object.getOwnPropertyDescriptor%",!0),c=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=s(n,i,arguments);if(l&&c){var r=l(t,"length");r.configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var d=function(){return s(n,o,arguments)};c?c(e.exports,"apply",{value:d}):e.exports.apply=d})),a.register("jgq2W",(function(e,t){"use strict";var n,r=Object.prototype.toString,o=Function.prototype.toString,i=/^\s*(?:function)?\*/,s=a("gp4q4")(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(i.test(o.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===r.call(e);if(!l)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&l(t)}return l(e)===n}})),a.register("8yoeR",(function(e,n){"use strict";var r=a("kz55o"),o=a("5gqKI"),i=a("6pFFa"),s=a("8WWik"),l=i("Object.prototype.toString"),c=a("gp4q4")(),u="undefined"==typeof globalThis?t:globalThis,d=o(),f=i("String.prototype.slice"),h={},p=Object.getPrototypeOf;c&&s&&p&&r(d,(function(e){if("function"==typeof u[e]){var t=new u[e];if(Symbol.toStringTag in t){var n=p(t),r=s(n,Symbol.toStringTag);if(!r){var o=p(n);r=s(o,Symbol.toStringTag)}h[e]=r.get}}}));var m=a("doLxT");e.exports=function(e){return!!m(e)&&(c&&Symbol.toStringTag in e?function(e){var t=!1;return r(h,(function(n,r){if(!t)try{var o=n.call(e);o===r&&(t=o)}catch(e){}})),t}(e):f(l(e),8,-1))}})),a.register("kz55o",(function(e,t){"use strict";var n=a("4Z0y4"),r=Object.prototype.toString,o=Object.prototype.hasOwnProperty,i=function(e,t,n){for(var r=0,i=e.length;r<i;r++)o.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))},s=function(e,t,n){for(var r=0,o=e.length;r<o;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)},l=function(e,t,n){for(var r in e)o.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))};e.exports=function(e,t,o){if(!n(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=o),"[object Array]"===r.call(e)?i(e,t,a):"string"==typeof e?s(e,t,a):l(e,t,a)}})),a.register("4Z0y4",(function(e,t){"use strict";var n,r,o=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,n)}catch(e){e!==r&&(i=null)}else i=null;var a=/^\s*class\b/,s=function(e){try{var t=o.call(e);return a.test(t)}catch(e){return!1}},l=function(e){try{return!s(e)&&(o.call(e),!0)}catch(e){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,d=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var h=document.all;c.call(h)===c.call(document.all)&&(f=function(e){if((d||!e)&&(void 0===e||"object"==typeof e))try{var t=c.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,n)}catch(e){if(e!==r)return!1}return!s(e)&&l(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(u)return l(e);if(s(e))return!1;var t=c.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&l(e)}})),a.register("5gqKI",(function(e,n){"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],o="undefined"==typeof globalThis?t:globalThis;e.exports=function(){for(var e=[],t=0;t<r.length;t++)"function"==typeof o[r[t]]&&(e[e.length]=r[t]);return e}})),a.register("8WWik",(function(e,t){"use strict";var n=a("3kYrO")("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n})),a.register("doLxT",(function(e,n){"use strict";var r=a("kz55o"),o=a("5gqKI"),i=a("6pFFa"),s=i("Object.prototype.toString"),l=a("gp4q4")(),c=a("8WWik"),u="undefined"==typeof globalThis?t:globalThis,d=o(),f=i("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},h=i("String.prototype.slice"),p={},m=Object.getPrototypeOf;l&&c&&m&&r(d,(function(e){var t=new u[e];if(Symbol.toStringTag in t){var n=m(t),r=c(n,Symbol.toStringTag);if(!r){var o=m(n);r=c(o,Symbol.toStringTag)}p[e]=r.get}}));e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!l||!(Symbol.toStringTag in e)){var t=h(s(e),8,-1);return f(d,t)>-1}return!!c&&function(e){var t=!1;return r(p,(function(n,r){if(!t)try{t=n.call(e)===r}catch(e){}})),t}(e)}})),a.register("jPRhY",(function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}})),a.register("5jAh8",(function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),a.register("fnFC9",(function(e,n){var r=a("fB4ch"),o=a("9QxiN"),i=a("iCrCa"),s=a("7X2JB"),l=a("8iXHm"),c=e.exports;c.request=function(e,n){e="string"==typeof e?l.parse(e):i(e);var o=-1===t.location.protocol.search(/^https?:$/)?"http:":"",a=e.protocol||o,s=e.hostname||e.host,c=e.port,u=e.path||"/";s&&-1!==s.indexOf(":")&&(s="["+s+"]"),e.url=(s?a+"//"+s:"")+(c?":"+c:"")+u,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var d=new r(e);return n&&d.on("response",n),d},c.get=function(e,t){var n=c.request(e,t);return n.end(),n},c.ClientRequest=r,c.IncomingMessage=o.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=s,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]})),a.register("fB4ch",(function(e,n){var r=a("ePtPP"),o=a("bqBrJ").Buffer,i=a("7lggT"),s=a("5jAh8"),l=a("9QxiN"),c=a("8IqCp"),u=l.IncomingMessage,d=l.readyStates;var f=e.exports=function(e){var t,n=this;c.Writable.call(n),n._opts=e,n._body=[],n._headers={},e.auth&&n.setHeader("Authorization","Basic "+o.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){n.setHeader(t,e.headers[t])}));var r=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!i.abortController)r=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!i.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}n._mode=function(e,t){return i.fetch&&t?"fetch":i.mozchunkedarraybuffer?"moz-chunked-arraybuffer":i.msstream?"ms-stream":i.arraybuffer&&e?"arraybuffer":"text"}(t,r),n._fetchTimer=null,n._socketTimeout=null,n._socketTimer=null,n.on("finish",(function(){n._onFinish()}))};s(f,c.Writable),f.prototype.setHeader=function(e,t){var n=e.toLowerCase();-1===h.indexOf(n)&&(this._headers[n]={name:e,value:t})},f.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},f.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},f.prototype._onFinish=function(){var e=this;if(!e._destroyed){var n=e._opts;"timeout"in n&&0!==n.timeout&&e.setTimeout(n.timeout);var o=e._headers,a=null;"GET"!==n.method&&"HEAD"!==n.method&&(a=new Blob(e._body,{type:(o["content-type"]||{}).value||""}));var s=[];if(Object.keys(o).forEach((function(e){var t=o[e].name,n=o[e].value;Array.isArray(n)?n.forEach((function(e){s.push([t,e])})):s.push([t,n])})),"fetch"===e._mode){var l=null;if(i.abortController){var c=new AbortController;l=c.signal,e._fetchAbortController=c,"requestTimeout"in n&&0!==n.requestTimeout&&(e._fetchTimer=t.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),n.requestTimeout))}t.fetch(e._opts.url,{method:e._opts.method,headers:s,body:a||void 0,mode:"cors",credentials:n.withCredentials?"include":"same-origin",signal:l}).then((function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()}),(function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)}))}else{var u=e._xhr=new t.XMLHttpRequest;try{u.open(e._opts.method,e._opts.url,!0)}catch(t){return void r.nextTick((function(){e.emit("error",t)}))}"responseType"in u&&(u.responseType=e._mode),"withCredentials"in u&&(u.withCredentials=!!n.withCredentials),"text"===e._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in n&&(u.timeout=n.requestTimeout,u.ontimeout=function(){e.emit("requestTimeout")}),s.forEach((function(e){u.setRequestHeader(e[0],e[1])})),e._response=null,u.onreadystatechange=function(){switch(u.readyState){case d.LOADING:case d.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(u.onprogress=function(){e._onXHRProgress()}),u.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{u.send(a)}catch(t){return void r.nextTick((function(){e.emit("error",t)}))}}}},f.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},f.prototype._connect=function(){var e=this;e._destroyed||(e._response=new u(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},f.prototype._write=function(e,t,n){this._body.push(e),n()},f.prototype._resetTimers=function(e){var n=this;t.clearTimeout(n._socketTimer),n._socketTimer=null,e?(t.clearTimeout(n._fetchTimer),n._fetchTimer=null):n._socketTimeout&&(n._socketTimer=t.setTimeout((function(){n.emit("timeout")}),n._socketTimeout))},f.prototype.abort=f.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)},f.prototype.end=function(e,t,n){"function"==typeof e&&(n=e,e=void 0),c.Writable.prototype.end.call(this,e,t,n)},f.prototype.setTimeout=function(e,t){var n=this;t&&n.once("timeout",t),n._socketTimeout=e,n._resetTimers(!1)},f.prototype.flushHeaders=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var h=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]})),a.register("7lggT",(function(n,r){var o,i,a,s,l,c,u,d;function f(){if(void 0!==d)return d;if(t.XMLHttpRequest){d=new t.XMLHttpRequest;try{d.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(e){d=null}}else d=null;return d}function h(e){var t=f();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function p(e){return"function"==typeof e}e(n.exports,"fetch",(()=>o),(e=>o=e)),e(n.exports,"writableStream",(()=>i),(e=>i=e)),e(n.exports,"abortController",(()=>a),(e=>a=e)),e(n.exports,"arraybuffer",(()=>s),(e=>s=e)),e(n.exports,"msstream",(()=>l),(e=>l=e)),e(n.exports,"mozchunkedarraybuffer",(()=>c),(e=>c=e)),e(n.exports,"overrideMimeType",(()=>u),(e=>u=e)),o=p(t.fetch)&&p(t.ReadableStream),i=p(t.WritableStream),a=p(t.AbortController),s=o||h("arraybuffer"),l=!o&&h("ms-stream"),c=!o&&h("moz-chunked-arraybuffer"),u=o||!!f()&&p(f().overrideMimeType),d=null})),a.register("9QxiN",(function(n,r){var o,i;e(n.exports,"readyStates",(()=>o),(e=>o=e)),e(n.exports,"IncomingMessage",(()=>i),(e=>i=e));var s=a("bqBrJ").Buffer,l=a("ePtPP"),c=a("7lggT"),u=a("5jAh8"),d=a("8IqCp"),f=o={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},h=i=function(e,t,n,r){var o=this;if(d.Readable.call(o),o._mode=n,o.headers={},o.rawHeaders=[],o.trailers={},o.rawTrailers=[],o.on("end",(function(){l.nextTick((function(){o.emit("close")}))})),"fetch"===n){if(o._fetchResponse=t,o.url=t.url,o.statusCode=t.status,o.statusMessage=t.statusText,t.headers.forEach((function(e,t){o.headers[t.toLowerCase()]=e,o.rawHeaders.push(t,e)})),c.writableStream){var i=new WritableStream({write:function(e){return r(!1),new Promise((function(t,n){o._destroyed?n():o.push(s.from(e))?t():o._resumeFetch=t}))},close:function(){r(!0),o._destroyed||o.push(null)},abort:function(e){r(!0),o._destroyed||o.emit("error",e)}});try{return void t.body.pipeTo(i).catch((function(e){r(!0),o._destroyed||o.emit("error",e)}))}catch(e){}}var a=t.body.getReader();!function e(){a.read().then((function(t){o._destroyed||(r(t.done),t.done?o.push(null):(o.push(s.from(t.value)),e()))})).catch((function(e){r(!0),o._destroyed||o.emit("error",e)}))}()}else{if(o._xhr=e,o._pos=0,o.url=e.responseURL,o.statusCode=e.status,o.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===o.headers[n]&&(o.headers[n]=[]),o.headers[n].push(t[2])):void 0!==o.headers[n]?o.headers[n]+=", "+t[2]:o.headers[n]=t[2],o.rawHeaders.push(t[1],t[2])}})),o._charset="x-user-defined",!c.overrideMimeType){var u=o.rawHeaders["mime-type"];if(u){var f=u.match(/;\s*charset=([^;])(;|$)/);f&&(o._charset=f[1].toLowerCase())}o._charset||(o._charset="utf-8")}}};u(h,d.Readable),h.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},h.prototype._onXHRProgress=function(e){var n=this,r=n._xhr,o=null;switch(n._mode){case"text":if((o=r.responseText).length>n._pos){var i=o.substr(n._pos);if("x-user-defined"===n._charset){for(var a=s.alloc(i.length),l=0;l<i.length;l++)a[l]=255&i.charCodeAt(l);n.push(a)}else n.push(i,n._charset);n._pos=o.length}break;case"arraybuffer":if(r.readyState!==f.DONE||!r.response)break;o=r.response,n.push(s.from(new Uint8Array(o)));break;case"moz-chunked-arraybuffer":if(o=r.response,r.readyState!==f.LOADING||!o)break;n.push(s.from(new Uint8Array(o)));break;case"ms-stream":if(o=r.response,r.readyState!==f.LOADING)break;var c=new t.MSStreamReader;c.onprogress=function(){c.result.byteLength>n._pos&&(n.push(s.from(new Uint8Array(c.result.slice(n._pos)))),n._pos=c.result.byteLength)},c.onload=function(){e(!0),n.push(null)},c.readAsArrayBuffer(o)}n._xhr.readyState===f.DONE&&"ms-stream"!==n._mode&&(e(!0),n.push(null))}})),a.register("8IqCp",(function(e,t){(t=e.exports=a("kZTRI")).Stream=t,t.Readable=t,t.Writable=a("gihud"),t.Duplex=a("jqAKP"),t.Transform=a("erC5i"),t.PassThrough=a("3dCe5"),t.finished=a("j5ZwK"),t.pipeline=a("azGNy")})),a.register("kZTRI",(function(e,n){var r,o=a("ePtPP");e.exports=A,A.ReadableState=E;a("3oV8N").EventEmitter;var i=function(e,t){return e.listeners(t).length},s=a("3vqBO"),l=a("bqBrJ").Buffer,c=t.Uint8Array||function(){};var u,d=a("1DJXa");u=d&&d.debuglog?d.debuglog("stream"):function(){};var f,h,p,m=a("k9Eb1"),g=a("6hWXN"),v=a("56mX2").getHighWaterMark,b=a("aOgJu").codes,y=b.ERR_INVALID_ARG_TYPE,w=b.ERR_STREAM_PUSH_AFTER_EOF,x=b.ERR_METHOD_NOT_IMPLEMENTED,S=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;a("5jAh8")(A,s);var M=g.errorOrDestroy,_=["error","close","destroy","pause","resume"];function E(e,t,n){r=r||a("jqAKP"),e=e||{},"boolean"!=typeof n&&(n=t instanceof r),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",n),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=a("28kcI").StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function A(e){if(r=r||a("jqAKP"),!(this instanceof A))return new A(e);var t=this instanceof r;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function C(e,t,n,r,o){u("readableAddChunk",t);var i,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,R(e)))}(e,a);else if(o||(i=function(e,t){var n;r=t,l.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],t));var r;return n}(a,t)),i)M(e,i);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r)a.endEmitted?M(e,new S):k(e,a,t,!0);else if(a.ended)M(e,new w);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?k(e,a,t,!1):P(e,a)):k(e,a,t,!1)}else r||(a.reading=!1,P(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function k(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&O(e)),P(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=g.destroy,A.prototype._undestroy=g.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=l.from(e,t),t=""),n=!0),C(this,e,t,!1,n)},A.prototype.unshift=function(e){return C(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(e){f||(f=a("28kcI").StringDecoder);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var T=1073741824;function I(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,o.nextTick(R,e))}function R(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,j(e)}function P(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(N,e,t))}function N(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(u("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function L(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function B(e){u("readable nexttick read 0"),e.read(0)}function D(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function z(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(U,t,e))}function U(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function H(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}A.prototype.read=function(e){u("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?z(this):O(this),null;if(0===(e=I(e,t))&&t.ended)return 0===t.length&&z(this),null;var r,o=t.needReadable;return u("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&u("length less than watermark",o=!0),t.ended||t.reading?u("reading or ended",o=!1):o&&(u("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=I(n,t))),null===(r=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&z(this)),null!==r&&this.emit("data",r),r},A.prototype._read=function(e){M(this,new x("_read()"))},A.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,u("pipe count=%d opts=%j",r.pipesCount,t);var a=(!t||!1!==t.end)&&e!==o.stdout&&e!==o.stderr?l:g;function s(t,o){u("onunpipe"),t===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",g),n.removeListener("data",f),d=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function l(){u("onend"),e.end()}r.endEmitted?o.nextTick(a):n.once("end",a),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,j(e))}}(n);e.on("drain",c);var d=!1;function f(t){u("ondata");var o=e.write(t);u("dest.write",o),!1===o&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==H(r.pipes,e))&&!d&&(u("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function h(t){u("onerror",t),g(),e.removeListener("error",h),0===i(e,"error")&&M(e,t)}function p(){e.removeListener("finish",m),g()}function m(){u("onfinish"),e.removeListener("close",p),g()}function g(){u("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",p),e.once("finish",m),e.emit("pipe",n),r.flowing||(u("pipe resume"),n.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=H(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},A.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,u("on readable",r.length,r.reading),r.length?O(this):r.reading||o.nextTick(B,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&o.nextTick(L,this),n},A.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||o.nextTick(L,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(D,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",(function(){if(u("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){(u("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<_.length;i++)e.on(_[i],this.emit.bind(this,_[i]));return this._read=function(t){u("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=a("5gKYZ")),h(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=F,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(e,t){return void 0===p&&(p=a("8igDo")),p(A,e,t)})})),a.register("3oV8N",(function(e,t){"use strict";var n,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}g(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,n)}(e,o,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,n,r){var o,i,a,s;if(l(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=c(e))>0&&a.length>o&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=d.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):m(o,o.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return c(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var c=l.length,u=m(l,c);for(n=0;n<c;++n)o(u[n],this,t)}return!0},a.prototype.addListener=function(e,t){return u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(this,e,t,!0)},a.prototype.once=function(e,t){return l(t),this.on(e,f(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,f(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,o,i,a;if(l(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return h(this,e,!0)},a.prototype.rawListeners=function(e){return h(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}})),a.register("3vqBO",(function(e,t){e.exports=a("3oV8N").EventEmitter})),a.register("k9Eb1",(function(e,t){"use strict";function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=a("bqBrJ").Buffer,s=a("1DJXa").inspect,l=s&&s.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,a,c;return t=e,a=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var t,n,r,o=i.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=o,r=s,i.prototype.copy.call(t,n,r),s+=a.data.length,a=a.next;return o}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?r+=o:r+=o.slice(0,e),0==(e-=i)){i===o.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=i.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,a),0==(e-=a)){a===o.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++r}return this.length-=r,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],a&&o(t.prototype,a),c&&o(t,c),e}()})),a.register("6hWXN",(function(e,t){var n=a("ePtPP");function r(e,t){i(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var a=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(i,this,e)):n.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?a._writableState?a._writableState.errorEmitted?n.nextTick(o,a):(a._writableState.errorEmitted=!0,n.nextTick(r,a,e)):n.nextTick(r,a,e):t?(n.nextTick(o,a),t(e)):n.nextTick(o,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}})),a.register("56mX2",(function(e,t){"use strict";var n=a("aOgJu").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,o){var i=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(o?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}})),a.register("aOgJu",(function(t,n){var r;e(t.exports,"codes",(()=>r),(e=>r=e));var o={};function i(e,t,n){n||(n=Error);var r=function(e){var n,r;function o(n,r,o){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,o))||this}return r=e,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,o}(n);r.prototype.name=n.name,r.prototype.code=e,o[e]=r}function a(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,o,i,s;if("string"==typeof t&&(o="not ",t.substr(!i||i<0?0:+i,o.length)===o)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))s="The ".concat(e," ").concat(r," ").concat(a(t,"type"));else{var l=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(r," ").concat(a(t,"type"))}return s+=". Received type ".concat(typeof n)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),r=o})),a.register("jqAKP",(function(e,t){var n=a("ePtPP"),r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=u;var o=a("kZTRI"),i=a("gihud");a("5jAh8")(u,o);for(var s=r(i.prototype),l=0;l<s.length;l++){var c=s[l];u.prototype[c]||(u.prototype[c]=i.prototype[c])}function u(e){if(!(this instanceof u))return new u(e);o.call(this,e),i.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",d)))}function d(){this._writableState.ended||n.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})})),a.register("gihud",(function(e,n){var r,o=a("ePtPP");function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=A,A.WritableState=E;var s={deprecate:a("aAtir")},l=a("3vqBO"),c=a("bqBrJ").Buffer,u=t.Uint8Array||function(){};var d,f=a("6hWXN"),h=a("56mX2").getHighWaterMark,p=a("aOgJu").codes,m=p.ERR_INVALID_ARG_TYPE,g=p.ERR_METHOD_NOT_IMPLEMENTED,v=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,y=p.ERR_STREAM_DESTROYED,w=p.ERR_STREAM_NULL_VALUES,x=p.ERR_STREAM_WRITE_AFTER_END,S=p.ERR_UNKNOWN_ENCODING,M=f.errorOrDestroy;function _(){}function E(e,t,n){r=r||a("jqAKP"),e=e||{},"boolean"!=typeof n&&(n=t instanceof r),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new v;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(o.nextTick(i,r),o.nextTick(R,e,t),e._writableState.errorEmitted=!0,M(e,r)):(i(r),e._writableState.errorEmitted=!0,M(e,r),R(e,t))}(e,n,r,t,i);else{var a=I(n)||e.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||T(e,n),r?o.nextTick(k,e,n,a,i):k(e,n,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function A(e){var t=this instanceof(r=r||a("jqAKP"));if(!t&&!d.call(A,this))return new A(e);this._writableState=new E(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function C(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function k(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),R(e,t)}function T(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,l=!0;n;)o[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;o.allBuffers=l,C(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,d=n.callback;if(C(e,t,!1,t.objectMode?1:c.length,c,u,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function I(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(n){t.pendingcb--,n&&M(e,n),t.prefinished=!0,e.emit("prefinish"),R(e,t)}))}function R(e,t){var n=I(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}a("5jAh8")(A,l),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===A&&(e&&e._writableState instanceof E)}})):d=function(e){return e instanceof this},A.prototype.pipe=function(){M(this,new b)},A.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(r=e,c.isBuffer(r)||r instanceof u);return s&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=_),i.ending?function(e,t){var n=new x;M(e,n),o.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i;return null===n?i=new w:"string"==typeof n||t.objectMode||(i=new m("chunk",["string","Buffer"],n)),!i||(M(e,i),o.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var l=t.length<t.highWaterMark;l||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,s,r,o,i);return l}(this,i,s,e,t,n)),a},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new S(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,n){n(new g("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,R(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=f.destroy,A.prototype._undestroy=f.undestroy,A.prototype._destroy=function(e,t){t(e)}})),a.register("aAtir",(function(e,n){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}})),a.register("28kcI",(function(t,n){var r;e(t.exports,"StringDecoder",(()=>r),(e=>r=e));var o=a("8ByQm").Buffer,i=o.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(o.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=d,t=4;break;case"utf8":this.fillLast=c,t=4;break;case"base64":this.text=f,this.end=h,t=3;break;default:return this.write=p,void(this.end=m)}this.lastNeed=0,this.lastTotal=0,this.lastChar=o.allocUnsafe(t)}function l(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function f(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function m(e){return e&&e.length?this.write(e):""}r=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var o=l(t[r]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--r<n||-2===o)return 0;if(o=l(t[r]),o>=0)return o>0&&(e.lastNeed=o-2),o;if(--r<n||-2===o)return 0;if(o=l(t[r]),o>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}})),a.register("8ByQm",(function(e,t){
51
51
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
52
52
  var n=a("bqBrJ"),r=n.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function i(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,e.exports),e.exports.Buffer=i),i.prototype=Object.create(r.prototype),o(r,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var o=r(e);return void 0!==t?"string"==typeof n?o.fill(t,n):o.fill(t):o.fill(0),o},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}})),a.register("5gKYZ",(function(e,t){var n,r=a("ePtPP");function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=a("j5ZwK"),s=Symbol("lastResolve"),l=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),d=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function m(e){var t=e[s];if(null!==t){var n=e[h].read();null!==n&&(e[d]=null,e[s]=null,e[l]=null,t(p(n,!1)))}}function g(e){r.nextTick(m,e)}var v=Object.getPrototypeOf((function(){})),b=Object.setPrototypeOf((o(n={get stream(){return this[h]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(t,n){r.nextTick((function(){e[c]?n(e[c]):t(p(void 0,!0))}))}));var n,o=this[d];if(o)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[u]?n(p(void 0,!0)):t[f](n,r)}),r)}}(o,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(p(i,!1));n=new Promise(this[f])}return this[d]=n,n}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,n){e[h].destroy(null,(function(e){e?n(e):t(p(void 0,!0))}))}))})),n),v);e.exports=function(e){var t,n=Object.create(b,(o(t={},h,{value:e,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,u,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var r=n[h].read();r?(n[d]=null,n[s]=null,n[l]=null,e(p(r,!1))):(n[s]=e,n[l]=t)},writable:!0}),t));return n[d]=null,i(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[l];return null!==t&&(n[d]=null,n[s]=null,n[l]=null,t(e)),void(n[c]=e)}var r=n[s];null!==r&&(n[d]=null,n[s]=null,n[l]=null,r(p(void 0,!0))),n[u]=!0})),e.on("readable",g.bind(null,n)),n}})),a.register("j5ZwK",(function(e,t){"use strict";var n=a("aOgJu").codes.ERR_STREAM_PREMATURE_CLOSE;function r(){}e.exports=function e(t,o,i){if("function"==typeof o)return e(t,null,o);o||(o={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];e.apply(this,r)}}}(i||r);var a=o.readable||!1!==o.readable&&t.readable,s=o.writable||!1!==o.writable&&t.writable,l=function(){t.writable||u()},c=t._writableState&&t._writableState.finished,u=function(){s=!1,c=!0,a||i.call(t)},d=t._readableState&&t._readableState.endEmitted,f=function(){a=!1,d=!0,s||i.call(t)},h=function(e){i.call(t,e)},p=function(){var e;return a&&!d?(t._readableState&&t._readableState.ended||(e=new n),i.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new n),i.call(t,e)):void 0},m=function(){t.req.on("finish",u)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?s&&!t._writableState&&(t.on("end",l),t.on("close",l)):(t.on("complete",u),t.on("abort",p),t.req?m():t.on("request",m)),t.on("end",f),t.on("finish",u),!1!==o.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",u),t.removeListener("abort",p),t.removeListener("request",m),t.req&&t.req.removeListener("finish",u),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",u),t.removeListener("end",f),t.removeListener("error",h),t.removeListener("close",p)}}})),a.register("8igDo",(function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}})),a.register("erC5i",(function(e,t){"use strict";e.exports=u;var n=a("aOgJu").codes,r=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,i=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,l=a("jqAKP");function c(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new o);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);l.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,n){f(e,t,n)}))}function f(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new s;if(e._transformState.transforming)throw new i;return e.push(null)}a("5jAh8")(u,l),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,n){n(new r("_transform()"))},u.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,(function(e){t(e)}))}})),a.register("3dCe5",(function(e,t){"use strict";e.exports=r;var n=a("erC5i");function r(e){if(!(this instanceof r))return new r(e);n.call(this,e)}a("5jAh8")(r,n),r.prototype._transform=function(e,t,n){n(null,e)}})),a.register("azGNy",(function(e,t){"use strict";var n;var r=a("aOgJu").codes,o=r.ERR_MISSING_ARGS,i=r.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function l(e,t,r,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",(function(){s=!0})),void 0===n&&(n=a("j5ZwK")),n(e,{readable:t,writable:r},(function(e){if(e)return o(e);s=!0,o()}));var l=!1;return function(t){if(!s&&!l)return l=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new i("pipe"))}}function c(e){e()}function u(e,t){return e.pipe(t)}function d(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}e.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=d(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var a=t.map((function(e,n){var o=n<t.length-1;return l(e,o,n>0,(function(e){r||(r=e),e&&a.forEach(c),o||(a.forEach(c),i(r))}))}));return t.reduce(u)}})),a.register("iCrCa",(function(e,t){e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var o in r)n.call(r,o)&&(e[o]=r[o])}return e};var n=Object.prototype.hasOwnProperty})),a.register("7X2JB",(function(e,t){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}})),a.register("8iXHm",(function(t,n){var r;e(t.exports,"parse",(()=>r),(e=>r=e));var o=a("izynC"),i=a("f5Jlg");function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r=x;var l=/^([a-z0-9.+-]+:)/i,c=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(d),h=["%","/","?",";","#"].concat(f),p=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=a("WCmTO");function x(e,t,n){if(e&&i.isObject(e)&&e instanceof s)return e;var r=new s;return r.parse(e,t,n),r}s.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),a=-1!==r&&r<e.indexOf("#")?"?":"#",s=e.split(a);s[0]=s[0].replace(/\\/g,"/");var c=e=s.join(a);if(c=c.trim(),!n&&1===e.split("#").length){var d=u.exec(c);if(d)return this.path=c,this.href=c,this.pathname=d[1],d[2]?(this.search=d[2],this.query=t?w.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=l.exec(c);if(x){var S=(x=x[0]).toLowerCase();this.protocol=S,c=c.substr(x.length)}if(n||x||c.match(/^\/\/[^@\/]+@[^@\/]+/)){var M="//"===c.substr(0,2);!M||x&&b[x]||(c=c.substr(2),this.slashes=!0)}if(!b[x]&&(M||x&&!y[x])){for(var _,E,A=-1,C=0;C<p.length;C++){-1!==(k=c.indexOf(p[C]))&&(-1===A||k<A)&&(A=k)}-1!==(E=-1===A?c.lastIndexOf("@"):c.lastIndexOf("@",A))&&(_=c.slice(0,E),c=c.slice(E+1),this.auth=decodeURIComponent(_)),A=-1;for(C=0;C<h.length;C++){var k;-1!==(k=c.indexOf(h[C]))&&(-1===A||k<A)&&(A=k)}-1===A&&(A=c.length),this.host=c.slice(0,A),c=c.slice(A),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var I=this.hostname.split(/\./),O=(C=0,I.length);C<O;C++){var R=I[C];if(R&&!R.match(m)){for(var P="",N=0,L=R.length;N<L;N++)R.charCodeAt(N)>127?P+="x":P+=R[N];if(!P.match(m)){var B=I.slice(0,C),D=I.slice(C+1),j=R.match(g);j&&(B.push(j[1]),D.unshift(j[2])),D.length&&(c="/"+D.join(".")+c),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=o.toASCII(this.hostname));var F=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+F,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==c[0]&&(c="/"+c))}if(!v[S])for(C=0,O=f.length;C<O;C++){var U=f[C];if(-1!==c.indexOf(U)){var H=encodeURIComponent(U);H===U&&(H=escape(U)),c=c.split(U).join(H)}}var G=c.indexOf("#");-1!==G&&(this.hash=c.substr(G),c=c.slice(0,G));var W=c.indexOf("?");if(-1!==W?(this.search=c.substr(W),this.query=c.substr(W+1),t&&(this.query=w.parse(this.query)),c=c.slice(0,W)):t&&(this.search="",this.query={}),c&&(this.pathname=c),y[S]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){F=this.pathname||"";var V=this.search||"";this.path=F+V}return this.href=this.format(),this},s.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,a="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=w.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+r},s.prototype.resolve=function(e){return this.resolveObject(x(e,!1,!0)).format()},s.prototype.resolveObject=function(e){if(i.isString(e)){var t=new s;t.parse(e,!1,!0),e=t}for(var n=new s,r=Object.keys(this),o=0;o<r.length;o++){var a=r[o];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var l=Object.keys(e),c=0;c<l.length;c++){var u=l[c];"protocol"!==u&&(n[u]=e[u])}return y[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!y[e.protocol]){for(var d=Object.keys(e),f=0;f<d.length;f++){var h=d[f];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||b[e.protocol])n.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),n.pathname=p.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",g=n.search||"";n.path=m+g}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var v=n.pathname&&"/"===n.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),x=w||v||n.host&&e.pathname,S=x,M=n.pathname&&n.pathname.split("/")||[],_=(p=e.pathname&&e.pathname.split("/")||[],n.protocol&&!y[n.protocol]);if(_&&(n.hostname="",n.port=null,n.host&&(""===M[0]?M[0]=n.host:M.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),x=x&&(""===p[0]||""===M[0])),w)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,M=p;else if(p.length)M||(M=[]),M.pop(),M=M.concat(p),n.search=e.search,n.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(_)n.hostname=n.host=M.shift(),(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift());return n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!M.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=M.slice(-1)[0],A=(n.host||e.host||M.length>1)&&("."===E||".."===E)||""===E,C=0,k=M.length;k>=0;k--)"."===(E=M[k])?M.splice(k,1):".."===E?(M.splice(k,1),C++):C&&(M.splice(k,1),C--);if(!x&&!S)for(;C--;C)M.unshift("..");!x||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),A&&"/"!==M.join("/").substr(-1)&&M.push("");var T,I=""===M[0]||M[0]&&"/"===M[0].charAt(0);_&&(n.hostname=n.host=I?"":M.length?M.shift():"",(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift()));return(x=x||n.host&&M.length)&&!I&&M.unshift(""),M.length?n.pathname=M.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},s.prototype.parseHost=function(){var e=this.host,t=c.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}})),a.register("izynC",(function(e,n){!function(r){var o=n&&!n.nodeType&&n,i=e&&!e.nodeType&&e,a="object"==typeof t&&t;a.global!==a&&a.window!==a&&a.self!==a||(r=a);var s,l,c=2147483647,u=36,d=/^xn--/,f=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function v(e){throw new RangeError(p[e])}function b(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+b((e=e.replace(h,".")).split("."),t).join(".")}function w(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function x(e){return b(e,(function(e){var t="";return e>65535&&(t+=g((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=g(e)})).join("")}function S(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function M(e,t,n){var r=0;for(e=n?m(e/700):e>>1,e+=m(e/t);e>455;r+=u)e=m(e/35);return m(r+36*e/(e+38))}function _(e){var t,n,r,o,i,a,s,l,d,f,h,p=[],g=e.length,b=0,y=128,w=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&v("not-basic"),p.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<g;){for(i=b,a=1,s=u;o>=g&&v("invalid-input"),((l=(h=e.charCodeAt(o++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:u)>=u||l>m((c-b)/a))&&v("overflow"),b+=l*a,!(l<(d=s<=w?1:s>=w+26?26:s-w));s+=u)a>m(c/(f=u-d))&&v("overflow"),a*=f;w=M(b-i,t=p.length+1,0==i),m(b/t)>c-y&&v("overflow"),y+=m(b/t),b%=t,p.splice(b++,0,y)}return x(p)}function E(e){var t,n,r,o,i,a,s,l,d,f,h,p,b,y,x,_=[];for(p=(e=w(e)).length,t=128,n=0,i=72,a=0;a<p;++a)(h=e[a])<128&&_.push(g(h));for(r=o=_.length,o&&_.push("-");r<p;){for(s=c,a=0;a<p;++a)(h=e[a])>=t&&h<s&&(s=h);for(s-t>m((c-n)/(b=r+1))&&v("overflow"),n+=(s-t)*b,t=s,a=0;a<p;++a)if((h=e[a])<t&&++n>c&&v("overflow"),h==t){for(l=n,d=u;!(l<(f=d<=i?1:d>=i+26?26:d-i));d+=u)x=l-f,y=u-f,_.push(g(S(f+x%y,0))),l=m(x/y);_.push(g(S(l,0))),i=M(n,b,r==o),n=0,++r}++n,++t}return _.join("")}if(s={version:"1.4.1",ucs2:{decode:w,encode:x},decode:_,encode:E,toASCII:function(e){return y(e,(function(e){return f.test(e)?"xn--"+E(e):e}))},toUnicode:function(e){return y(e,(function(e){return d.test(e)?_(e.slice(4).toLowerCase()):e}))}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",(function(){return s}));else if(o&&i)if(e.exports==o)i.exports=s;else for(l in s)s.hasOwnProperty(l)&&(o[l]=s[l]);else r.punycode=s}(this)})),a.register("f5Jlg",(function(e,t){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}})),a.register("WCmTO",(function(t,n){var r,o;e(t.exports,"parse",(()=>r),(e=>r=e)),e(t.exports,"stringify",(()=>o),(e=>o=e)),r=a("irK6S"),o=a("h75Bs")})),a.register("irK6S",(function(e,t){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,o,i){t=t||"&",o=o||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var l=1e3;i&&"number"==typeof i.maxKeys&&(l=i.maxKeys);var c=e.length;l>0&&c>l&&(c=l);for(var u=0;u<c;++u){var d,f,h,p,m=e[u].replace(s,"%20"),g=m.indexOf(o);g>=0?(d=m.substr(0,g),f=m.substr(g+1)):(d=m,f=""),h=decodeURIComponent(d),p=decodeURIComponent(f),n(a,h)?r(a[h])?a[h].push(p):a[h]=[a[h],p]:a[h]=p}return a};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}})),a.register("h75Bs",(function(e,t){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,a,s){return t=t||"&",a=a||"=",null===e&&(e=void 0),"object"==typeof e?o(i(e),(function(i){var s=encodeURIComponent(n(i))+a;return r(e[i])?o(e[i],(function(e){return s+encodeURIComponent(n(e))})).join(t):s+encodeURIComponent(n(e[i]))})).join(t):s?encodeURIComponent(n(s))+a+encodeURIComponent(n(e)):""};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var i=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}})),a.register("hK5aC",(function(e,t){var n=a("fnFC9"),r=a("8iXHm"),o=e.exports;for(var i in n)n.hasOwnProperty(i)&&(o[i]=n[i]);function s(e){if("string"==typeof e&&(e=r.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}o.request=function(e,t){return e=s(e),n.request.call(this,e,t)},o.get=function(e,t){return e=s(e),n.get.call(this,e,t)}})),a.register("805Dg",(function(t,n){var r;e(t.exports,"getOCSPURI",(()=>r),(e=>r=e));var o=a("5U18c"),i=a("1DJXa");i=a("1DJXa");r=function(e,t){var n=i["id-pkix-ocsp"].join("."),r=o.utils.toDER(e,"CERTIFICATE");r=i.Certificate.decode(r,"der"),o.utils.getAuthorityInfo(r,n,t)}})),a.register("9ZaT0",(function(t,n){var r;e(t.exports,"generate",(()=>r),(e=>r=e));var o=a("5U18c"),i=a("dc7aw"),s=a("1DJXa");s=a("1DJXa");function l(e){return i.createHash("sha1").update(e).digest()}r=function(e,t){var n,r;n=e.tbsCertificate?e:s.Certificate.decode(o.utils.toDER(e,"CERTIFICATE"),"der"),r=t.tbsCertificate?t:s.Certificate.decode(o.utils.toDER(t,"CERTIFICATE"),"der");var a=n.tbsCertificate,c=r.tbsCertificate,u={hashAlgorithm:{algorithm:[1,3,14,3,2,26]},issuerNameHash:l(s.Name.encode(a.issuer,"der")),issuerKeyHash:l(c.subjectPublicKeyInfo.subjectPublicKey.data),serialNumber:a.serialNumber},d={tbsRequest:{version:"v1",requestList:[{reqCert:u}],requestExtensions:[{extnID:s["id-pkix-ocsp-nonce"],critical:!1,extnValue:s.Nonce.encode(i.randomBytes(16),"der")}]}};return{id:l(s.CertID.encode(u,"der")),certID:u,data:s.OCSPRequest.encode(d,"der"),cert:n,issuer:r}}})),a.register("dc7aw",(function(t,n){var r,o,i;e(t.exports,"randomBytes",(()=>r),(e=>r=e)),e(t.exports,"createHash",(()=>o),(e=>o=e)),e(t.exports,"createVerify",(()=>i),(e=>i=e)),r=a("3xr1Z"),o=a("d8QYu"),a("7Q3Pj");var s=a("8zF5N"),l=Object.keys(s),c=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(l);var u=a("cabM3");u.pbkdf2,u.pbkdf2Sync;var d=a("3feuT");d.Cipher,d.createCipher,d.Cipheriv,d.createCipheriv,d.Decipher,d.createDecipher,d.Decipheriv,d.createDecipheriv,d.getCiphers,d.listCiphers;var f=a("hzteC");f.DiffieHellmanGroup,f.createDiffieHellmanGroup,f.getDiffieHellman,f.createDiffieHellman,f.DiffieHellman;var h=a("cD2JS");h.createSign,h.Sign,i=h.createVerify,h.Verify,a("5nTVb");var p=a("5IN4o");p.publicEncrypt,p.privateEncrypt,p.publicDecrypt,p.privateDecrypt;var m=a("lPq1P");m.randomFill,m.randomFillSync})),a.register("3xr1Z",(function(e,n){var r=a("ePtPP"),o=65536;var i=a("8ByQm").Buffer,s=t.crypto||t.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var n=i.allocUnsafe(e);if(e>0)if(e>o)for(var a=0;a<e;a+=o)s.getRandomValues(n.slice(a,a+o));else s.getRandomValues(n);return"function"==typeof t?r.nextTick((function(){t(null,n)})):n}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}})),a.register("d8QYu",(function(e,t){"use strict";var n=a("5jAh8"),r=a("d5AKh"),o=a("akTKC"),i=a("5eKyq"),s=a("9HuUe");function l(e){s.call(this,"digest"),this._hash=e}n(l,s),l.prototype._update=function(e){this._hash.update(e)},l.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new r:"rmd160"===e||"ripemd160"===e?new o:new l(i(e))}})),a.register("d5AKh",(function(e,t){"use strict";var n=a("5jAh8"),r=a("hbeGo"),o=a("8ByQm").Buffer,i=new Array(16);function s(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function l(e,t){return e<<t|e>>>32-t}function c(e,t,n,r,o,i,a){return l(e+(t&n|~t&r)+o+i|0,a)+t|0}function u(e,t,n,r,o,i,a){return l(e+(t&r|n&~r)+o+i|0,a)+t|0}function d(e,t,n,r,o,i,a){return l(e+(t^n^r)+o+i|0,a)+t|0}function f(e,t,n,r,o,i,a){return l(e+(n^(t|~r))+o+i|0,a)+t|0}n(s,r),s.prototype._update=function(){for(var e=i,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,o=this._c,a=this._d;n=c(n,r,o,a,e[0],3614090360,7),a=c(a,n,r,o,e[1],3905402710,12),o=c(o,a,n,r,e[2],606105819,17),r=c(r,o,a,n,e[3],3250441966,22),n=c(n,r,o,a,e[4],4118548399,7),a=c(a,n,r,o,e[5],1200080426,12),o=c(o,a,n,r,e[6],2821735955,17),r=c(r,o,a,n,e[7],4249261313,22),n=c(n,r,o,a,e[8],1770035416,7),a=c(a,n,r,o,e[9],2336552879,12),o=c(o,a,n,r,e[10],4294925233,17),r=c(r,o,a,n,e[11],2304563134,22),n=c(n,r,o,a,e[12],1804603682,7),a=c(a,n,r,o,e[13],4254626195,12),o=c(o,a,n,r,e[14],2792965006,17),n=u(n,r=c(r,o,a,n,e[15],1236535329,22),o,a,e[1],4129170786,5),a=u(a,n,r,o,e[6],3225465664,9),o=u(o,a,n,r,e[11],643717713,14),r=u(r,o,a,n,e[0],3921069994,20),n=u(n,r,o,a,e[5],3593408605,5),a=u(a,n,r,o,e[10],38016083,9),o=u(o,a,n,r,e[15],3634488961,14),r=u(r,o,a,n,e[4],3889429448,20),n=u(n,r,o,a,e[9],568446438,5),a=u(a,n,r,o,e[14],3275163606,9),o=u(o,a,n,r,e[3],4107603335,14),r=u(r,o,a,n,e[8],1163531501,20),n=u(n,r,o,a,e[13],2850285829,5),a=u(a,n,r,o,e[2],4243563512,9),o=u(o,a,n,r,e[7],1735328473,14),n=d(n,r=u(r,o,a,n,e[12],2368359562,20),o,a,e[5],4294588738,4),a=d(a,n,r,o,e[8],2272392833,11),o=d(o,a,n,r,e[11],1839030562,16),r=d(r,o,a,n,e[14],4259657740,23),n=d(n,r,o,a,e[1],2763975236,4),a=d(a,n,r,o,e[4],1272893353,11),o=d(o,a,n,r,e[7],4139469664,16),r=d(r,o,a,n,e[10],3200236656,23),n=d(n,r,o,a,e[13],681279174,4),a=d(a,n,r,o,e[0],3936430074,11),o=d(o,a,n,r,e[3],3572445317,16),r=d(r,o,a,n,e[6],76029189,23),n=d(n,r,o,a,e[9],3654602809,4),a=d(a,n,r,o,e[12],3873151461,11),o=d(o,a,n,r,e[15],530742520,16),n=f(n,r=d(r,o,a,n,e[2],3299628645,23),o,a,e[0],4096336452,6),a=f(a,n,r,o,e[7],1126891415,10),o=f(o,a,n,r,e[14],2878612391,15),r=f(r,o,a,n,e[5],4237533241,21),n=f(n,r,o,a,e[12],1700485571,6),a=f(a,n,r,o,e[3],2399980690,10),o=f(o,a,n,r,e[10],4293915773,15),r=f(r,o,a,n,e[1],2240044497,21),n=f(n,r,o,a,e[8],1873313359,6),a=f(a,n,r,o,e[15],4264355552,10),o=f(o,a,n,r,e[6],2734768916,15),r=f(r,o,a,n,e[13],1309151649,21),n=f(n,r,o,a,e[4],4149444226,6),a=f(a,n,r,o,e[11],3174756917,10),o=f(o,a,n,r,e[2],718787259,15),r=f(r,o,a,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+o|0,this._d=this._d+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s})),a.register("hbeGo",(function(e,t){"use strict";var n=a("8ByQm").Buffer,r=a("8IqCp").Transform;function o(e){r.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}a("5jAh8")(o,r),o.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(e){r=e}n(r)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,o=0;this._blockOffset+e.length-o>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=e[o++];this._update(),this._blockOffset=0}for(;o<e.length;)r[this._blockOffset++]=e[o++];for(var a=0,s=8*e.length;s>0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o})),a.register("akTKC",(function(e,t){"use strict";var n=a("bqBrJ").Buffer,r=a("5jAh8"),o=a("hbeGo"),i=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],l=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],u=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],d=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function h(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function m(e,t,n,r,o,i,a,s){return p(e+(t^n^r)+i+a|0,s)+o|0}function g(e,t,n,r,o,i,a,s){return p(e+(t&n|~t&r)+i+a|0,s)+o|0}function v(e,t,n,r,o,i,a,s){return p(e+((t|~n)^r)+i+a|0,s)+o|0}function b(e,t,n,r,o,i,a,s){return p(e+(t&r|n&~r)+i+a|0,s)+o|0}function y(e,t,n,r,o,i,a,s){return p(e+(t^(n|~r))+i+a|0,s)+o|0}r(h,o),h.prototype._update=function(){for(var e=i,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,w=0|this._a,x=0|this._b,S=0|this._c,M=0|this._d,_=0|this._e,E=0;E<80;E+=1){var A,C;E<16?(A=m(n,r,o,a,h,e[s[E]],d[0],c[E]),C=y(w,x,S,M,_,e[l[E]],f[0],u[E])):E<32?(A=g(n,r,o,a,h,e[s[E]],d[1],c[E]),C=b(w,x,S,M,_,e[l[E]],f[1],u[E])):E<48?(A=v(n,r,o,a,h,e[s[E]],d[2],c[E]),C=v(w,x,S,M,_,e[l[E]],f[2],u[E])):E<64?(A=b(n,r,o,a,h,e[s[E]],d[3],c[E]),C=g(w,x,S,M,_,e[l[E]],f[3],u[E])):(A=y(n,r,o,a,h,e[s[E]],d[4],c[E]),C=m(w,x,S,M,_,e[l[E]],f[4],u[E])),n=h,h=a,a=p(o,10),o=r,r=A,w=_,_=M,M=p(S,10),S=x,x=C}var k=this._b+o+M|0;this._b=this._c+a+_|0,this._c=this._d+h+w|0,this._d=this._e+n+x|0,this._e=this._a+r+S|0,this._a=k},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h})),a.register("5eKyq",(function(e,t){var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=a("3WWrs"),n.sha1=a("20KWg"),n.sha224=a("7FU1E"),n.sha256=a("5f2Bs"),n.sha384=a("hSEUB"),n.sha512=a("1Wrwk")})),a.register("3WWrs",(function(e,t){var n=a("5jAh8"),r=a("6TDWC"),o=a("8ByQm").Buffer,i=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function l(){this.init(),this._w=s,r.call(this,64,56)}function c(e){return e<<30|e>>>2}function u(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}n(l,r),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},l.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,a=0|this._c,s=0|this._d,l=0|this._e,d=0;d<16;++d)n[d]=e.readInt32BE(4*d);for(;d<80;++d)n[d]=n[d-3]^n[d-8]^n[d-14]^n[d-16];for(var f=0;f<80;++f){var h=~~(f/20),p=0|((t=r)<<5|t>>>27)+u(h,o,a,s)+l+n[f]+i[h];l=s,s=a,a=c(o),o=r,r=p}this._a=r+this._a|0,this._b=o+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=l+this._e|0},l.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=l})),a.register("6TDWC",(function(e,t){var n=a("8ByQm").Buffer;function r(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}r.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,o=this._blockSize,i=e.length,a=this._len,s=0;s<i;){for(var l=a%o,c=Math.min(i-s,o-l),u=0;u<c;u++)r[l+u]=e[s+u];s+=c,(a+=c)%o==0&&this._update(r)}return this._len+=i,this},r.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,o=(n-r)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=r})),a.register("20KWg",(function(e,t){var n=a("5jAh8"),r=a("6TDWC"),o=a("8ByQm").Buffer,i=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function l(){this.init(),this._w=s,r.call(this,64,56)}function c(e){return e<<5|e>>>27}function u(e){return e<<30|e>>>2}function d(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}n(l,r),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},l.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,a=0|this._c,s=0|this._d,l=0|this._e,f=0;f<16;++f)n[f]=e.readInt32BE(4*f);for(;f<80;++f)n[f]=(t=n[f-3]^n[f-8]^n[f-14]^n[f-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),m=c(r)+d(p,o,a,s)+l+n[h]+i[p]|0;l=s,s=a,a=u(o),o=r,r=m}this._a=r+this._a|0,this._b=o+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=l+this._e|0},l.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=l})),a.register("7FU1E",(function(e,t){var n=a("5jAh8"),r=a("5f2Bs"),o=a("6TDWC"),i=a("8ByQm").Buffer,s=new Array(64);function l(){this.init(),this._w=s,o.call(this,64,56)}n(l,r),l.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},l.prototype._hash=function(){var e=i.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=l})),a.register("5f2Bs",(function(e,t){var n=a("5jAh8"),r=a("6TDWC"),o=a("8ByQm").Buffer,i=[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],s=new Array(64);function l(){this.init(),this._w=s,r.call(this,64,56)}function c(e,t,n){return n^e&(t^n)}function u(e,t,n){return e&t|n&(e|t)}function d(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(l,r),l.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},l.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,a=0|this._c,s=0|this._d,l=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)n[v]=e.readInt32BE(4*v);for(;v<64;++v)n[v]=0|(((t=n[v-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[v-7]+h(n[v-15])+n[v-16];for(var b=0;b<64;++b){var y=g+f(l)+c(l,p,m)+i[b]+n[b]|0,w=d(r)+u(r,o,a)|0;g=m,m=p,p=l,l=s+y|0,s=a,a=o,o=r,r=y+w|0}this._a=r+this._a|0,this._b=o+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=l+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},l.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=l})),a.register("hSEUB",(function(e,t){var n=a("5jAh8"),r=a("1Wrwk"),o=a("6TDWC"),i=a("8ByQm").Buffer,s=new Array(160);function l(){this.init(),this._w=s,o.call(this,128,112)}n(l,r),l.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},l.prototype._hash=function(){var e=i.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=l})),a.register("1Wrwk",(function(e,t){var n=a("5jAh8"),r=a("6TDWC"),o=a("8ByQm").Buffer,i=[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],s=new Array(160);function l(){this.init(),this._w=s,r.call(this,128,112)}function c(e,t,n){return n^e&(t^n)}function u(e,t,n){return e&t|n&(e|t)}function d(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function v(e,t){return e>>>0<t>>>0?1:0}n(l,r),l.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},l.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,o=0|this._ch,a=0|this._dh,s=0|this._eh,l=0|this._fh,b=0|this._gh,y=0|this._hh,w=0|this._al,x=0|this._bl,S=0|this._cl,M=0|this._dl,_=0|this._el,E=0|this._fl,A=0|this._gl,C=0|this._hl,k=0;k<32;k+=2)t[k]=e.readInt32BE(4*k),t[k+1]=e.readInt32BE(4*k+4);for(;k<160;k+=2){var T=t[k-30],I=t[k-30+1],O=h(T,I),R=p(I,T),P=m(T=t[k-4],I=t[k-4+1]),N=g(I,T),L=t[k-14],B=t[k-14+1],D=t[k-32],j=t[k-32+1],F=R+B|0,z=O+L+v(F,R)|0;z=(z=z+P+v(F=F+N|0,N)|0)+D+v(F=F+j|0,j)|0,t[k]=z,t[k+1]=F}for(var U=0;U<160;U+=2){z=t[U],F=t[U+1];var H=u(n,r,o),G=u(w,x,S),W=d(n,w),V=d(w,n),q=f(s,_),K=f(_,s),$=i[U],J=i[U+1],X=c(s,l,b),Q=c(_,E,A),Y=C+K|0,Z=y+q+v(Y,C)|0;Z=(Z=(Z=Z+X+v(Y=Y+Q|0,Q)|0)+$+v(Y=Y+J|0,J)|0)+z+v(Y=Y+F|0,F)|0;var ee=V+G|0,te=W+H+v(ee,V)|0;y=b,C=A,b=l,A=E,l=s,E=_,s=a+Z+v(_=M+Y|0,M)|0,a=o,M=S,o=r,S=x,r=n,x=w,n=Z+te+v(w=Y+ee|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+x|0,this._cl=this._cl+S|0,this._dl=this._dl+M|0,this._el=this._el+_|0,this._fl=this._fl+E|0,this._gl=this._gl+A|0,this._hl=this._hl+C|0,this._ah=this._ah+n+v(this._al,w)|0,this._bh=this._bh+r+v(this._bl,x)|0,this._ch=this._ch+o+v(this._cl,S)|0,this._dh=this._dh+a+v(this._dl,M)|0,this._eh=this._eh+s+v(this._el,_)|0,this._fh=this._fh+l+v(this._fl,E)|0,this._gh=this._gh+b+v(this._gl,A)|0,this._hh=this._hh+y+v(this._hl,C)|0},l.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=l})),a.register("9HuUe",(function(e,t){var n=a("8ByQm").Buffer,r=a("hFDuv").Transform,o=a("28kcI").StringDecoder;function i(e){r.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}a("5jAh8")(i,r),i.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var o=this._update(e);return this.hashMode?this:(r&&(o=this._toString(o,r)),o)},i.prototype.setAutoPadding=function(){},i.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},i.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},i.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},i.prototype._transform=function(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){r=e}finally{n(r)}},i.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},i.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},i.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r},e.exports=i})),a.register("hFDuv",(function(e,t){e.exports=r;var n=a("3oV8N").EventEmitter;function r(){n.call(this)}a("5jAh8")(r,n),r.Readable=a("kZTRI"),r.Writable=a("gihud"),r.Duplex=a("jqAKP"),r.Transform=a("erC5i"),r.PassThrough=a("3dCe5"),r.finished=a("j5ZwK"),r.pipeline=a("azGNy"),r.Stream=r,r.prototype.pipe=function(e,t){var r=this;function o(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var a=!1;function s(){a||(a=!0,e.end())}function l(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(u(),0===n.listenerCount(this,"error"))throw e}function u(){r.removeListener("data",o),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("error",c),e.on("error",c),r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e}})),a.register("7Q3Pj",(function(e,t){"use strict";var n=a("5jAh8"),r=a("kQpbp"),o=a("9HuUe"),i=a("8ByQm").Buffer,s=a("i7eWY"),l=a("akTKC"),c=a("5eKyq"),u=i.alloc(128);function d(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t));var n="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>n)?t=("rmd160"===e?new l:c(e)).update(t).digest():t.length<n&&(t=i.concat([t,u],n));for(var r=this._ipad=i.allocUnsafe(n),a=this._opad=i.allocUnsafe(n),s=0;s<n;s++)r[s]=54^t[s],a[s]=92^t[s];this._hash="rmd160"===e?new l:c(e),this._hash.update(r)}n(d,o),d.prototype._update=function(e){this._hash.update(e)},d.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new l:c(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new d("rmd160",t):"md5"===e?new r(s,t):new d(e,t)}})),a.register("kQpbp",(function(e,t){"use strict";var n=a("5jAh8"),r=a("8ByQm").Buffer,o=a("9HuUe"),i=r.alloc(128),s=64;function l(e,t){o.call(this,"digest"),"string"==typeof t&&(t=r.from(t)),this._alg=e,this._key=t,t.length>s?t=e(t):t.length<s&&(t=r.concat([t,i],s));for(var n=this._ipad=r.allocUnsafe(s),a=this._opad=r.allocUnsafe(s),l=0;l<s;l++)n[l]=54^t[l],a[l]=92^t[l];this._hash=[n]}n(l,o),l.prototype._update=function(e){this._hash.push(e)},l.prototype._final=function(){var e=this._alg(r.concat(this._hash));return this._alg(r.concat([this._opad,e]))},e.exports=l})),a.register("i7eWY",(function(e,t){var n=a("d5AKh");e.exports=function(e){return(new n).update(e).digest()}})),a.register("8zF5N",(function(e,t){e.exports=a("aeDps")})),a.register("aeDps",(function(e,t){e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')})),a.register("cabM3",(function(t,n){var r,o;e(t.exports,"pbkdf2",(()=>r),(e=>r=e)),e(t.exports,"pbkdf2Sync",(()=>o),(e=>o=e)),r=a("1dDF3"),o=a("8Rgya")})),a.register("1dDF3",(function(e,n){var r,o,i=a("8ByQm").Buffer,s=a("e25FX"),l=a("zQTLA"),c=a("8Rgya"),u=a("7PgqL"),d=t.crypto&&t.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function p(){return o||(o=t.process&&t.process.nextTick?t.process.nextTick:t.queueMicrotask?t.queueMicrotask:t.setImmediate?t.setImmediate:t.setTimeout)}function m(e,t,n,r,o){return d.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return d.deriveBits({name:"PBKDF2",salt:t,iterations:n,hash:{name:o}},e,r<<3)})).then((function(e){return i.from(e)}))}e.exports=function(e,n,o,a,g,v){"function"==typeof g&&(v=g,g=void 0);var b=f[(g=g||"sha1").toLowerCase()];if(b&&"function"==typeof t.Promise){if(s(o,a),e=u(e,l,"Password"),n=u(n,l,"Salt"),"function"!=typeof v)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){p()((function(){t(null,e)}))}),(function(e){p()((function(){t(e)}))}))}(function(e){if(t.process&&!t.process.browser)return Promise.resolve(!1);if(!d||!d.importKey||!d.deriveBits)return Promise.resolve(!1);if(void 0!==h[e])return h[e];var n=m(r=r||i.alloc(8),r,10,128,e).then((function(){return!0})).catch((function(){return!1}));return h[e]=n,n}(b).then((function(t){return t?m(e,n,o,a,b):c(e,n,o,a,g)})),v)}else p()((function(){var t;try{t=c(e,n,o,a,g)}catch(e){return v(e)}v(null,t)}))}})),a.register("e25FX",(function(e,t){var n=Math.pow(2,30)-1;e.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>n||t!=t)throw new TypeError("Bad key length")}})),a.register("zQTLA",(function(e,n){var r,o=a("ePtPP");if(t.process&&t.process.browser)r="utf-8";else if(t.process&&t.process.version){r=parseInt(o.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";e.exports=r})),a.register("8Rgya",(function(e,t){var n=a("i7eWY"),r=a("akTKC"),o=a("5eKyq"),i=a("8ByQm").Buffer,s=a("e25FX"),l=a("zQTLA"),c=a("7PgqL"),u=i.alloc(128),d={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(e,t,a){var s=function(e){function t(t){return o(e).update(t).digest()}function i(e){return(new r).update(e).digest()}return"rmd160"===e||"ripemd160"===e?i:"md5"===e?n:t}(e),l="sha512"===e||"sha384"===e?128:64;t.length>l?t=s(t):t.length<l&&(t=i.concat([t,u],l));for(var c=i.allocUnsafe(l+d[e]),f=i.allocUnsafe(l+d[e]),h=0;h<l;h++)c[h]=54^t[h],f[h]=92^t[h];var p=i.allocUnsafe(l+a+4);c.copy(p,0,0,l),this.ipad1=p,this.ipad2=c,this.opad=f,this.alg=e,this.blocksize=l,this.hash=s,this.size=d[e]}f.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(e,t,n,r,o){s(n,r);var a=new f(o=o||"sha1",e=c(e,l,"Password"),(t=c(t,l,"Salt")).length),u=i.allocUnsafe(r),h=i.allocUnsafe(t.length+4);t.copy(h,0,0,t.length);for(var p=0,m=d[o],g=Math.ceil(r/m),v=1;v<=g;v++){h.writeUInt32BE(v,t.length);for(var b=a.run(h,a.ipad1),y=b,w=1;w<n;w++){y=a.run(y,a.ipad2);for(var x=0;x<m;x++)b[x]^=y[x]}b.copy(u,p),p+=m}return u}})),a.register("7PgqL",(function(e,t){var n=a("8ByQm").Buffer;e.exports=function(e,t,r){if(n.isBuffer(e))return e;if("string"==typeof e)return n.from(e,t);if(ArrayBuffer.isView(e))return n.from(e.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}})),a.register("3feuT",(function(t,n){var r,o,i,s,l,c,u,d,f,h;e(t.exports,"createCipher",(()=>r),(e=>r=e)),e(t.exports,"Cipher",(()=>o),(e=>o=e)),e(t.exports,"createCipheriv",(()=>i),(e=>i=e)),e(t.exports,"Cipheriv",(()=>s),(e=>s=e)),e(t.exports,"createDecipher",(()=>l),(e=>l=e)),e(t.exports,"Decipher",(()=>c),(e=>c=e)),e(t.exports,"createDecipheriv",(()=>u),(e=>u=e)),e(t.exports,"Decipheriv",(()=>d),(e=>d=e)),e(t.exports,"listCiphers",(()=>f),(e=>f=e)),e(t.exports,"getCiphers",(()=>h),(e=>h=e));var p=a("i5Vju"),m=a("duD0R"),g=a("cD8zA"),v=a("bJC4J"),b=a("2tkTk");function y(e,t,n){if(e=e.toLowerCase(),g[e])return m.createCipheriv(e,t,n);if(v[e])return new p({key:t,iv:n,mode:e});throw new TypeError("invalid suite type")}function w(e,t,n){if(e=e.toLowerCase(),g[e])return m.createDecipheriv(e,t,n);if(v[e])return new p({key:t,iv:n,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}r=o=function(e,t){var n,r;if(e=e.toLowerCase(),g[e])n=g[e].key,r=g[e].iv;else{if(!v[e])throw new TypeError("invalid suite type");n=8*v[e].key,r=v[e].iv}var o=b(t,!1,n,r);return y(e,o.key,o.iv)},i=s=y,l=c=function(e,t){var n,r;if(e=e.toLowerCase(),g[e])n=g[e].key,r=g[e].iv;else{if(!v[e])throw new TypeError("invalid suite type");n=8*v[e].key,r=v[e].iv}var o=b(t,!1,n,r);return w(e,o.key,o.iv)},u=d=w,f=h=function(){return Object.keys(v).concat(m.getCiphers())}})),a.register("i5Vju",(function(e,t){var n=a("9HuUe"),r=a("96ToB"),o=a("5jAh8"),i=a("8ByQm").Buffer,s={"des-ede3-cbc":r.CBC.instantiate(r.EDE),"des-ede3":r.EDE,"des-ede-cbc":r.CBC.instantiate(r.EDE),"des-ede":r.EDE,"des-cbc":r.CBC.instantiate(r.DES),"des-ecb":r.DES};function l(e){n.call(this);var t,r=e.mode.toLowerCase(),o=s[r];t=e.decrypt?"decrypt":"encrypt";var a=e.key;i.isBuffer(a)||(a=i.from(a)),"des-ede"!==r&&"des-ede-cbc"!==r||(a=i.concat([a,a.slice(0,8)]));var l=e.iv;i.isBuffer(l)||(l=i.from(l)),this._des=o.create({key:a,iv:l,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=l,o(l,n),l.prototype._update=function(e){return i.from(this._des.update(e))},l.prototype._final=function(){return i.from(this._des.final())}})),a.register("96ToB",(function(t,n){var r,o,i;e(t.exports,"DES",(()=>r),(e=>r=e)),e(t.exports,"CBC",(()=>o),(e=>o=e)),e(t.exports,"EDE",(()=>i),(e=>i=e)),a("gnnuw"),a("04Bjm"),r=a("gno1I"),o=a("Hz9en"),i=a("8fziB")})),a.register("gnnuw",(function(t,n){var r,o,i,a,s,l,c,u,d,f,h;e(t.exports,"readUInt32BE",(()=>r),(e=>r=e)),e(t.exports,"writeUInt32BE",(()=>o),(e=>o=e)),e(t.exports,"ip",(()=>i),(e=>i=e)),e(t.exports,"rip",(()=>a),(e=>a=e)),e(t.exports,"pc1",(()=>s),(e=>s=e)),e(t.exports,"r28shl",(()=>l),(e=>l=e)),e(t.exports,"pc2",(()=>c),(e=>c=e)),e(t.exports,"expand",(()=>u),(e=>u=e)),e(t.exports,"substitute",(()=>d),(e=>d=e)),e(t.exports,"permute",(()=>f),(e=>f=e)),e(t.exports,"padSplit",(()=>h),(e=>h=e)),r=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},o=function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=255&t},i=function(e,t,n,r){for(var o=0,i=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)o<<=1,o|=t>>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)i<<=1,i|=t>>>s+a&1;for(s=1;s<=25;s+=8)i<<=1,i|=e>>>s+a&1}n[r+0]=o>>>0,n[r+1]=i>>>0},a=function(e,t,n,r){for(var o=0,i=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;n[r+0]=o>>>0,n[r+1]=i>>>0},s=function(e,t,n,r){for(var o=0,i=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;n[r+0]=o>>>0,n[r+1]=i>>>0},l=function(e,t){return e<<t&268435455|e>>>28-t};var p=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];c=function(e,t,n,r){for(var o=0,i=0,a=p.length>>>1,s=0;s<a;s++)o<<=1,o|=e>>>p[s]&1;for(s=a;s<p.length;s++)i<<=1,i|=t>>>p[s]&1;n[r+0]=o>>>0,n[r+1]=i>>>0},u=function(e,t,n){var r=0,o=0;r=(1&e)<<5|e>>>27;for(var i=23;i>=15;i-=4)r<<=6,r|=e>>>i&63;for(i=11;i>=3;i-=4)o|=e>>>i&63,o<<=6;o|=(31&e)<<1|e>>>31,t[n+0]=r>>>0,t[n+1]=o>>>0};var m=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];d=function(e,t){for(var n=0,r=0;r<4;r++){n<<=4,n|=m[64*r+(e>>>18-6*r&63)]}for(r=0;r<4;r++){n<<=4,n|=m[256+64*r+(t>>>18-6*r&63)]}return n>>>0};var g=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];f=function(e){for(var t=0,n=0;n<g.length;n++)t<<=1,t|=e>>>g[n]&1;return t>>>0},h=function(e,t,n){for(var r=e.toString(2);r.length<t;)r="0"+r;for(var o=[],i=0;i<t;i+=n)o.push(r.slice(i,i+n));return o.join(" ")}})),a.register("04Bjm",(function(e,t){"use strict";var n=a("iGZtb");function r(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=r,r.prototype._init=function(){},r.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},r.prototype._buffer=function(e,t){for(var n=Math.min(this.buffer.length-this.bufferOff,e.length-t),r=0;r<n;r++)this.buffer[this.bufferOff+r]=e[t+r];return this.bufferOff+=n,n},r.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},r.prototype._updateEncrypt=function(e){var t=0,n=0,r=(this.bufferOff+e.length)/this.blockSize|0,o=new Array(r*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(n+=this._flushBuffer(o,n)));for(var i=e.length-(e.length-t)%this.blockSize;t<i;t+=this.blockSize)this._update(e,t,o,n),n+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return o},r.prototype._updateDecrypt=function(e){for(var t=0,n=0,r=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,o=new Array(r*this.blockSize);r>0;r--)t+=this._buffer(e,t),n+=this._flushBuffer(o,n);return t+=this._buffer(e,t),o},r.prototype.final=function(e){var t,n;return e&&(t=this.update(e)),n="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(n):n},r.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},r.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},r.prototype._unpad=function(e){return e},r.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}})),a.register("iGZtb",(function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=n,n.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}})),a.register("gno1I",(function(e,t){"use strict";var n=a("iGZtb"),r=a("5jAh8"),o=a("gnnuw"),i=a("04Bjm");function s(){this.tmp=new Array(2),this.keys=null}function l(e){i.call(this,e);var t=new s;this._desState=t,this.deriveKeys(t,e.key)}r(l,i),e.exports=l,l.create=function(e){return new l(e)};var c=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];l.prototype.deriveKeys=function(e,t){e.keys=new Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(t,0),i=o.readUInt32BE(t,4);o.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var a=0;a<e.keys.length;a+=2){var s=c[a>>>1];r=o.r28shl(r,s),i=o.r28shl(i,s),o.pc2(r,i,e.keys,a)}},l.prototype._update=function(e,t,n,r){var i=this._desState,a=o.readUInt32BE(e,t),s=o.readUInt32BE(e,t+4);o.ip(a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,s,i.tmp,0):this._decrypt(i,a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],o.writeUInt32BE(n,a,r),o.writeUInt32BE(n,s,r+4)},l.prototype._pad=function(e,t){for(var n=e.length-t,r=t;r<e.length;r++)e[r]=n;return!0},l.prototype._unpad=function(e){for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)n.equal(e[r],t);return e.slice(0,e.length-t)},l.prototype._encrypt=function(e,t,n,r,i){for(var a=t,s=n,l=0;l<e.keys.length;l+=2){var c=e.keys[l],u=e.keys[l+1];o.expand(s,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var d=o.substitute(c,u),f=s;s=(a^o.permute(d))>>>0,a=f}o.rip(s,a,r,i)},l.prototype._decrypt=function(e,t,n,r,i){for(var a=n,s=t,l=e.keys.length-2;l>=0;l-=2){var c=e.keys[l],u=e.keys[l+1];o.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var d=o.substitute(c,u),f=a;a=(s^o.permute(d))>>>0,s=f}o.rip(a,s,r,i)}})),a.register("Hz9en",(function(t,n){var r;e(t.exports,"instantiate",(()=>r),(e=>r=e));var o=a("iGZtb"),i=a("5jAh8"),s={};function l(e){o.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}r=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var n=Object.keys(s),r=0;r<n.length;r++){var o=n[r];t.prototype[o]=s[o]}return t.create=function(e){return new t(e)},t},s._cbcInit=function(){var e=new l(this.options.iv);this._cbcState=e},s._update=function(e,t,n,r){var o=this._cbcState,i=this.constructor.super_.prototype,a=o.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)a[s]^=e[t+s];i._update.call(this,a,0,n,r);for(s=0;s<this.blockSize;s++)a[s]=n[r+s]}else{i._update.call(this,e,t,n,r);for(s=0;s<this.blockSize;s++)n[r+s]^=a[s];for(s=0;s<this.blockSize;s++)a[s]=e[t+s]}}})),a.register("8fziB",(function(e,t){"use strict";var n=a("iGZtb"),r=a("5jAh8"),o=a("04Bjm"),i=a("gno1I");function s(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),o=t.slice(8,16),a=t.slice(16,24);this.ciphers="encrypt"===e?[i.create({type:"encrypt",key:r}),i.create({type:"decrypt",key:o}),i.create({type:"encrypt",key:a})]:[i.create({type:"decrypt",key:a}),i.create({type:"encrypt",key:o}),i.create({type:"decrypt",key:r})]}function l(e){o.call(this,e);var t=new s(this.type,this.options.key);this._edeState=t}r(l,o),e.exports=l,l.create=function(e){return new l(e)},l.prototype._update=function(e,t,n,r){var o=this._edeState;o.ciphers[0]._update(e,t,n,r),o.ciphers[1]._update(n,r,n,r),o.ciphers[2]._update(n,r,n,r)},l.prototype._pad=i.prototype._pad,l.prototype._unpad=i.prototype._unpad})),a.register("duD0R",(function(t,n){var r,o,i;e(t.exports,"createCipheriv",(()=>r),(e=>r=e)),e(t.exports,"createDecipheriv",(()=>o),(e=>o=e)),e(t.exports,"getCiphers",(()=>i),(e=>i=e));var s=a("7ArtE"),l=a("4nqK6"),c=a("6P430");s.createCipher,r=s.createCipheriv,l.createDecipher,o=l.createDecipheriv,i=function(){return Object.keys(c)}})),a.register("7ArtE",(function(t,n){var r,o;e(t.exports,"createCipheriv",(()=>r),(e=>r=e)),e(t.exports,"createCipher",(()=>o),(e=>o=e));var i=a("cD8zA"),s=a("dU8tN"),l=a("8ByQm").Buffer,c=a("kqHo3"),u=a("9HuUe"),d=a("5gOZ5"),f=a("2tkTk");function h(e,t,n){u.call(this),this._cache=new m,this._cipher=new d.AES(t),this._prev=l.from(n),this._mode=e,this._autopadding=!0}a("5jAh8")(h,u),h.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get();)n=this._mode.encrypt(this,t),r.push(n);return l.concat(r)};var p=l.alloc(16,16);function m(){this.cache=l.allocUnsafe(0)}function g(e,t,n){var r=i[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=l.from(t)),t.length!==r.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof n&&(n=l.from(n)),"GCM"!==r.mode&&n.length!==r.iv)throw new TypeError("invalid iv length "+n.length);return"stream"===r.type?new c(r.module,t,n):"auth"===r.type?new s(r.module,t,n):new h(r.module,t,n)}h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(p))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},m.prototype.add=function(e){this.cache=l.concat([this.cache,e])},m.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},m.prototype.flush=function(){for(var e=16-this.cache.length,t=l.allocUnsafe(e),n=-1;++n<e;)t.writeUInt8(e,n);return l.concat([this.cache,t])},r=g,o=function(e,t){var n=i[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var r=f(t,!1,n.key,n.iv);return g(e,r.key,r.iv)}})),a.register("cD8zA",(function(e,t){var n={ECB:a("fmYcl"),CBC:a("hyeta"),CFB:a("dABZp"),CFB8:a("f4OJE"),CFB1:a("hUOdV"),OFB:a("49TA8"),CTR:a("bSabi"),GCM:a("bSabi")},r=a("6P430");for(var o in r)r[o].module=n[r[o].mode];e.exports=r})),a.register("fmYcl",(function(t,n){var r,o;e(t.exports,"encrypt",(()=>r),(e=>r=e)),e(t.exports,"decrypt",(()=>o),(e=>o=e)),r=function(e,t){return e._cipher.encryptBlock(t)},o=function(e,t){return e._cipher.decryptBlock(t)}})),a.register("hyeta",(function(t,n){var r,o;e(t.exports,"encrypt",(()=>r),(e=>r=e)),e(t.exports,"decrypt",(()=>o),(e=>o=e));var i=a("i9W9Q");r=function(e,t){var n=i(t,e._prev);return e._prev=e._cipher.encryptBlock(n),e._prev},o=function(e,t){var n=e._prev;e._prev=t;var r=e._cipher.decryptBlock(t);return i(r,n)}})),a.register("i9W9Q",(function(e,t){var n=a("bqBrJ").Buffer;e.exports=function(e,t){for(var r=Math.min(e.length,t.length),o=new n(r),i=0;i<r;++i)o[i]=e[i]^t[i];return o}})),a.register("dABZp",(function(t,n){var r;e(t.exports,"encrypt",(()=>r),(e=>r=e));var o=a("8ByQm").Buffer,i=a("i9W9Q");function s(e,t,n){var r=t.length,a=i(t,e._cache);return e._cache=e._cache.slice(r),e._prev=o.concat([e._prev,n?t:a]),a}r=function(e,t,n){for(var r,i=o.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=o.allocUnsafe(0)),!(e._cache.length<=t.length)){i=o.concat([i,s(e,t,n)]);break}r=e._cache.length,i=o.concat([i,s(e,t.slice(0,r),n)]),t=t.slice(r)}return i}})),a.register("f4OJE",(function(t,n){var r;e(t.exports,"encrypt",(()=>r),(e=>r=e));var o=a("8ByQm").Buffer;function i(e,t,n){var r=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=o.concat([e._prev.slice(1),o.from([n?t:r])]),r}r=function(e,t,n){for(var r=t.length,a=o.allocUnsafe(r),s=-1;++s<r;)a[s]=i(e,t[s],n);return a}})),a.register("hUOdV",(function(t,n){var r;e(t.exports,"encrypt",(()=>r),(e=>r=e));var o=a("8ByQm").Buffer;function i(e,t,n){for(var r,o,i=-1,a=0;++i<8;)r=t&1<<7-i?128:0,a+=(128&(o=e._cipher.encryptBlock(e._prev)[0]^r))>>i%8,e._prev=s(e._prev,n?r:o);return a}function s(e,t){var n=e.length,r=-1,i=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++r<n;)i[r]=e[r]<<1|e[r+1]>>7;return i}r=function(e,t,n){for(var r=t.length,a=o.allocUnsafe(r),s=-1;++s<r;)a[s]=i(e,t[s],n);return a}})),a.register("49TA8",(function(t,n){var r;e(t.exports,"encrypt",(()=>r),(e=>r=e));var o=a("bqBrJ").Buffer,i=a("i9W9Q");function s(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}r=function(e,t){for(;e._cache.length<t.length;)e._cache=o.concat([e._cache,s(e)]);var n=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),i(t,n)}})),a.register("bSabi",(function(t,n){var r;e(t.exports,"encrypt",(()=>r),(e=>r=e));var o=a("i9W9Q"),i=a("8ByQm").Buffer,s=a("dPGrC");function l(e){var t=e._cipher.encryptBlockRaw(e._prev);return s(e._prev),t}r=function(e,t){var n=Math.ceil(t.length/16),r=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*n)]);for(var a=0;a<n;a++){var s=l(e),c=r+16*a;e._cache.writeUInt32BE(s[0],c+0),e._cache.writeUInt32BE(s[1],c+4),e._cache.writeUInt32BE(s[2],c+8),e._cache.writeUInt32BE(s[3],c+12)}var u=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),o(t,u)}})),a.register("dPGrC",(function(e,t){e.exports=function(e){for(var t,n=e.length;n--;){if(255!==(t=e.readUInt8(n))){t++,e.writeUInt8(t,n);break}e.writeUInt8(0,n)}}})),a.register("6P430",(function(e,t){e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')})),a.register("dU8tN",(function(e,t){var n=a("5gOZ5"),r=a("8ByQm").Buffer,o=a("9HuUe"),i=a("5jAh8"),s=a("zwlJI"),l=a("i9W9Q"),c=a("dPGrC");function u(e,t,i,a){o.call(this);var l=r.alloc(4,0);this._cipher=new n.AES(t);var u=this._cipher.encryptBlock(l);this._ghash=new s(u),i=function(e,t,n){if(12===t.length)return e._finID=r.concat([t,r.from([0,0,0,1])]),r.concat([t,r.from([0,0,0,2])]);var o=new s(n),i=t.length,a=i%16;o.update(t),a&&(a=16-a,o.update(r.alloc(a,0))),o.update(r.alloc(8,0));var l=8*i,u=r.alloc(8);u.writeUIntBE(l,0,8),o.update(u),e._finID=o.state;var d=r.from(e._finID);return c(d),d}(this,i,u),this._prev=r.from(i),this._cache=r.allocUnsafe(0),this._secCache=r.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(u,o),u.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=r.alloc(t,0),this._ghash.update(t))}this._called=!0;var n=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(n),this._len+=e.length,n},u.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=l(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var n=0;e.length!==t.length&&n++;for(var r=Math.min(e.length,t.length),o=0;o<r;++o)n+=e[o]^t[o];return n}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},u.prototype.getAuthTag=function(){if(this._decrypt||!r.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},u.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},u.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=u})),a.register("5gOZ5",(function(t,n){var r;e(t.exports,"AES",(()=>r),(e=>r=e));var o=a("8ByQm").Buffer;function i(e){o.isBuffer(e)||(e=o.from(e));for(var t=e.length/4|0,n=new Array(t),r=0;r<t;r++)n[r]=e.readUInt32BE(4*r);return n}function s(e){for(;0<e.length;e++)e[0]=0}function l(e,t,n,r,o){for(var i,a,s,l,c=n[0],u=n[1],d=n[2],f=n[3],h=e[0]^t[0],p=e[1]^t[1],m=e[2]^t[2],g=e[3]^t[3],v=4,b=1;b<o;b++)i=c[h>>>24]^u[p>>>16&255]^d[m>>>8&255]^f[255&g]^t[v++],a=c[p>>>24]^u[m>>>16&255]^d[g>>>8&255]^f[255&h]^t[v++],s=c[m>>>24]^u[g>>>16&255]^d[h>>>8&255]^f[255&p]^t[v++],l=c[g>>>24]^u[h>>>16&255]^d[p>>>8&255]^f[255&m]^t[v++],h=i,p=a,m=s,g=l;return i=(r[h>>>24]<<24|r[p>>>16&255]<<16|r[m>>>8&255]<<8|r[255&g])^t[v++],a=(r[p>>>24]<<24|r[m>>>16&255]<<16|r[g>>>8&255]<<8|r[255&h])^t[v++],s=(r[m>>>24]<<24|r[g>>>16&255]<<16|r[h>>>8&255]<<8|r[255&p])^t[v++],l=(r[g>>>24]<<24|r[h>>>16&255]<<16|r[p>>>8&255]<<8|r[255&m])^t[v++],[i>>>=0,a>>>=0,s>>>=0,l>>>=0]}var c=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],r=[],o=[[],[],[],[]],i=[[],[],[],[]],a=0,s=0,l=0;l<256;++l){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,n[a]=c,r[c]=a;var u=e[a],d=e[u],f=e[d],h=257*e[c]^16843008*c;o[0][a]=h<<24|h>>>8,o[1][a]=h<<16|h>>>16,o[2][a]=h<<8|h>>>24,o[3][a]=h,h=16843009*f^65537*d^257*u^16843008*a,i[0][c]=h<<24|h>>>8,i[1][c]=h<<16|h>>>16,i[2][c]=h<<8|h>>>24,i[3][c]=h,0===a?a=s=1:(a=u^e[e[e[f^u]]],s^=e[e[s]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:o,INV_SUB_MIX:i}}();function d(e){this._key=i(e),this._reset()}d.blockSize=16,d.keySize=32,d.prototype.blockSize=d.blockSize,d.prototype.keySize=d.keySize,d.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,r=4*(n+1),o=[],i=0;i<t;i++)o[i]=e[i];for(i=t;i<r;i++){var a=o[i-1];i%t==0?(a=a<<8|a>>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=c[i/t|0]<<24):t>6&&i%t==4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),o[i]=o[i-t]^a}for(var s=[],l=0;l<r;l++){var d=r-l,f=o[d-(l%4?0:4)];s[l]=l<4||d<=4?f:u.INV_SUB_MIX[0][u.SBOX[f>>>24]]^u.INV_SUB_MIX[1][u.SBOX[f>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[f>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&f]]}this._nRounds=n,this._keySchedule=o,this._invKeySchedule=s},d.prototype.encryptBlockRaw=function(e){return l(e=i(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},d.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=o.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},d.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var n=l(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),r=o.allocUnsafe(16);return r.writeUInt32BE(n[0],0),r.writeUInt32BE(n[3],4),r.writeUInt32BE(n[2],8),r.writeUInt32BE(n[1],12),r},d.prototype.scrub=function(){s(this._keySchedule),s(this._invKeySchedule),s(this._key)},r=d})),a.register("zwlJI",(function(e,t){var n=a("8ByQm").Buffer,r=n.alloc(16,0);function o(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function i(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}i.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},i.prototype._multiply=function(){for(var e,t,n,r=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],a=-1;++a<128;){for(0!=(this.state[~~(a/8)]&1<<7-a%8)&&(i[0]^=r[0],i[1]^=r[1],i[2]^=r[2],i[3]^=r[3]),n=0!=(1&r[3]),t=3;t>0;t--)r[t]=r[t]>>>1|(1&r[t-1])<<31;r[0]=r[0]>>>1,n&&(r[0]=-520093696^r[0])}this.state=o(i)},i.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},i.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,r],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=i})),a.register("kqHo3",(function(e,t){var n=a("5gOZ5"),r=a("8ByQm").Buffer,o=a("9HuUe");function i(e,t,i,a){o.call(this),this._cipher=new n.AES(t),this._prev=r.from(i),this._cache=r.allocUnsafe(0),this._secCache=r.allocUnsafe(0),this._decrypt=a,this._mode=e}a("5jAh8")(i,o),i.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},i.prototype._final=function(){this._cipher.scrub()},e.exports=i})),a.register("2tkTk",(function(e,t){var n=a("8ByQm").Buffer,r=a("d5AKh");e.exports=function(e,t,o,i){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=o/8,s=n.alloc(a),l=n.alloc(i||0),c=n.alloc(0);a>0||i>0;){var u=new r;u.update(c),u.update(e),t&&u.update(t),c=u.digest();var d=0;if(a>0){var f=s.length-a;d=Math.min(a,c.length),c.copy(s,f,0,d),a-=d}if(d<c.length&&i>0){var h=l.length-i,p=Math.min(i,c.length-d);c.copy(l,h,d,d+p),i-=p}}return c.fill(0),{key:s,iv:l}}})),a.register("4nqK6",(function(t,n){var r,o;e(t.exports,"createDecipher",(()=>r),(e=>r=e)),e(t.exports,"createDecipheriv",(()=>o),(e=>o=e));var i=a("dU8tN"),s=a("8ByQm").Buffer,l=a("cD8zA"),c=a("kqHo3"),u=a("9HuUe"),d=a("5gOZ5"),f=a("2tkTk");function h(e,t,n){u.call(this),this._cache=new p,this._last=void 0,this._cipher=new d.AES(t),this._prev=s.from(n),this._mode=e,this._autopadding=!0}function p(){this.cache=s.allocUnsafe(0)}function m(e,t,n){var r=l[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");if("string"==typeof n&&(n=s.from(n)),"GCM"!==r.mode&&n.length!==r.iv)throw new TypeError("invalid iv length "+n.length);if("string"==typeof t&&(t=s.from(t)),t.length!==r.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===r.type?new c(r.module,t,n,!0):"auth"===r.type?new i(r.module,t,n,!0):new h(r.module,t,n)}a("5jAh8")(h,u),h.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get(this._autopadding);)n=this._mode.decrypt(this,t),r.push(n);return s.concat(r)},h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var n=-1;for(;++n<t;)if(e[n+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},p.prototype.add=function(e){this.cache=s.concat([this.cache,e])},p.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},p.prototype.flush=function(){if(this.cache.length)return this.cache},r=function(e,t){var n=l[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var r=f(t,!1,n.key,n.iv);return m(e,r.key,r.iv)},o=m})),a.register("bJC4J",(function(t,n){var r,o,i,a,s,l,c,u;e(t.exports,"des-ecb",(()=>r),(e=>r=e)),e(t.exports,"des-cbc",(()=>o),(e=>o=e)),e(t.exports,"des",(()=>i),(e=>i=e)),e(t.exports,"des-ede3-cbc",(()=>a),(e=>a=e)),e(t.exports,"des3",(()=>s),(e=>s=e)),e(t.exports,"des-ede3",(()=>l),(e=>l=e)),e(t.exports,"des-ede-cbc",(()=>c),(e=>c=e)),e(t.exports,"des-ede",(()=>u),(e=>u=e)),r={key:8,iv:0},o=i={key:8,iv:8},a=s={key:24,iv:8},l={key:24,iv:0},c={key:16,iv:8},u={key:16,iv:0}})),a.register("hzteC",(function(t,n){var r,o,i,s,l;e(t.exports,"DiffieHellmanGroup",(()=>r),(e=>r=e)),e(t.exports,"createDiffieHellmanGroup",(()=>o),(e=>o=e)),e(t.exports,"getDiffieHellman",(()=>i),(e=>i=e)),e(t.exports,"createDiffieHellman",(()=>s),(e=>s=e)),e(t.exports,"DiffieHellman",(()=>l),(e=>l=e));var c=a("bqBrJ").Buffer,u=a("iHSaM"),d=a("eDa4Q"),f=a("8cNuf");var h={binary:!0,hex:!0,base64:!0};r=o=i=function(e){var t=new c(d[e].prime,"hex"),n=new c(d[e].gen,"hex");return new f(t,n)},s=l=function e(t,n,r,o){return c.isBuffer(n)||void 0===h[n]?e(t,"binary",n,r):(n=n||"binary",o=o||"binary",r=r||new c([2]),c.isBuffer(r)||(r=new c(r,o)),"number"==typeof t?new f(u(t,r),r,!0):(c.isBuffer(t)||(t=new c(t,n)),new f(t,r,!0)))}})),a.register("iHSaM",(function(e,t){var n=a("3xr1Z");e.exports=v,v.simpleSieve=m,v.fermatTest=g;var r=a("jXr8Y"),o=new r(24),i=new(a("eYSrG")),s=new r(1),l=new r(2),c=new r(5),u=(new r(16),new r(8),new r(10)),d=new r(3),f=(new r(7),new r(11)),h=new r(4),p=(new r(12),null);function m(e){for(var t=function(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,n=3;n<1048576;n+=2){for(var r=Math.ceil(Math.sqrt(n)),o=0;o<t&&e[o]<=r&&n%e[o]!=0;o++);t!==o&&e[o]<=r||(e[t++]=n)}return p=e,e}(),n=0;n<t.length;n++)if(0===e.modn(t[n]))return 0===e.cmpn(t[n]);return!0}function g(e){var t=r.mont(e);return 0===l.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function v(e,t){if(e<16)return new r(2===t||5===t?[140,123]:[140,39]);var a,p;for(t=new r(t);;){for(a=new r(n(Math.ceil(e/8)));a.bitLength()>e;)a.ishrn(1);if(a.isEven()&&a.iadd(s),a.testn(1)||a.iadd(l),t.cmp(l)){if(!t.cmp(c))for(;a.mod(u).cmp(d);)a.iadd(h)}else for(;a.mod(o).cmp(f);)a.iadd(h);if(m(p=a.shrn(1))&&m(a)&&g(p)&&g(a)&&i.test(p)&&i.test(a))return a}}})),a.register("jXr8Y",(function(e,t){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var i;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:a("1DJXa").Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function l(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,r){for(var o=0,i=Math.min(e.length,n),a=t;a<i;a++){var s=e.charCodeAt(a)-48;o*=r,o+=s>=49?s-49+10:s>=17?s-17+10:s}return o}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,r):(this._parseBase(e,t,o),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,s=0;if("be"===r)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var o,i=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)o=l(e,t,r)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)o=l(e,t,r)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,l=0,u=n;u<s;u+=r)l=c(e,u,u+r,t),this.imuln(o),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var d=1;for(l=c(e,u,e.length,t),u=0;u<a;u++)d*=t;this.imuln(d),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,l=a/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var u=l>>>26,d=67108863&l,f=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=f;h++){var p=c-h|0;u+=(a=(o=0|e.words[p])*(i=0|t.words[h])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,l=0|u}return 0!==l?n.words[c]=0|l:n.length--,n.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var o=0,i=0,a=0;a<this.length;a++){var s=this.words[a],l=(16777215&(s<<o|i)).toString(16);r=0!==(i=s>>>24-o&16777215)||a!==this.length-1?u[6-l.length]+l+r:l+r,(o+=2)>=26&&(o-=26,a--)}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=d[e],h=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==i),this.toArrayLike(i,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var o=this.byteLength(),i=r||Math.max(1,o);n(o<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,s,l="le"===t,c=new e(i),u=this.clone();if(l){for(s=0;!u.isZero();s++)a=u.andln(255),u.iushrn(8),c[s]=a;for(;s<i;s++)c[s]=0}else{for(s=0;s<i-o;s++)c[s]=0;for(s=0;!u.isZero();s++)a=u.andln(255),u.iushrn(8),c[i-s-1]=a}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return r>0&&(this.words[o]=~this.words[o]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<o:this.words[r]&~(1<<o),this.strip()},o.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i<r.length;i++)t=(0|n.words[i])+(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<n.length;i++)t=(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)i=(t=(0|n.words[a])-(0|r.words[a])+i)>>26,this.words[a]=67108863&t;for(;0!==i&&a<n.length;a++)i=(t=(0|n.words[a])+i)>>26,this.words[a]=67108863&t;if(0===i&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,n){var r,o,i,a=e.words,s=t.words,l=n.words,c=0,u=0|a[0],d=8191&u,f=u>>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],v=8191&g,b=g>>>13,y=0|a[3],w=8191&y,x=y>>>13,S=0|a[4],M=8191&S,_=S>>>13,E=0|a[5],A=8191&E,C=E>>>13,k=0|a[6],T=8191&k,I=k>>>13,O=0|a[7],R=8191&O,P=O>>>13,N=0|a[8],L=8191&N,B=N>>>13,D=0|a[9],j=8191&D,F=D>>>13,z=0|s[0],U=8191&z,H=z>>>13,G=0|s[1],W=8191&G,V=G>>>13,q=0|s[2],K=8191&q,$=q>>>13,J=0|s[3],X=8191&J,Q=J>>>13,Y=0|s[4],Z=8191&Y,ee=Y>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],le=8191&se,ce=se>>>13,ue=0|s[8],de=8191&ue,fe=ue>>>13,he=0|s[9],pe=8191&he,me=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(c+(r=Math.imul(d,U))|0)+((8191&(o=(o=Math.imul(d,H))+Math.imul(f,U)|0))<<13)|0;c=((i=Math.imul(f,H))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,U),o=(o=Math.imul(p,H))+Math.imul(m,U)|0,i=Math.imul(m,H);var ve=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(o=(o=o+Math.imul(d,V)|0)+Math.imul(f,W)|0))<<13)|0;c=((i=i+Math.imul(f,V)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,U),o=(o=Math.imul(v,H))+Math.imul(b,U)|0,i=Math.imul(b,H),r=r+Math.imul(p,W)|0,o=(o=o+Math.imul(p,V)|0)+Math.imul(m,W)|0,i=i+Math.imul(m,V)|0;var be=(c+(r=r+Math.imul(d,K)|0)|0)+((8191&(o=(o=o+Math.imul(d,$)|0)+Math.imul(f,K)|0))<<13)|0;c=((i=i+Math.imul(f,$)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,U),o=(o=Math.imul(w,H))+Math.imul(x,U)|0,i=Math.imul(x,H),r=r+Math.imul(v,W)|0,o=(o=o+Math.imul(v,V)|0)+Math.imul(b,W)|0,i=i+Math.imul(b,V)|0,r=r+Math.imul(p,K)|0,o=(o=o+Math.imul(p,$)|0)+Math.imul(m,K)|0,i=i+Math.imul(m,$)|0;var ye=(c+(r=r+Math.imul(d,X)|0)|0)+((8191&(o=(o=o+Math.imul(d,Q)|0)+Math.imul(f,X)|0))<<13)|0;c=((i=i+Math.imul(f,Q)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(M,U),o=(o=Math.imul(M,H))+Math.imul(_,U)|0,i=Math.imul(_,H),r=r+Math.imul(w,W)|0,o=(o=o+Math.imul(w,V)|0)+Math.imul(x,W)|0,i=i+Math.imul(x,V)|0,r=r+Math.imul(v,K)|0,o=(o=o+Math.imul(v,$)|0)+Math.imul(b,K)|0,i=i+Math.imul(b,$)|0,r=r+Math.imul(p,X)|0,o=(o=o+Math.imul(p,Q)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,Q)|0;var we=(c+(r=r+Math.imul(d,Z)|0)|0)+((8191&(o=(o=o+Math.imul(d,ee)|0)+Math.imul(f,Z)|0))<<13)|0;c=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(A,U),o=(o=Math.imul(A,H))+Math.imul(C,U)|0,i=Math.imul(C,H),r=r+Math.imul(M,W)|0,o=(o=o+Math.imul(M,V)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,V)|0,r=r+Math.imul(w,K)|0,o=(o=o+Math.imul(w,$)|0)+Math.imul(x,K)|0,i=i+Math.imul(x,$)|0,r=r+Math.imul(v,X)|0,o=(o=o+Math.imul(v,Q)|0)+Math.imul(b,X)|0,i=i+Math.imul(b,Q)|0,r=r+Math.imul(p,Z)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,Z)|0,i=i+Math.imul(m,ee)|0;var xe=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(o=(o=o+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;c=((i=i+Math.imul(f,re)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(T,U),o=(o=Math.imul(T,H))+Math.imul(I,U)|0,i=Math.imul(I,H),r=r+Math.imul(A,W)|0,o=(o=o+Math.imul(A,V)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(M,K)|0,o=(o=o+Math.imul(M,$)|0)+Math.imul(_,K)|0,i=i+Math.imul(_,$)|0,r=r+Math.imul(w,X)|0,o=(o=o+Math.imul(w,Q)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,Q)|0,r=r+Math.imul(v,Z)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(b,Z)|0,i=i+Math.imul(b,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(m,ne)|0,i=i+Math.imul(m,re)|0;var Se=(c+(r=r+Math.imul(d,ie)|0)|0)+((8191&(o=(o=o+Math.imul(d,ae)|0)+Math.imul(f,ie)|0))<<13)|0;c=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,U),o=(o=Math.imul(R,H))+Math.imul(P,U)|0,i=Math.imul(P,H),r=r+Math.imul(T,W)|0,o=(o=o+Math.imul(T,V)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,V)|0,r=r+Math.imul(A,K)|0,o=(o=o+Math.imul(A,$)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,$)|0,r=r+Math.imul(M,X)|0,o=(o=o+Math.imul(M,Q)|0)+Math.imul(_,X)|0,i=i+Math.imul(_,Q)|0,r=r+Math.imul(w,Z)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(x,Z)|0,i=i+Math.imul(x,ee)|0,r=r+Math.imul(v,ne)|0,o=(o=o+Math.imul(v,re)|0)+Math.imul(b,ne)|0,i=i+Math.imul(b,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0;var Me=(c+(r=r+Math.imul(d,le)|0)|0)+((8191&(o=(o=o+Math.imul(d,ce)|0)+Math.imul(f,le)|0))<<13)|0;c=((i=i+Math.imul(f,ce)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(L,U),o=(o=Math.imul(L,H))+Math.imul(B,U)|0,i=Math.imul(B,H),r=r+Math.imul(R,W)|0,o=(o=o+Math.imul(R,V)|0)+Math.imul(P,W)|0,i=i+Math.imul(P,V)|0,r=r+Math.imul(T,K)|0,o=(o=o+Math.imul(T,$)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,$)|0,r=r+Math.imul(A,X)|0,o=(o=o+Math.imul(A,Q)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,Q)|0,r=r+Math.imul(M,Z)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(_,Z)|0,i=i+Math.imul(_,ee)|0,r=r+Math.imul(w,ne)|0,o=(o=o+Math.imul(w,re)|0)+Math.imul(x,ne)|0,i=i+Math.imul(x,re)|0,r=r+Math.imul(v,ie)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,ae)|0,r=r+Math.imul(p,le)|0,o=(o=o+Math.imul(p,ce)|0)+Math.imul(m,le)|0,i=i+Math.imul(m,ce)|0;var _e=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(o=(o=o+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;c=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(j,U),o=(o=Math.imul(j,H))+Math.imul(F,U)|0,i=Math.imul(F,H),r=r+Math.imul(L,W)|0,o=(o=o+Math.imul(L,V)|0)+Math.imul(B,W)|0,i=i+Math.imul(B,V)|0,r=r+Math.imul(R,K)|0,o=(o=o+Math.imul(R,$)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,$)|0,r=r+Math.imul(T,X)|0,o=(o=o+Math.imul(T,Q)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,Q)|0,r=r+Math.imul(A,Z)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(C,Z)|0,i=i+Math.imul(C,ee)|0,r=r+Math.imul(M,ne)|0,o=(o=o+Math.imul(M,re)|0)+Math.imul(_,ne)|0,i=i+Math.imul(_,re)|0,r=r+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,r=r+Math.imul(v,le)|0,o=(o=o+Math.imul(v,ce)|0)+Math.imul(b,le)|0,i=i+Math.imul(b,ce)|0,r=r+Math.imul(p,de)|0,o=(o=o+Math.imul(p,fe)|0)+Math.imul(m,de)|0,i=i+Math.imul(m,fe)|0;var Ee=(c+(r=r+Math.imul(d,pe)|0)|0)+((8191&(o=(o=o+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;c=((i=i+Math.imul(f,me)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,W),o=(o=Math.imul(j,V))+Math.imul(F,W)|0,i=Math.imul(F,V),r=r+Math.imul(L,K)|0,o=(o=o+Math.imul(L,$)|0)+Math.imul(B,K)|0,i=i+Math.imul(B,$)|0,r=r+Math.imul(R,X)|0,o=(o=o+Math.imul(R,Q)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Q)|0,r=r+Math.imul(T,Z)|0,o=(o=o+Math.imul(T,ee)|0)+Math.imul(I,Z)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(A,ne)|0,o=(o=o+Math.imul(A,re)|0)+Math.imul(C,ne)|0,i=i+Math.imul(C,re)|0,r=r+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,r=r+Math.imul(w,le)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(x,le)|0,i=i+Math.imul(x,ce)|0,r=r+Math.imul(v,de)|0,o=(o=o+Math.imul(v,fe)|0)+Math.imul(b,de)|0,i=i+Math.imul(b,fe)|0;var Ae=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),o=(o=Math.imul(j,$))+Math.imul(F,K)|0,i=Math.imul(F,$),r=r+Math.imul(L,X)|0,o=(o=o+Math.imul(L,Q)|0)+Math.imul(B,X)|0,i=i+Math.imul(B,Q)|0,r=r+Math.imul(R,Z)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(P,Z)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(T,ne)|0,o=(o=o+Math.imul(T,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,ae)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,ae)|0,r=r+Math.imul(M,le)|0,o=(o=o+Math.imul(M,ce)|0)+Math.imul(_,le)|0,i=i+Math.imul(_,ce)|0,r=r+Math.imul(w,de)|0,o=(o=o+Math.imul(w,fe)|0)+Math.imul(x,de)|0,i=i+Math.imul(x,fe)|0;var Ce=(c+(r=r+Math.imul(v,pe)|0)|0)+((8191&(o=(o=o+Math.imul(v,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((i=i+Math.imul(b,me)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,X),o=(o=Math.imul(j,Q))+Math.imul(F,X)|0,i=Math.imul(F,Q),r=r+Math.imul(L,Z)|0,o=(o=o+Math.imul(L,ee)|0)+Math.imul(B,Z)|0,i=i+Math.imul(B,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(P,ne)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(T,ie)|0,o=(o=o+Math.imul(T,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(A,le)|0,o=(o=o+Math.imul(A,ce)|0)+Math.imul(C,le)|0,i=i+Math.imul(C,ce)|0,r=r+Math.imul(M,de)|0,o=(o=o+Math.imul(M,fe)|0)+Math.imul(_,de)|0,i=i+Math.imul(_,fe)|0;var ke=(c+(r=r+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(x,pe)|0))<<13)|0;c=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,Z),o=(o=Math.imul(j,ee))+Math.imul(F,Z)|0,i=Math.imul(F,ee),r=r+Math.imul(L,ne)|0,o=(o=o+Math.imul(L,re)|0)+Math.imul(B,ne)|0,i=i+Math.imul(B,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,ae)|0,r=r+Math.imul(T,le)|0,o=(o=o+Math.imul(T,ce)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,ce)|0,r=r+Math.imul(A,de)|0,o=(o=o+Math.imul(A,fe)|0)+Math.imul(C,de)|0,i=i+Math.imul(C,fe)|0;var Te=(c+(r=r+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,me)|0)+Math.imul(_,pe)|0))<<13)|0;c=((i=i+Math.imul(_,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ne),o=(o=Math.imul(j,re))+Math.imul(F,ne)|0,i=Math.imul(F,re),r=r+Math.imul(L,ie)|0,o=(o=o+Math.imul(L,ae)|0)+Math.imul(B,ie)|0,i=i+Math.imul(B,ae)|0,r=r+Math.imul(R,le)|0,o=(o=o+Math.imul(R,ce)|0)+Math.imul(P,le)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(T,de)|0,o=(o=o+Math.imul(T,fe)|0)+Math.imul(I,de)|0,i=i+Math.imul(I,fe)|0;var Ie=(c+(r=r+Math.imul(A,pe)|0)|0)+((8191&(o=(o=o+Math.imul(A,me)|0)+Math.imul(C,pe)|0))<<13)|0;c=((i=i+Math.imul(C,me)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,ie),o=(o=Math.imul(j,ae))+Math.imul(F,ie)|0,i=Math.imul(F,ae),r=r+Math.imul(L,le)|0,o=(o=o+Math.imul(L,ce)|0)+Math.imul(B,le)|0,i=i+Math.imul(B,ce)|0,r=r+Math.imul(R,de)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,fe)|0;var Oe=(c+(r=r+Math.imul(T,pe)|0)|0)+((8191&(o=(o=o+Math.imul(T,me)|0)+Math.imul(I,pe)|0))<<13)|0;c=((i=i+Math.imul(I,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,le),o=(o=Math.imul(j,ce))+Math.imul(F,le)|0,i=Math.imul(F,ce),r=r+Math.imul(L,de)|0,o=(o=o+Math.imul(L,fe)|0)+Math.imul(B,de)|0,i=i+Math.imul(B,fe)|0;var Re=(c+(r=r+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,me)|0)+Math.imul(P,pe)|0))<<13)|0;c=((i=i+Math.imul(P,me)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,de),o=(o=Math.imul(j,fe))+Math.imul(F,de)|0,i=Math.imul(F,fe);var Pe=(c+(r=r+Math.imul(L,pe)|0)|0)+((8191&(o=(o=o+Math.imul(L,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((i=i+Math.imul(B,me)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(c+(r=Math.imul(j,pe))|0)+((8191&(o=(o=Math.imul(j,me))+Math.imul(F,pe)|0))<<13)|0;return c=((i=Math.imul(F,me))+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,l[0]=ge,l[1]=ve,l[2]=be,l[3]=ye,l[4]=we,l[5]=xe,l[6]=Se,l[7]=Me,l[8]=_e,l[9]=Ee,l[10]=Ae,l[11]=Ce,l[12]=ke,l[13]=Te,l[14]=Ie,l[15]=Oe,l[16]=Re,l[17]=Pe,l[18]=Ne,0!==c&&(l[19]=c,n.length++),n};function m(e,t,n){return(new g).mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=h),o.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?p(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i<n.length-1;i++){var a=o;o=0;for(var s=67108863&r,l=Math.min(i,t.length-1),c=Math.max(0,i-e.length+1);c<=l;c++){var u=i-c,d=(0|e.words[u])*(0|t.words[c]),f=67108863&d;s=67108863&(f=f+s|0),o+=(a=(a=a+(d/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):m(this,e,t),n},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},g.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,o=0;o<t;o++)r|=(1&e)<<t-o-1,e>>=1;return r},g.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a<i;a++)r[a]=t[e[a]],o[a]=n[e[a]]},g.prototype.transform=function(e,t,n,r,o,i){this.permute(i,e,t,n,r,o);for(var a=1;a<o;a<<=1)for(var s=a<<1,l=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),u=0;u<o;u+=s)for(var d=l,f=c,h=0;h<a;h++){var p=n[u+h],m=r[u+h],g=n[u+h+a],v=r[u+h+a],b=d*g-f*v;v=d*v+f*g,g=b,n[u+h]=p+g,r[u+h]=m+v,n[u+h+a]=p-g,r[u+h+a]=m-v,h!==s&&(b=l*d-c*f,f=l*f+c*d,d=b)}},g.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,o=0;for(n=n/2|0;n;n>>>=1)o++;return 1<<o+1+r},g.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var o=e[r];e[r]=e[n-r-1],e[n-r-1]=o,o=t[r],t[r]=-t[n-r-1],t[n-r-1]=-o}},g.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var o=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&o,n=o<67108864?0:o/67108864|0}return e},g.prototype.convert13b=function(e,t,r,o){for(var i=0,a=0;a<t;a++)i+=0|e[a],r[2*a]=8191&i,i>>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a<o;++a)r[a]=0;n(0===i),n(0==(-8192&i))},g.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},g.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),o=this.makeRBT(r),i=this.stub(r),a=new Array(r),s=new Array(r),l=new Array(r),c=new Array(r),u=new Array(r),d=new Array(r),f=n.words;f.length=r,this.convert13b(e.words,e.length,a,r),this.convert13b(t.words,t.length,c,r),this.transform(a,i,s,l,r,o),this.transform(c,i,u,d,r,o);for(var h=0;h<r;h++){var p=s[h]*u[h]-l[h]*d[h];l[h]=s[h]*d[h]+l[h]*u[h],s[h]=p}return this.conjugate(s,l,r),this.transform(s,l,f,i,r,o),this.conjugate(f,i,r),this.normalize13b(f,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),m(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var o=(0|this.words[r])*e,i=(67108863&o)+(67108863&t);t>>=26,t+=o/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,o=n%26;t[n]=(e.words[r]&1<<o)>>>o}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())0!==t[r]&&(n=n.mul(i));return n},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,o=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&i,l=(0|this.words[t])-s<<r;this.words[t]=l|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var o;n("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<<i,l=r;if(o-=a,o=Math.max(0,o),l){for(var c=0;c<a;c++)l.words[c]=this.words[c];l.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=o);c--){var d=0|this.words[c];this.words[c]=u<<26-i|d>>>i,u=d&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,o=1<<t;return!(this.length<=r)&&!!(this.words[r]&o)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var o,i,a=e.length+r;this._expand(a);var s=0;for(o=0;o<e.length;o++){i=(0|this.words[o+r])+s;var l=(0|e.words[o])*t;s=((i-=67108863&l)>>26)-(l/67108864|0),this.words[o+r]=67108863&i}for(;o<this.length-r;o++)s=(i=(0|this.words[o+r])+s)>>26,this.words[o+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,o=0;o<this.length;o++)s=(i=-(0|this.words[o])+s)>>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,l=r.length-i.length;if("mod"!==t){(s=new o(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var u=r.clone()._ishlnsubmul(i,1,l);0===u.negative&&(r=u,s&&(s.words[l]=1));for(var d=l-1;d>=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(i,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=f)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=67108864%e,r=0,o=this.length-1;o>=0;o--)r=(t*r+(0|this.words[o]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var o=(0|this.words[r])+67108864*t;this.words[r]=o/e|0,t=o%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),l=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(u),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(d)),s.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(l)):(r.isub(t),s.isub(i),l.isub(a))}return{a:s,b:l,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),l=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(t.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);for(var d=0,f=1;0==(r.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,o=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=o,this;for(var i=o,a=r;0!==i&&a<this.length;a++){var s=0|this.words[a];i=(s+=i)>>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){r<o?t=-1:r>o&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new M(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},r(y,b),y.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),o=0;o<r;o++)t.words[o]=e.words[o];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&n,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&n)<<4|i>>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(w,b),r(x,b),r(S,b),S.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,o=67108863&r;r>>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new w;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},M.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var d=this.pow(u,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<p);var v=this.pow(d,new o(1).iushln(p-g-1));f=f.redMul(v),d=v.redSqr(),h=h.redMul(d),p=g}return f},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new o(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var i=n[0],a=0,s=0,l=t.bitLength()%26;for(0===l&&(l=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],u=l-1;u>=0;u--){var d=c>>u&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===u)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}l=26}return i},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new _(e)},r(_,M),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},_.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)})),a.register("eYSrG",(function(e,t){var n=a("jXr8Y"),r=a("hZWXr");function o(e){this.rand=e||new r.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var o=new n(this.rand.generate(r))}while(o.cmp(e)>=0);return o},o.prototype._randrange=function(e,t){var n=t.sub(e);return e.add(this._randbelow(n))},o.prototype.test=function(e,t,r){var o=e.bitLength(),i=n.mont(e),a=new n(1).toRed(i);t||(t=Math.max(1,o/48|0));for(var s=e.subn(1),l=0;!s.testn(l);l++);for(var c=e.shrn(l),u=s.toRed(i);t>0;t--){var d=this._randrange(new n(2),s);r&&r(d);var f=d.toRed(i).redPow(c);if(0!==f.cmp(a)&&0!==f.cmp(u)){for(var h=1;h<l;h++){if(0===(f=f.redSqr()).cmp(a))return!1;if(0===f.cmp(u))break}if(h===l)return!1}}return!0},o.prototype.getDivisor=function(e,t){var r=e.bitLength(),o=n.mont(e),i=new n(1).toRed(o);t||(t=Math.max(1,r/48|0));for(var a=e.subn(1),s=0;!a.testn(s);s++);for(var l=e.shrn(s),c=a.toRed(o);t>0;t--){var u=this._randrange(new n(2),a),d=e.gcd(u);if(0!==d.cmpn(1))return d;var f=u.toRed(o).redPow(l);if(0!==f.cmp(i)&&0!==f.cmp(c)){for(var h=1;h<s;h++){if(0===(f=f.redSqr()).cmp(i))return f.fromRed().subn(1).gcd(e);if(0===f.cmp(c))break}if(h===s)return(f=f.redSqr()).fromRed().subn(1).gcd(e)}}return!1}})),a.register("hZWXr",(function(e,t){var n;function r(e){this.rand=e}if(e.exports=function(e){return n||(n=new r(null)),n.generate(e)},e.exports.Rand=r,r.prototype.generate=function(e){return this._rand(e)},r.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?r.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?r.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(r.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=a("1DJXa");if("function"!=typeof o.randomBytes)throw new Error("Not supported");r.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}})),a.register("eDa4Q",(function(e,t){e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')})),a.register("8cNuf",(function(e,t){var n=a("bqBrJ").Buffer,r=a("jXr8Y"),o=new(a("eYSrG")),i=new r(24),s=new r(11),l=new r(10),c=new r(3),u=new r(7),d=a("iHSaM"),f=a("3xr1Z");function h(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this._pub=new r(e),this}function p(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this._priv=new r(e),this}e.exports=g;var m={};function g(e,t,n){this.setGenerator(t),this.__prime=new r(e),this._prime=r.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,n?(this.setPublicKey=h,this.setPrivateKey=p):this._primeCode=8}function v(e,t){var r=new n(e.toArray());return t?r.toString(t):r}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var n=t.toString("hex"),r=[n,e.toString(16)].join("_");if(r in m)return m[r];var a,f=0;if(e.isEven()||!d.simpleSieve||!d.fermatTest(e)||!o.test(e))return f+=1,f+="02"===n||"05"===n?8:4,m[r]=f,f;switch(o.test(e.shrn(1))||(f+=2),n){case"02":e.mod(i).cmp(s)&&(f+=8);break;case"05":(a=e.mod(l)).cmp(c)&&a.cmp(u)&&(f+=8);break;default:f+=4}return m[r]=f,f}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new r(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(e){var t=(e=(e=new r(e)).toRed(this._prime)).redPow(this._priv).fromRed(),o=new n(t.toArray()),i=this.getPrime();if(o.length<i.length){var a=new n(i.length-o.length);a.fill(0),o=n.concat([a,o])}return o},g.prototype.getPublicKey=function(e){return v(this._pub,e)},g.prototype.getPrivateKey=function(e){return v(this._priv,e)},g.prototype.getPrime=function(e){return v(this.__prime,e)},g.prototype.getGenerator=function(e){return v(this._gen,e)},g.prototype.setGenerator=function(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this.__gen=e,this._gen=new r(e),this}})),a.register("cD2JS",(function(e,t){var n=a("8ByQm").Buffer,r=a("d8QYu"),o=a("8IqCp"),i=a("5jAh8"),s=a("hgNoQ"),l=a("ajRoR"),c=a("aeDps");function u(e){o.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){o.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){return new u(e)}function h(e){return new d(e)}Object.keys(c).forEach((function(e){c[e].id=n.from(c[e].id,"hex"),c[e.toLowerCase()]=c[e]})),i(u,o.Writable),u.prototype._write=function(e,t,n){this._hash.update(e),n()},u.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},u.prototype.sign=function(e,t){this.end();var n=this._hash.digest(),r=s(n,e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},i(d,o.Writable),d.prototype._write=function(e,t,n){this._hash.update(e),n()},d.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},d.prototype.verify=function(e,t,r){"string"==typeof t&&(t=n.from(t,r)),this.end();var o=this._hash.digest();return l(t,o,e,this._signType,this._tag)},e.exports={Sign:f,Verify:h,createSign:f,createVerify:h}})),a.register("hgNoQ",(function(e,t){var n=a("8ByQm").Buffer,r=a("7Q3Pj"),o=a("8sAbQ"),i=a("dkUCk").ec,s=a("fmDmL"),l=a("fEs62"),c=a("g4OMi");function u(e,t,o,i){if((e=n.from(e.toArray())).length<t.byteLength()){var a=n.alloc(t.byteLength()-e.length);e=n.concat([a,e])}var s=o.length,l=function(e,t){e=d(e,t),e=e.mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var o=n.alloc(t.byteLength()-r.length);r=n.concat([o,r])}return r}(o,t),c=n.alloc(s);c.fill(1);var u=n.alloc(s);return u=r(i,u).update(c).update(n.from([0])).update(e).update(l).digest(),c=r(i,u).update(c).digest(),{k:u=r(i,u).update(c).update(n.from([1])).update(e).update(l).digest(),v:c=r(i,u).update(c).digest()}}function d(e,t){var n=new s(e),r=(e.length<<3)-t.bitLength();return r>0&&n.ishrn(r),n}function f(e,t,o){var i,a;do{for(i=n.alloc(0);8*i.length<e.bitLength();)t.v=r(o,t.k).update(t.v).digest(),i=n.concat([i,t.v]);a=d(i,e),t.k=r(o,t.k).update(t.v).update(n.from([0])).digest(),t.v=r(o,t.k).update(t.v).digest()}while(-1!==a.cmp(e));return a}function h(e,t,n,r){return e.toRed(s.mont(n)).redPow(t).fromRed().mod(r)}e.exports=function(e,t,r,a,p){var m=l(t);if(m.curve){if("ecdsa"!==a&&"ecdsa/rsa"!==a)throw new Error("wrong private key type");return function(e,t){var r=c[t.curve.join(".")];if(!r)throw new Error("unknown curve "+t.curve.join("."));var o=new i(r).keyFromPrivate(t.privateKey),a=o.sign(e);return n.from(a.toDER())}(e,m)}if("dsa"===m.type){if("dsa"!==a)throw new Error("wrong private key type");return function(e,t,r){var o,i=t.params.priv_key,a=t.params.p,l=t.params.q,c=t.params.g,p=new s(0),m=d(e,l).mod(l),g=!1,v=u(i,l,e,r);for(;!1===g;)p=h(c,o=f(l,v,r),a,l),0===(g=o.invm(l).imul(m.add(i.mul(p))).mod(l)).cmpn(0)&&(g=!1,p=new s(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e));128&t[0]&&(t=[0].concat(t));var r=e.length+t.length+4,o=[48,r,2,e.length];return o=o.concat(e,[2,t.length],t),n.from(o)}(p,g)}(e,m,r)}if("rsa"!==a&&"ecdsa/rsa"!==a)throw new Error("wrong private key type");e=n.concat([p,e]);for(var g=m.modulus.byteLength(),v=[0,1];e.length+v.length+1<g;)v.push(255);v.push(0);for(var b=-1;++b<e.length;)v.push(e[b]);return o(v,m)},e.exports.getKey=u,e.exports.makeKey=f})),a.register("8sAbQ",(function(e,t){var n=a("bqBrJ").Buffer,r=a("7FPic"),o=a("3xr1Z");function i(e){var t,n=e.modulus.byteLength();do{t=new r(o(n))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function s(e,t){var o=function(e){var t=i(e);return{blinder:t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),a=t.modulus.byteLength(),s=new r(e).mul(o.blinder).umod(t.modulus),l=s.toRed(r.mont(t.prime1)),c=s.toRed(r.mont(t.prime2)),u=t.coefficient,d=t.prime1,f=t.prime2,h=l.redPow(t.exponent1).fromRed(),p=c.redPow(t.exponent2).fromRed(),m=h.isub(p).imul(u).umod(d).imul(f);return p.iadd(m).imul(o.unblinder).umod(t.modulus).toArrayLike(n,"be",a)}s.getr=i,e.exports=s})),a.register("7FPic",(function(e,t){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var i;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:a("1DJXa").Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function l(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,r,o){for(var i=0,a=0,s=Math.min(e.length,r),l=t;l<s;l++){var c=e.charCodeAt(l)-48;i*=o,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<o,"Invalid character"),i+=a}return i}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,r):(this._parseBase(e,t,o),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,s=0;if("be"===r)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var o,i=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)o=l(e,t,r)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)o=l(e,t,r)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,l=0,u=n;u<s;u+=r)l=c(e,u,u+r,t),this.imuln(o),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var d=1;for(l=c(e,u,e.length,t),u=0;u<a;u++)d*=t;this.imuln(d),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){u(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(e){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var o=0,i=0,a=0;a<this.length;a++){var s=this.words[a],l=(16777215&(s<<o|i)).toString(16);i=s>>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),r=0!==i||a!==this.length-1?f[6-l.length]+l+r:l+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],u=p[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(u).toString(e);r=(d=d.idivn(u)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},i&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(i,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,l=a/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var u=l>>>26,d=67108863&l,f=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=f;h++){var p=c-h|0;u+=(a=(o=0|e.words[p])*(i=0|t.words[h])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,l=0|u}return 0!==l?n.words[c]=0|l:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var o=this.byteLength(),i=r||Math.max(1,o);n(o<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,o),a},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,o=0,i=0;o<this.length;o++){var a=this.words[o]<<i|r;e[n++]=255&a,n<e.length&&(e[n++]=a>>8&255),n<e.length&&(e[n++]=a>>16&255),6===i?(n<e.length&&(e[n++]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,o=0,i=0;o<this.length;o++){var a=this.words[o]<<i|r;e[n--]=255&a,n>=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===i?(n>=0&&(e[n--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return r>0&&(this.words[o]=~this.words[o]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<o:this.words[r]&~(1<<o),this._strip()},o.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i<r.length;i++)t=(0|n.words[i])+(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<n.length;i++)t=(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)i=(t=(0|n.words[a])-(0|r.words[a])+i)>>26,this.words[a]=67108863&t;for(;0!==i&&a<n.length;a++)i=(t=(0|n.words[a])+i)>>26,this.words[a]=67108863&t;if(0===i&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,n){var r,o,i,a=e.words,s=t.words,l=n.words,c=0,u=0|a[0],d=8191&u,f=u>>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],v=8191&g,b=g>>>13,y=0|a[3],w=8191&y,x=y>>>13,S=0|a[4],M=8191&S,_=S>>>13,E=0|a[5],A=8191&E,C=E>>>13,k=0|a[6],T=8191&k,I=k>>>13,O=0|a[7],R=8191&O,P=O>>>13,N=0|a[8],L=8191&N,B=N>>>13,D=0|a[9],j=8191&D,F=D>>>13,z=0|s[0],U=8191&z,H=z>>>13,G=0|s[1],W=8191&G,V=G>>>13,q=0|s[2],K=8191&q,$=q>>>13,J=0|s[3],X=8191&J,Q=J>>>13,Y=0|s[4],Z=8191&Y,ee=Y>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],le=8191&se,ce=se>>>13,ue=0|s[8],de=8191&ue,fe=ue>>>13,he=0|s[9],pe=8191&he,me=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(c+(r=Math.imul(d,U))|0)+((8191&(o=(o=Math.imul(d,H))+Math.imul(f,U)|0))<<13)|0;c=((i=Math.imul(f,H))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,U),o=(o=Math.imul(p,H))+Math.imul(m,U)|0,i=Math.imul(m,H);var ve=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(o=(o=o+Math.imul(d,V)|0)+Math.imul(f,W)|0))<<13)|0;c=((i=i+Math.imul(f,V)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,U),o=(o=Math.imul(v,H))+Math.imul(b,U)|0,i=Math.imul(b,H),r=r+Math.imul(p,W)|0,o=(o=o+Math.imul(p,V)|0)+Math.imul(m,W)|0,i=i+Math.imul(m,V)|0;var be=(c+(r=r+Math.imul(d,K)|0)|0)+((8191&(o=(o=o+Math.imul(d,$)|0)+Math.imul(f,K)|0))<<13)|0;c=((i=i+Math.imul(f,$)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,U),o=(o=Math.imul(w,H))+Math.imul(x,U)|0,i=Math.imul(x,H),r=r+Math.imul(v,W)|0,o=(o=o+Math.imul(v,V)|0)+Math.imul(b,W)|0,i=i+Math.imul(b,V)|0,r=r+Math.imul(p,K)|0,o=(o=o+Math.imul(p,$)|0)+Math.imul(m,K)|0,i=i+Math.imul(m,$)|0;var ye=(c+(r=r+Math.imul(d,X)|0)|0)+((8191&(o=(o=o+Math.imul(d,Q)|0)+Math.imul(f,X)|0))<<13)|0;c=((i=i+Math.imul(f,Q)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(M,U),o=(o=Math.imul(M,H))+Math.imul(_,U)|0,i=Math.imul(_,H),r=r+Math.imul(w,W)|0,o=(o=o+Math.imul(w,V)|0)+Math.imul(x,W)|0,i=i+Math.imul(x,V)|0,r=r+Math.imul(v,K)|0,o=(o=o+Math.imul(v,$)|0)+Math.imul(b,K)|0,i=i+Math.imul(b,$)|0,r=r+Math.imul(p,X)|0,o=(o=o+Math.imul(p,Q)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,Q)|0;var we=(c+(r=r+Math.imul(d,Z)|0)|0)+((8191&(o=(o=o+Math.imul(d,ee)|0)+Math.imul(f,Z)|0))<<13)|0;c=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(A,U),o=(o=Math.imul(A,H))+Math.imul(C,U)|0,i=Math.imul(C,H),r=r+Math.imul(M,W)|0,o=(o=o+Math.imul(M,V)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,V)|0,r=r+Math.imul(w,K)|0,o=(o=o+Math.imul(w,$)|0)+Math.imul(x,K)|0,i=i+Math.imul(x,$)|0,r=r+Math.imul(v,X)|0,o=(o=o+Math.imul(v,Q)|0)+Math.imul(b,X)|0,i=i+Math.imul(b,Q)|0,r=r+Math.imul(p,Z)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,Z)|0,i=i+Math.imul(m,ee)|0;var xe=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(o=(o=o+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;c=((i=i+Math.imul(f,re)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(T,U),o=(o=Math.imul(T,H))+Math.imul(I,U)|0,i=Math.imul(I,H),r=r+Math.imul(A,W)|0,o=(o=o+Math.imul(A,V)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(M,K)|0,o=(o=o+Math.imul(M,$)|0)+Math.imul(_,K)|0,i=i+Math.imul(_,$)|0,r=r+Math.imul(w,X)|0,o=(o=o+Math.imul(w,Q)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,Q)|0,r=r+Math.imul(v,Z)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(b,Z)|0,i=i+Math.imul(b,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(m,ne)|0,i=i+Math.imul(m,re)|0;var Se=(c+(r=r+Math.imul(d,ie)|0)|0)+((8191&(o=(o=o+Math.imul(d,ae)|0)+Math.imul(f,ie)|0))<<13)|0;c=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,U),o=(o=Math.imul(R,H))+Math.imul(P,U)|0,i=Math.imul(P,H),r=r+Math.imul(T,W)|0,o=(o=o+Math.imul(T,V)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,V)|0,r=r+Math.imul(A,K)|0,o=(o=o+Math.imul(A,$)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,$)|0,r=r+Math.imul(M,X)|0,o=(o=o+Math.imul(M,Q)|0)+Math.imul(_,X)|0,i=i+Math.imul(_,Q)|0,r=r+Math.imul(w,Z)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(x,Z)|0,i=i+Math.imul(x,ee)|0,r=r+Math.imul(v,ne)|0,o=(o=o+Math.imul(v,re)|0)+Math.imul(b,ne)|0,i=i+Math.imul(b,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0;var Me=(c+(r=r+Math.imul(d,le)|0)|0)+((8191&(o=(o=o+Math.imul(d,ce)|0)+Math.imul(f,le)|0))<<13)|0;c=((i=i+Math.imul(f,ce)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(L,U),o=(o=Math.imul(L,H))+Math.imul(B,U)|0,i=Math.imul(B,H),r=r+Math.imul(R,W)|0,o=(o=o+Math.imul(R,V)|0)+Math.imul(P,W)|0,i=i+Math.imul(P,V)|0,r=r+Math.imul(T,K)|0,o=(o=o+Math.imul(T,$)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,$)|0,r=r+Math.imul(A,X)|0,o=(o=o+Math.imul(A,Q)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,Q)|0,r=r+Math.imul(M,Z)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(_,Z)|0,i=i+Math.imul(_,ee)|0,r=r+Math.imul(w,ne)|0,o=(o=o+Math.imul(w,re)|0)+Math.imul(x,ne)|0,i=i+Math.imul(x,re)|0,r=r+Math.imul(v,ie)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,ae)|0,r=r+Math.imul(p,le)|0,o=(o=o+Math.imul(p,ce)|0)+Math.imul(m,le)|0,i=i+Math.imul(m,ce)|0;var _e=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(o=(o=o+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;c=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(j,U),o=(o=Math.imul(j,H))+Math.imul(F,U)|0,i=Math.imul(F,H),r=r+Math.imul(L,W)|0,o=(o=o+Math.imul(L,V)|0)+Math.imul(B,W)|0,i=i+Math.imul(B,V)|0,r=r+Math.imul(R,K)|0,o=(o=o+Math.imul(R,$)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,$)|0,r=r+Math.imul(T,X)|0,o=(o=o+Math.imul(T,Q)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,Q)|0,r=r+Math.imul(A,Z)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(C,Z)|0,i=i+Math.imul(C,ee)|0,r=r+Math.imul(M,ne)|0,o=(o=o+Math.imul(M,re)|0)+Math.imul(_,ne)|0,i=i+Math.imul(_,re)|0,r=r+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,r=r+Math.imul(v,le)|0,o=(o=o+Math.imul(v,ce)|0)+Math.imul(b,le)|0,i=i+Math.imul(b,ce)|0,r=r+Math.imul(p,de)|0,o=(o=o+Math.imul(p,fe)|0)+Math.imul(m,de)|0,i=i+Math.imul(m,fe)|0;var Ee=(c+(r=r+Math.imul(d,pe)|0)|0)+((8191&(o=(o=o+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;c=((i=i+Math.imul(f,me)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,W),o=(o=Math.imul(j,V))+Math.imul(F,W)|0,i=Math.imul(F,V),r=r+Math.imul(L,K)|0,o=(o=o+Math.imul(L,$)|0)+Math.imul(B,K)|0,i=i+Math.imul(B,$)|0,r=r+Math.imul(R,X)|0,o=(o=o+Math.imul(R,Q)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Q)|0,r=r+Math.imul(T,Z)|0,o=(o=o+Math.imul(T,ee)|0)+Math.imul(I,Z)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(A,ne)|0,o=(o=o+Math.imul(A,re)|0)+Math.imul(C,ne)|0,i=i+Math.imul(C,re)|0,r=r+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,r=r+Math.imul(w,le)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(x,le)|0,i=i+Math.imul(x,ce)|0,r=r+Math.imul(v,de)|0,o=(o=o+Math.imul(v,fe)|0)+Math.imul(b,de)|0,i=i+Math.imul(b,fe)|0;var Ae=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),o=(o=Math.imul(j,$))+Math.imul(F,K)|0,i=Math.imul(F,$),r=r+Math.imul(L,X)|0,o=(o=o+Math.imul(L,Q)|0)+Math.imul(B,X)|0,i=i+Math.imul(B,Q)|0,r=r+Math.imul(R,Z)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(P,Z)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(T,ne)|0,o=(o=o+Math.imul(T,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,ae)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,ae)|0,r=r+Math.imul(M,le)|0,o=(o=o+Math.imul(M,ce)|0)+Math.imul(_,le)|0,i=i+Math.imul(_,ce)|0,r=r+Math.imul(w,de)|0,o=(o=o+Math.imul(w,fe)|0)+Math.imul(x,de)|0,i=i+Math.imul(x,fe)|0;var Ce=(c+(r=r+Math.imul(v,pe)|0)|0)+((8191&(o=(o=o+Math.imul(v,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((i=i+Math.imul(b,me)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,X),o=(o=Math.imul(j,Q))+Math.imul(F,X)|0,i=Math.imul(F,Q),r=r+Math.imul(L,Z)|0,o=(o=o+Math.imul(L,ee)|0)+Math.imul(B,Z)|0,i=i+Math.imul(B,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(P,ne)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(T,ie)|0,o=(o=o+Math.imul(T,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(A,le)|0,o=(o=o+Math.imul(A,ce)|0)+Math.imul(C,le)|0,i=i+Math.imul(C,ce)|0,r=r+Math.imul(M,de)|0,o=(o=o+Math.imul(M,fe)|0)+Math.imul(_,de)|0,i=i+Math.imul(_,fe)|0;var ke=(c+(r=r+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(x,pe)|0))<<13)|0;c=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,Z),o=(o=Math.imul(j,ee))+Math.imul(F,Z)|0,i=Math.imul(F,ee),r=r+Math.imul(L,ne)|0,o=(o=o+Math.imul(L,re)|0)+Math.imul(B,ne)|0,i=i+Math.imul(B,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,ae)|0,r=r+Math.imul(T,le)|0,o=(o=o+Math.imul(T,ce)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,ce)|0,r=r+Math.imul(A,de)|0,o=(o=o+Math.imul(A,fe)|0)+Math.imul(C,de)|0,i=i+Math.imul(C,fe)|0;var Te=(c+(r=r+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,me)|0)+Math.imul(_,pe)|0))<<13)|0;c=((i=i+Math.imul(_,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ne),o=(o=Math.imul(j,re))+Math.imul(F,ne)|0,i=Math.imul(F,re),r=r+Math.imul(L,ie)|0,o=(o=o+Math.imul(L,ae)|0)+Math.imul(B,ie)|0,i=i+Math.imul(B,ae)|0,r=r+Math.imul(R,le)|0,o=(o=o+Math.imul(R,ce)|0)+Math.imul(P,le)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(T,de)|0,o=(o=o+Math.imul(T,fe)|0)+Math.imul(I,de)|0,i=i+Math.imul(I,fe)|0;var Ie=(c+(r=r+Math.imul(A,pe)|0)|0)+((8191&(o=(o=o+Math.imul(A,me)|0)+Math.imul(C,pe)|0))<<13)|0;c=((i=i+Math.imul(C,me)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,ie),o=(o=Math.imul(j,ae))+Math.imul(F,ie)|0,i=Math.imul(F,ae),r=r+Math.imul(L,le)|0,o=(o=o+Math.imul(L,ce)|0)+Math.imul(B,le)|0,i=i+Math.imul(B,ce)|0,r=r+Math.imul(R,de)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,fe)|0;var Oe=(c+(r=r+Math.imul(T,pe)|0)|0)+((8191&(o=(o=o+Math.imul(T,me)|0)+Math.imul(I,pe)|0))<<13)|0;c=((i=i+Math.imul(I,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,le),o=(o=Math.imul(j,ce))+Math.imul(F,le)|0,i=Math.imul(F,ce),r=r+Math.imul(L,de)|0,o=(o=o+Math.imul(L,fe)|0)+Math.imul(B,de)|0,i=i+Math.imul(B,fe)|0;var Re=(c+(r=r+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,me)|0)+Math.imul(P,pe)|0))<<13)|0;c=((i=i+Math.imul(P,me)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,de),o=(o=Math.imul(j,fe))+Math.imul(F,de)|0,i=Math.imul(F,fe);var Pe=(c+(r=r+Math.imul(L,pe)|0)|0)+((8191&(o=(o=o+Math.imul(L,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((i=i+Math.imul(B,me)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(c+(r=Math.imul(j,pe))|0)+((8191&(o=(o=Math.imul(j,me))+Math.imul(F,pe)|0))<<13)|0;return c=((i=Math.imul(F,me))+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,l[0]=ge,l[1]=ve,l[2]=be,l[3]=ye,l[4]=we,l[5]=xe,l[6]=Se,l[7]=Me,l[8]=_e,l[9]=Ee,l[10]=Ae,l[11]=Ce,l[12]=ke,l[13]=Te,l[14]=Ie,l[15]=Oe,l[16]=Re,l[17]=Pe,l[18]=Ne,0!==c&&(l[19]=c,n.length++),n};function v(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i<n.length-1;i++){var a=o;o=0;for(var s=67108863&r,l=Math.min(i,t.length-1),c=Math.max(0,i-e.length+1);c<=l;c++){var u=i-c,d=(0|e.words[u])*(0|t.words[c]),f=67108863&d;s=67108863&(f=f+s|0),o+=(a=(a=a+(d/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n._strip()}function b(e,t,n){return v(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(g=m),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?m(this,e,t):n<1024?v(this,e,t):b(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},y.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,o=0;o<t;o++)r|=(1&e)<<t-o-1,e>>=1;return r},y.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a<i;a++)r[a]=t[e[a]],o[a]=n[e[a]]},y.prototype.transform=function(e,t,n,r,o,i){this.permute(i,e,t,n,r,o);for(var a=1;a<o;a<<=1)for(var s=a<<1,l=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),u=0;u<o;u+=s)for(var d=l,f=c,h=0;h<a;h++){var p=n[u+h],m=r[u+h],g=n[u+h+a],v=r[u+h+a],b=d*g-f*v;v=d*v+f*g,g=b,n[u+h]=p+g,r[u+h]=m+v,n[u+h+a]=p-g,r[u+h+a]=m-v,h!==s&&(b=l*d-c*f,f=l*f+c*d,d=b)}},y.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,o=0;for(n=n/2|0;n;n>>>=1)o++;return 1<<o+1+r},y.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var o=e[r];e[r]=e[n-r-1],e[n-r-1]=o,o=t[r],t[r]=-t[n-r-1],t[n-r-1]=-o}},y.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var o=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&o,n=o<67108864?0:o/67108864|0}return e},y.prototype.convert13b=function(e,t,r,o){for(var i=0,a=0;a<t;a++)i+=0|e[a],r[2*a]=8191&i,i>>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a<o;++a)r[a]=0;n(0===i),n(0==(-8192&i))},y.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},y.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),o=this.makeRBT(r),i=this.stub(r),a=new Array(r),s=new Array(r),l=new Array(r),c=new Array(r),u=new Array(r),d=new Array(r),f=n.words;f.length=r,this.convert13b(e.words,e.length,a,r),this.convert13b(t.words,t.length,c,r),this.transform(a,i,s,l,r,o),this.transform(c,i,u,d,r,o);for(var h=0;h<r;h++){var p=s[h]*u[h]-l[h]*d[h];l[h]=s[h]*d[h]+l[h]*u[h],s[h]=p}return this.conjugate(s,l,r),this.transform(s,l,f,i,r,o),this.conjugate(f,i,r),this.normalize13b(f,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,o=0;o<this.length;o++){var i=(0|this.words[o])*e,a=(67108863&i)+(67108863&r);r>>=26,r+=i/67108864|0,r+=a>>>26,this.words[o]=67108863&a}return 0!==r&&(this.words[o]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,o=n%26;t[n]=e.words[r]>>>o&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())0!==t[r]&&(n=n.mul(i));return n},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,o=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&i,l=(0|this.words[t])-s<<r;this.words[t]=l|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var o;n("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<<i,l=r;if(o-=a,o=Math.max(0,o),l){for(var c=0;c<a;c++)l.words[c]=this.words[c];l.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=o);c--){var d=0|this.words[c];this.words[c]=u<<26-i|d>>>i,u=d&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,o=1<<t;return!(this.length<=r)&&!!(this.words[r]&o)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var o,i,a=e.length+r;this._expand(a);var s=0;for(o=0;o<e.length;o++){i=(0|this.words[o+r])+s;var l=(0|e.words[o])*t;s=((i-=67108863&l)>>26)-(l/67108864|0),this.words[o+r]=67108863&i}for(;o<this.length-r;o++)s=(i=(0|this.words[o+r])+s)>>26,this.words[o+r]=67108863&i;if(0===s)return this._strip();for(n(-1===s),s=0,o=0;o<this.length;o++)s=(i=-(0|this.words[o])+s)>>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,l=r.length-i.length;if("mod"!==t){(s=new o(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var u=r.clone()._ishlnsubmul(i,1,l);0===u.negative&&(r=u,s&&(s.words[l]=1));for(var d=l-1;d>=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(i,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=f)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=67108864%e,o=0,i=this.length-1;i>=0;i--)o=(r*o+(0|this.words[i]))%e;return t?-o:o},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*r;this.words[o]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),l=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(u),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(d)),s.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(l)):(r.isub(t),s.isub(i),l.isub(a))}return{a:s,b:l,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),l=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(t.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);for(var d=0,f=1;0==(r.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,o=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=o,this;for(var i=o,a=r;0!==i&&a<this.length;a++){var s=0|this.words[a];i=(s+=i)>>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){r<o?t=-1:r>o&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new A(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function C(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},r(S,x),S.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),o=0;o<r;o++)t.words[o]=e.words[o];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&n,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&n)<<4|i>>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(M,x),r(_,x),r(E,x),E.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,o=67108863&r;r>>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new S;else if("p224"===e)t=new M;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return w[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var d=this.pow(u,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<p);var v=this.pow(d,new o(1).iushln(p-g-1));f=f.redMul(v),d=v.redSqr(),h=h.redMul(d),p=g}return f},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new o(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var i=n[0],a=0,s=0,l=t.bitLength()%26;for(0===l&&(l=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],u=l-1;u>=0;u--){var d=c>>u&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===u)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}l=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new C(e)},r(C,A),C.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},C.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},C.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},C.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},C.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)})),a.register("dkUCk",(function(e,t){"use strict";var n=e.exports;n.version=a("ca4g8").version,n.utils=a("fp2gt"),n.rand=a("hZWXr"),n.curve=a("e5bLI"),n.curves=a("gU8eC"),n.ec=a("4hQQJ"),n.eddsa=a("ieJqr")})),a.register("ca4g8",(function(e,t){e.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny <fedor@indutny.com>","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')})),a.register("fp2gt",(function(e,t){"use strict";var n=e.exports,r=a("jXr8Y"),o=a("iGZtb"),i=a("8Znt4");n.assert=o,n.toArray=i.toArray,n.zero2=i.zero2,n.toHex=i.toHex,n.encode=i.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var o=1<<t+1,i=e.clone(),a=0;a<r.length;a++){var s,l=i.andln(o-1);i.isOdd()?(s=l>(o>>1)-1?(o>>1)-l:l,i.isubn(s)):s=0,r[a]=s,i.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var a,s,l=e.andln(3)+o&3,c=t.andln(3)+i&3;3===l&&(l=-1),3===c&&(c=-1),a=0==(1&l)?0:3!==(r=e.andln(7)+o&7)&&5!==r||2!==c?l:-l,n[0].push(a),s=0==(1&c)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==l?c:-c,n[1].push(s),2*o===a+1&&(o=1-o),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new r(e,"hex","le")}})),a.register("8Znt4",(function(e,t){"use strict";var n=e.exports;function r(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",n=0;n<e.length;n++)t+=r(e[n].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"!=typeof e){for(var r=0;r<e.length;r++)n[r]=0|e[r];return n}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(r=0;r<e.length;r+=2)n.push(parseInt(e[r]+e[r+1],16))}else for(r=0;r<e.length;r++){var o=e.charCodeAt(r),i=o>>8,a=255&o;i?n.push(i,a):n.push(a)}return n},n.zero2=r,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}})),a.register("e5bLI",(function(e,t){"use strict";var n=e.exports;n.base=a("84G9i"),n.short=a("9nyiD"),n.mont=a("lQ6rN"),n.edwards=a("6iYEY")})),a.register("84G9i",(function(e,t){"use strict";var n=a("jXr8Y"),r=a("fp2gt"),o=r.getNAF,i=r.getJSF,s=r.assert;function l(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=l,l.prototype.point=function(){throw new Error("Not implemented")},l.prototype.validate=function(){throw new Error("Not implemented")},l.prototype._fixedNafMul=function(e,t){s(e.precomputed);var n=e._getDoubles(),r=o(t,1,this._bitLength),i=(1<<n.step+1)-(n.step%2==0?2:1);i/=3;var a,l,c=[];for(a=0;a<r.length;a+=n.step){l=0;for(var u=a+n.step-1;u>=a;u--)l=(l<<1)+r[u];c.push(l)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=i;h>0;h--){for(a=0;a<c.length;a++)(l=c[a])===h?f=f.mixedAdd(n.points[a]):l===-h&&(f=f.mixedAdd(n.points[a].neg()));d=d.add(f)}return d.toP()},l.prototype._wnafMul=function(e,t){var n=4,r=e._getNAFPoints(n);n=r.wnd;for(var i=r.points,a=o(t,n,this._bitLength),l=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(var u=0;c>=0&&0===a[c];c--)u++;if(c>=0&&u++,l=l.dblp(u),c<0)break;var d=a[c];s(0!==d),l="affine"===e.type?d>0?l.mixedAdd(i[d-1>>1]):l.mixedAdd(i[-d-1>>1].neg()):d>0?l.add(i[d-1>>1]):l.add(i[-d-1>>1].neg())}return"affine"===e.type?l.toP():l},l.prototype._wnafMulAdd=function(e,t,n,r,a){var s,l,c,u=this._wnafT1,d=this._wnafT2,f=this._wnafT3,h=0;for(s=0;s<r;s++){var p=(c=t[s])._getNAFPoints(e);u[s]=p.wnd,d[s]=p.points}for(s=r-1;s>=1;s-=2){var m=s-1,g=s;if(1===u[m]&&1===u[g]){var v=[t[m],null,null,t[g]];0===t[m].y.cmp(t[g].y)?(v[1]=t[m].add(t[g]),v[2]=t[m].toJ().mixedAdd(t[g].neg())):0===t[m].y.cmp(t[g].y.redNeg())?(v[1]=t[m].toJ().mixedAdd(t[g]),v[2]=t[m].add(t[g].neg())):(v[1]=t[m].toJ().mixedAdd(t[g]),v[2]=t[m].toJ().mixedAdd(t[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],y=i(n[m],n[g]);for(h=Math.max(y[0].length,h),f[m]=new Array(h),f[g]=new Array(h),l=0;l<h;l++){var w=0|y[0][l],x=0|y[1][l];f[m][l]=b[3*(w+1)+(x+1)],f[g][l]=0,d[m]=v}}else f[m]=o(n[m],u[m],this._bitLength),f[g]=o(n[g],u[g],this._bitLength),h=Math.max(f[m].length,h),h=Math.max(f[g].length,h)}var S=this.jpoint(null,null,null),M=this._wnafT4;for(s=h;s>=0;s--){for(var _=0;s>=0;){var E=!0;for(l=0;l<r;l++)M[l]=0|f[l][s],0!==M[l]&&(E=!1);if(!E)break;_++,s--}if(s>=0&&_++,S=S.dblp(_),s<0)break;for(l=0;l<r;l++){var A=M[l];0!==A&&(A>0?c=d[l][A-1>>1]:A<0&&(c=d[l][-A-1>>1].neg()),S="affine"===c.type?S.mixedAdd(c):S.add(c))}}for(s=0;s<r;s++)d[s]=null;return a?S:S.toP()},l.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},l.prototype.decodePoint=function(e,t){e=r.toArray(e,t);var n=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*n)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((2===e[0]||3===e[0])&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return r.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,o=0;o<t;o+=e){for(var i=0;i<e;i++)r=r.dbl();n.push(r)}return{step:e,points:n}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,r=1===n?null:this.dbl(),o=1;o<n;o++)t[o]=t[o-1].add(r);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t}})),a.register("9nyiD",(function(e,t){"use strict";var n=a("fp2gt"),r=a("jXr8Y"),o=a("5jAh8"),i=a("84G9i"),s=n.assert;function l(e){i.call(this,"short",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,n,o){i.BasePoint.call(this,e,"affine"),null===t&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new r(t,16),this.y=new r(n,16),o&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(e,t,n,o){i.BasePoint.call(this,e,"jacobian"),null===t&&null===n&&null===o?(this.x=this.curve.one,this.y=this.curve.one,this.z=new r(0)):(this.x=new r(t,16),this.y=new r(n,16),this.z=new r(o,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(l,i),e.exports=l,l.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,n;if(e.beta)t=new r(e.beta,16).toRed(this.red);else{var o=this._getEndoRoots(this.p);t=(t=o[0].cmp(o[1])<0?o[0]:o[1]).toRed(this.red)}if(e.lambda)n=new r(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?n=i[0]:(n=i[1],s(0===this.g.mul(n).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:n,basis:e.basis?e.basis.map((function(e){return{a:new r(e.a,16),b:new r(e.b,16)}})):this._getEndoBasis(n)}}},l.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:r.mont(e),n=new r(2).toRed(t).redInvm(),o=n.redNeg(),i=new r(3).toRed(t).redNeg().redSqrt().redMul(n);return[o.redAdd(i).fromRed(),o.redSub(i).fromRed()]},l.prototype._getEndoBasis=function(e){for(var t,n,o,i,a,s,l,c,u,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),p=new r(1),m=new r(0),g=new r(0),v=new r(1),b=0;0!==f.cmpn(0);){var y=h.div(f);c=h.sub(y.mul(f)),u=g.sub(y.mul(p));var w=v.sub(y.mul(m));if(!o&&c.cmp(d)<0)t=l.neg(),n=p,o=c.neg(),i=u;else if(o&&2==++b)break;l=c,h=f,f=c,g=p,p=u,v=m,m=w}a=c.neg(),s=u;var x=o.sqr().add(i.sqr());return a.sqr().add(s.sqr()).cmp(x)>=0&&(a=t,s=n),o.negative&&(o=o.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:o,b:i},{a:a,b:s}]},l.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],o=r.b.mul(e).divRound(this.n),i=n.b.neg().mul(e).divRound(this.n),a=o.mul(n.a),s=i.mul(r.a),l=o.mul(n.b),c=i.mul(r.b);return{k1:e.sub(a).sub(s),k2:l.add(c).neg()}},l.prototype.pointFromX=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),o=n.redSqrt();if(0!==o.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=o.fromRed().isOdd();return(t&&!i||!t&&i)&&(o=o.redNeg()),this.point(e,o)},l.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(o).cmpn(0)},l.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,o=this._endoWnafT2,i=0;i<e.length;i++){var a=this._endoSplit(t[i]),s=e[i],l=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),l=l.neg(!0)),r[2*i]=s,r[2*i+1]=l,o[2*i]=a.k1,o[2*i+1]=a.k2}for(var c=this._wnafMulAdd(1,r,o,2*i,n),u=0;u<2*i;u++)r[u]=null,o[u]=null;return c},o(c,i.BasePoint),l.prototype.point=function(e,t,n){return new c(this,e,t,n)},l.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,r=function(e){return n.point(e.x.redMul(n.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,n){"string"==typeof t&&(t=JSON.parse(t));var r=e.point(t[0],t[1],n);if(!t[2])return r;function o(t){return e.point(t[0],t[1],n)}var i=t[2];return r.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[r].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[r].concat(i.naf.points.map(o))}},r},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),o=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),i=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new r(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,n){var r=[this,t],o=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,o):this.curve._wnafMulAdd(1,r,o,2)},c.prototype.jmulAdd=function(e,t,n){var r=[this,t],o=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,o,!0):this.curve._wnafMulAdd(1,r,o,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(u,i.BasePoint),l.prototype.jpoint=function(e,t,n){return new u(this,e,t,n)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),o=e.x.redMul(n),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(o),l=i.redSub(a);if(0===s.cmpn(0))return 0!==l.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),d=r.redMul(c),f=l.redSqr().redIAdd(u).redISub(d).redISub(d),h=l.redMul(d.redISub(f)).redISub(i.redMul(u)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(f,h,p)},u.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=o.redSub(i);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),c=l.redMul(a),u=n.redMul(l),d=s.redSqr().redIAdd(c).redISub(u).redISub(u),f=s.redMul(u.redISub(d)).redISub(o.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(d,f,h)},u.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var r=this.curve.a,o=this.curve.tinv,i=this.x,a=this.y,s=this.z,l=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var u=i.redSqr(),d=c.redSqr(),f=d.redSqr(),h=u.redAdd(u).redIAdd(u).redIAdd(r.redMul(l)),p=i.redMul(d),m=h.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),v=h.redMul(g);v=v.redIAdd(v).redISub(f);var b=c.redMul(s);t+1<e&&(l=l.redMul(f)),i=m,s=b,c=v}return this.curve.jpoint(i,c.redMul(o),s)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},u.prototype._zeroDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(r).redISub(i);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r),l=s.redSqr().redISub(a).redISub(a),c=i.redIAdd(i);c=(c=c.redIAdd(c)).redIAdd(c),e=l,t=s.redMul(a.redISub(l)).redISub(c),n=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(u).redISub(f);h=h.redIAdd(h);var p=u.redAdd(u).redIAdd(u),m=p.redSqr(),g=f.redIAdd(f);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(g),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(e,t,n)},u.prototype._threeDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(r).redISub(i);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),l=s.redSqr().redISub(a).redISub(a);e=l;var c=i.redIAdd(i);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(l)).redISub(c),n=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(u).redMul(this.x.redAdd(u));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),m=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(m),n=this.y.redAdd(this.z).redSqr().redISub(d).redISub(u);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=h.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,n)},u.prototype._dbl=function(){var e=this.curve.a,t=this.x,n=this.y,r=this.z,o=r.redSqr().redSqr(),i=t.redSqr(),a=n.redSqr(),s=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(o)),l=t.redAdd(t),c=(l=l.redIAdd(l)).redMul(a),u=s.redSqr().redISub(c.redAdd(c)),d=c.redISub(u),f=a.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=s.redMul(d).redISub(f),p=n.redAdd(n).redMul(r);return this.curve.jpoint(u,h,p)},u.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),r=t.redSqr(),o=e.redAdd(e).redIAdd(e),i=o.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(r),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(i)).redSqr(),l=r.redIAdd(r);l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var c=o.redIAdd(a).redSqr().redISub(i).redISub(s).redISub(l),u=t.redMul(c);u=(u=u.redIAdd(u)).redIAdd(u);var d=this.x.redMul(s).redISub(u);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(c.redMul(l.redISub(c)).redISub(a.redMul(s)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(a).redSqr().redISub(n).redISub(s);return this.curve.jpoint(d,f,h)},u.prototype.mul=function(e,t){return e=new r(e,t),this.curve._wnafMul(this,e)},u.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(0!==this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0))return!1;var r=t.redMul(this.z),o=n.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(r)).cmpn(0)},u.prototype.eqXToP=function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(n))return!0;for(var r=e.clone(),o=this.curve.redN.redMul(t);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(o),0===this.x.cmp(n))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}})),a.register("lQ6rN",(function(e,t){"use strict";var n=a("jXr8Y"),r=a("5jAh8"),o=a("84G9i"),i=a("fp2gt");function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function l(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}r(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},r(l,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(i.toArray(e,t),1)},s.prototype.point=function(e,t){return new l(this,e,t)},s.prototype.pointFromJSON=function(e){return l.fromJSON(this,e)},l.prototype.precompute=function(){},l.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},l.fromJSON=function(e,t){return new l(e,t[0],t[1]||e.one)},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},l.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),r=e.redMul(t),o=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,o)},l.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),o=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(n),a=o.redMul(r),s=t.z.redMul(i.redAdd(a).redSqr()),l=t.x.redMul(i.redISub(a).redSqr());return this.curve.point(s,l)},l.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var i=o.length-1;i>=0;i--)0===o[i]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},l.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},l.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()}})),a.register("6iYEY",(function(e,t){"use strict";var n=a("fp2gt"),r=a("jXr8Y"),o=a("5jAh8"),i=a("84G9i"),s=n.assert;function l(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,i.call(this,"edwards",e),this.a=new r(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new r(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new r(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,n,o,a){i.BasePoint.call(this,e,"projective"),null===t&&null===n&&null===o?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new r(t,16),this.y=new r(n,16),this.z=o?new r(o,16):this.curve.one,this.t=a&&new r(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(l,i),e.exports=l,l.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},l.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},l.prototype.jpoint=function(e,t,n,r){return this.point(e,t,n,r)},l.prototype.pointFromX=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),o=this.c2.redSub(this.a.redMul(n)),i=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=o.redMul(i.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var l=s.fromRed().isOdd();return(t&&!l||!t&&l)&&(s=s.redNeg()),this.point(e,s)},l.prototype.pointFromY=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),o=n.redSub(this.c2),i=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=o.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},l.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),r=t.redMul(this.a).redAdd(n),o=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return 0===r.cmp(o)},o(c,i.BasePoint),l.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},l.prototype.point=function(e,t,n,r){return new c(this,e,t,n,r)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=r.redAdd(t),a=i.redSub(n),s=r.redSub(t),l=o.redMul(a),c=i.redMul(s),u=o.redMul(s),d=a.redMul(i);return this.curve.point(l,c,d,u)},c.prototype._projDbl=function(){var e,t,n,r,o,i,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),l=this.y.redSqr();if(this.curve.twisted){var c=(r=this.curve._mulA(s)).redAdd(l);this.zOne?(e=a.redSub(s).redSub(l).redMul(c.redSub(this.curve.two)),t=c.redMul(r.redSub(l)),n=c.redSqr().redSub(c).redSub(c)):(o=this.z.redSqr(),i=c.redSub(o).redISub(o),e=a.redSub(s).redISub(l).redMul(i),t=c.redMul(r.redSub(l)),n=c.redMul(i))}else r=s.redAdd(l),o=this.curve._mulC(this.z).redSqr(),i=r.redSub(o).redSub(o),e=this.curve._mulC(a.redISub(r)).redMul(i),t=this.curve._mulC(r).redMul(s.redISub(l)),n=r.redMul(i);return this.curve.point(e,t,n)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),i=n.redSub(t),a=o.redSub(r),s=o.redAdd(r),l=n.redAdd(t),c=i.redMul(a),u=s.redMul(l),d=i.redMul(l),f=a.redMul(s);return this.curve.point(c,u,f,d)},c.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),o=r.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(i).redMul(a),l=o.redSub(s),c=o.redAdd(s),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),d=r.redMul(l).redMul(u);return this.curve.twisted?(t=r.redMul(c).redMul(a.redSub(this.curve._mulA(i))),n=l.redMul(c)):(t=r.redMul(c).redMul(a.redSub(i)),n=this.curve._mulC(l).redMul(c)),this.curve.point(d,t,n)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},c.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add})),a.register("gU8eC",(function(e,t){"use strict";var n,r=e.exports,o=a("ba8bl"),i=a("e5bLI"),s=a("fp2gt").assert;function l(e){"short"===e.type?this.curve=new i.short(e):"edwards"===e.type?this.curve=new i.edwards(e):this.curve=new i.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new l(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=l,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=a("2OXMU")}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})})),a.register("ba8bl",(function(e,t){var n=e.exports;n.utils=a("7MeDX"),n.common=a("cXjky"),n.sha=a("dBAtQ"),n.ripemd=a("fEnno"),n.hmac=a("aBJ6r"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160})),a.register("7MeDX",(function(t,n){var r,o,i,s,l,c,u,d,f,h,p,m,g,v,b,y,w,x,S,M,_,E,A,C,k,T;e(t.exports,"inherits",(()=>r),(e=>r=e)),e(t.exports,"toArray",(()=>o),(e=>o=e)),e(t.exports,"toHex",(()=>i),(e=>i=e)),e(t.exports,"htonl",(()=>s),(e=>s=e)),e(t.exports,"toHex32",(()=>l),(e=>l=e)),e(t.exports,"zero2",(()=>c),(e=>c=e)),e(t.exports,"zero8",(()=>u),(e=>u=e)),e(t.exports,"join32",(()=>d),(e=>d=e)),e(t.exports,"split32",(()=>f),(e=>f=e)),e(t.exports,"rotr32",(()=>h),(e=>h=e)),e(t.exports,"rotl32",(()=>p),(e=>p=e)),e(t.exports,"sum32",(()=>m),(e=>m=e)),e(t.exports,"sum32_3",(()=>g),(e=>g=e)),e(t.exports,"sum32_4",(()=>v),(e=>v=e)),e(t.exports,"sum32_5",(()=>b),(e=>b=e)),e(t.exports,"sum64",(()=>y),(e=>y=e)),e(t.exports,"sum64_hi",(()=>w),(e=>w=e)),e(t.exports,"sum64_lo",(()=>x),(e=>x=e)),e(t.exports,"sum64_4_hi",(()=>S),(e=>S=e)),e(t.exports,"sum64_4_lo",(()=>M),(e=>M=e)),e(t.exports,"sum64_5_hi",(()=>_),(e=>_=e)),e(t.exports,"sum64_5_lo",(()=>E),(e=>E=e)),e(t.exports,"rotr64_hi",(()=>A),(e=>A=e)),e(t.exports,"rotr64_lo",(()=>C),(e=>C=e)),e(t.exports,"shr64_hi",(()=>k),(e=>k=e)),e(t.exports,"shr64_lo",(()=>T),(e=>T=e));var I=a("iGZtb"),O=a("5jAh8");function R(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function P(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function N(e){return 1===e.length?"0"+e:e}function L(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r=O,o=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)n.push(parseInt(e[o]+e[o+1],16))}else for(var r=0,o=0;o<e.length;o++){var i=e.charCodeAt(o);i<128?n[r++]=i:i<2048?(n[r++]=i>>6|192,n[r++]=63&i|128):R(e,o)?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++o)),n[r++]=i>>18|240,n[r++]=i>>12&63|128,n[r++]=i>>6&63|128,n[r++]=63&i|128):(n[r++]=i>>12|224,n[r++]=i>>6&63|128,n[r++]=63&i|128)}else for(o=0;o<e.length;o++)n[o]=0|e[o];return n},i=function(e){for(var t="",n=0;n<e.length;n++)t+=N(e[n].toString(16));return t},s=P,l=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e[r];"little"===t&&(o=P(o)),n+=L(o.toString(16))}return n},c=N,u=L,d=function(e,t,n,r){var o=n-t;I(o%4==0);for(var i=new Array(o/4),a=0,s=t;a<i.length;a++,s+=4){var l;l="big"===r?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],i[a]=l>>>0}return i},f=function(e,t){for(var n=new Array(4*e.length),r=0,o=0;r<e.length;r++,o+=4){var i=e[r];"big"===t?(n[o]=i>>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},h=function(e,t){return e>>>t|e<<32-t},p=function(e,t){return e<<t|e>>>32-t},m=function(e,t){return e+t>>>0},g=function(e,t,n){return e+t+n>>>0},v=function(e,t,n,r){return e+t+n+r>>>0},b=function(e,t,n,r,o){return e+t+n+r+o>>>0},y=function(e,t,n,r){var o=e[t],i=r+e[t+1]>>>0,a=(i<r?1:0)+n+o;e[t]=a>>>0,e[t+1]=i},w=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},x=function(e,t,n,r){return t+r>>>0},S=function(e,t,n,r,o,i,a,s){var l=0,c=t;return l+=(c=c+r>>>0)<t?1:0,l+=(c=c+i>>>0)<i?1:0,e+n+o+a+(l+=(c=c+s>>>0)<s?1:0)>>>0},M=function(e,t,n,r,o,i,a,s){return t+r+i+s>>>0},_=function(e,t,n,r,o,i,a,s,l,c){var u=0,d=t;return u+=(d=d+r>>>0)<t?1:0,u+=(d=d+i>>>0)<i?1:0,u+=(d=d+s>>>0)<s?1:0,e+n+o+a+l+(u+=(d=d+c>>>0)<c?1:0)>>>0},E=function(e,t,n,r,o,i,a,s,l,c){return t+r+i+s+c>>>0},A=function(e,t,n){return(t<<32-n|e>>>n)>>>0},C=function(e,t,n){return(e<<32-n|t>>>n)>>>0},k=function(e,t,n){return e>>>n},T=function(e,t,n){return(e<<32-n|t>>>n)>>>0}})),a.register("cXjky",(function(t,n){var r;e(t.exports,"BlockHash",(()=>r),(e=>r=e));var o=a("7MeDX"),i=a("iGZtb");function s(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}r=s,s.prototype.update=function(e,t){if(e=o.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=o.join32(e,0,e.length-n,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},s.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},s.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var o=1;o<n;o++)r[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[o++]=0;r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=e>>>24&255,r[o++]=e>>>16&255,r[o++]=e>>>8&255,r[o++]=255&e}else for(r[o++]=255&e,r[o++]=e>>>8&255,r[o++]=e>>>16&255,r[o++]=e>>>24&255,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,i=8;i<this.padLength;i++)r[o++]=0;return r}})),a.register("dBAtQ",(function(t,n){var r,o,i,s,l;e(t.exports,"sha1",(()=>r),(e=>r=e)),e(t.exports,"sha224",(()=>o),(e=>o=e)),e(t.exports,"sha256",(()=>i),(e=>i=e)),e(t.exports,"sha384",(()=>s),(e=>s=e)),e(t.exports,"sha512",(()=>l),(e=>l=e)),r=a("gkYl9"),o=a("dBaTo"),i=a("bMsM7"),s=a("69vgx"),l=a("cvw4e")})),a.register("gkYl9",(function(e,t){"use strict";var n=a("7MeDX"),r=a("cXjky"),o=a("5buio"),i=n.rotl32,s=n.sum32,l=n.sum32_5,c=o.ft_1,u=r.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(f,u),e.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=i(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var o=this.h[0],a=this.h[1],u=this.h[2],f=this.h[3],h=this.h[4];for(r=0;r<n.length;r++){var p=~~(r/20),m=l(i(o,5),c(p,a,u,f),h,n[r],d[p]);h=f,f=u,u=i(a,30),a=o,o=m}this.h[0]=s(this.h[0],o),this.h[1]=s(this.h[1],a),this.h[2]=s(this.h[2],u),this.h[3]=s(this.h[3],f),this.h[4]=s(this.h[4],h)},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}})),a.register("5buio",(function(t,n){var r,o,i,s,l,c,u;e(t.exports,"ft_1",(()=>r),(e=>r=e)),e(t.exports,"ch32",(()=>o),(e=>o=e)),e(t.exports,"maj32",(()=>i),(e=>i=e)),e(t.exports,"s0_256",(()=>s),(e=>s=e)),e(t.exports,"s1_256",(()=>l),(e=>l=e)),e(t.exports,"g0_256",(()=>c),(e=>c=e)),e(t.exports,"g1_256",(()=>u),(e=>u=e));var d=a("7MeDX").rotr32;function f(e,t,n){return e&t^~e&n}function h(e,t,n){return e&t^e&n^t&n}function p(e,t,n){return e^t^n}r=function(e,t,n,r){return 0===e?f(t,n,r):1===e||3===e?p(t,n,r):2===e?h(t,n,r):void 0},o=f,i=h,s=function(e){return d(e,2)^d(e,13)^d(e,22)},l=function(e){return d(e,6)^d(e,11)^d(e,25)},c=function(e){return d(e,7)^d(e,18)^e>>>3},u=function(e){return d(e,17)^d(e,19)^e>>>10}})),a.register("dBaTo",(function(e,t){"use strict";var n=a("7MeDX"),r=a("bMsM7");function o(){if(!(this instanceof o))return new o;r.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,r),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}})),a.register("bMsM7",(function(e,t){"use strict";var n=a("7MeDX"),r=a("cXjky"),o=a("5buio"),i=a("iGZtb"),s=n.sum32,l=n.sum32_4,c=n.sum32_5,u=o.ch32,d=o.maj32,f=o.s0_256,h=o.s1_256,p=o.g0_256,m=o.g1_256,g=r.BlockHash,v=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}n.inherits(b,g),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=l(m(n[r-2]),n[r-7],p(n[r-15]),n[r-16]);var o=this.h[0],a=this.h[1],g=this.h[2],v=this.h[3],b=this.h[4],y=this.h[5],w=this.h[6],x=this.h[7];for(i(this.k.length===n.length),r=0;r<n.length;r++){var S=c(x,h(b),u(b,y,w),this.k[r],n[r]),M=s(f(o),d(o,a,g));x=w,w=y,y=b,b=s(v,S),v=g,g=a,a=o,o=s(S,M)}this.h[0]=s(this.h[0],o),this.h[1]=s(this.h[1],a),this.h[2]=s(this.h[2],g),this.h[3]=s(this.h[3],v),this.h[4]=s(this.h[4],b),this.h[5]=s(this.h[5],y),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],x)},b.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}})),a.register("69vgx",(function(e,t){"use strict";var n=a("7MeDX"),r=a("cvw4e");function o(){if(!(this instanceof o))return new o;r.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,r),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}})),a.register("cvw4e",(function(e,t){"use strict";var n=a("7MeDX"),r=a("cXjky"),o=a("iGZtb"),i=n.rotr64_hi,s=n.rotr64_lo,l=n.shr64_hi,c=n.shr64_lo,u=n.sum64,d=n.sum64_hi,f=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,g=n.sum64_5_lo,v=r.BlockHash,b=[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 y(){if(!(this instanceof y))return new y;v.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function w(e,t,n,r,o){var i=e&n^~e&o;return i<0&&(i+=4294967296),i}function x(e,t,n,r,o,i){var a=t&r^~t&i;return a<0&&(a+=4294967296),a}function S(e,t,n,r,o){var i=e&n^e&o^n&o;return i<0&&(i+=4294967296),i}function M(e,t,n,r,o,i){var a=t&r^t&i^r&i;return a<0&&(a+=4294967296),a}function _(e,t){var n=i(e,t,28)^i(t,e,2)^i(t,e,7);return n<0&&(n+=4294967296),n}function E(e,t){var n=s(e,t,28)^s(t,e,2)^s(t,e,7);return n<0&&(n+=4294967296),n}function A(e,t){var n=i(e,t,14)^i(e,t,18)^i(t,e,9);return n<0&&(n+=4294967296),n}function C(e,t){var n=s(e,t,14)^s(e,t,18)^s(t,e,9);return n<0&&(n+=4294967296),n}function k(e,t){var n=i(e,t,1)^i(e,t,8)^l(e,t,7);return n<0&&(n+=4294967296),n}function T(e,t){var n=s(e,t,1)^s(e,t,8)^c(e,t,7);return n<0&&(n+=4294967296),n}function I(e,t){var n=i(e,t,19)^i(t,e,29)^l(e,t,6);return n<0&&(n+=4294967296),n}function O(e,t){var n=s(e,t,19)^s(t,e,29)^c(e,t,6);return n<0&&(n+=4294967296),n}n.inherits(y,v),e.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var o=I(n[r-4],n[r-3]),i=O(n[r-4],n[r-3]),a=n[r-14],s=n[r-13],l=k(n[r-30],n[r-29]),c=T(n[r-30],n[r-29]),u=n[r-32],d=n[r-31];n[r]=h(o,i,a,s,l,c,u,d),n[r+1]=p(o,i,a,s,l,c,u,d)}},y.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,r=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],l=this.h[4],c=this.h[5],h=this.h[6],p=this.h[7],v=this.h[8],b=this.h[9],y=this.h[10],k=this.h[11],T=this.h[12],I=this.h[13],O=this.h[14],R=this.h[15];o(this.k.length===n.length);for(var P=0;P<n.length;P+=2){var N=O,L=R,B=A(v,b),D=C(v,b),j=w(v,b,y,k,T),F=x(v,b,y,k,T,I),z=this.k[P],U=this.k[P+1],H=n[P],G=n[P+1],W=m(N,L,B,D,j,F,z,U,H,G),V=g(N,L,B,D,j,F,z,U,H,G);N=_(r,i),L=E(r,i),B=S(r,i,a,s,l),D=M(r,i,a,s,l,c);var q=d(N,L,B,D),K=f(N,L,B,D);O=T,R=I,T=y,I=k,y=v,k=b,v=d(h,p,W,V),b=f(p,p,W,V),h=l,p=c,l=a,c=s,a=r,s=i,r=d(W,V,q,K),i=f(W,V,q,K)}u(this.h,0,r,i),u(this.h,2,a,s),u(this.h,4,l,c),u(this.h,6,h,p),u(this.h,8,v,b),u(this.h,10,y,k),u(this.h,12,T,I),u(this.h,14,O,R)},y.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}})),a.register("fEnno",(function(t,n){var r;e(t.exports,"ripemd160",(()=>r),(e=>r=e));var o=a("7MeDX"),i=a("cXjky"),s=o.rotl32,l=o.sum32,c=o.sum32_3,u=o.sum32_4,d=i.BlockHash;function f(){if(!(this instanceof f))return new f;d.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function p(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function m(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}o.inherits(f,d),r=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var n=this.h[0],r=this.h[1],o=this.h[2],i=this.h[3],a=this.h[4],d=n,f=r,w=o,x=i,S=a,M=0;M<80;M++){var _=l(s(u(n,h(M,r,o,i),e[g[M]+t],p(M)),b[M]),a);n=a,a=i,i=s(o,10),o=r,r=_,_=l(s(u(d,h(79-M,f,w,x),e[v[M]+t],m(M)),y[M]),S),d=S,S=x,x=s(w,10),w=f,f=_}_=c(this.h[1],o,x),this.h[1]=c(this.h[2],i,S),this.h[2]=c(this.h[3],a,d),this.h[3]=c(this.h[4],n,f),this.h[4]=c(this.h[0],r,w),this.h[0]=_},f.prototype._digest=function(e){return"hex"===e?o.toHex32(this.h,"little"):o.split32(this.h,"little")};var g=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],v=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]})),a.register("aBJ6r",(function(e,t){"use strict";var n=a("7MeDX"),r=a("iGZtb");function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),r(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}})),a.register("2OXMU",(function(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}})),a.register("4hQQJ",(function(e,t){"use strict";var n=a("jXr8Y"),r=a("h84tF"),o=a("fp2gt"),i=a("gU8eC"),s=a("hZWXr"),l=o.assert,c=a("8HvNn"),u=a("k8sA6");function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(l(Object.prototype.hasOwnProperty.call(i,e),"Unknown curve "+e),e=i[e]),e instanceof i.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=d,d.prototype.keyPair=function(e){return new c(this,e)},d.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new r({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),i=this.n.sub(new n(2));;){var a=new n(t.generate(o));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}},d.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},d.prototype.sign=function(e,t,o,i){"object"==typeof o&&(i=o,o=null),i||(i={}),t=this.keyFromPrivate(t,o),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),l=e.toArray("be",a),c=new r({hash:this.hash,entropy:s,nonce:l,pers:i.pers,persEnc:i.persEnc||"utf8"}),d=this.n.sub(new n(1)),f=0;;f++){var h=i.k?i.k(f):new n(c.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(d)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var m=p.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var v=h.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var b=(p.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return i.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),b^=1),new u({r:g,s:v,recoveryParam:b})}}}}}},d.prototype.verify=function(e,t,r,o){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,o);var i=(t=new u(t,"hex")).r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,l=a.invm(this.n),c=l.mul(e).umod(this.n),d=l.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),d)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(c,r.getPublic(),d)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},d.prototype.recoverPubKey=function(e,t,r,o){l((3&r)===r,"The recovery param is more than two bits"),t=new u(t,o);var i=this.n,a=new n(e),s=t.r,c=t.s,d=1&r,f=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");s=f?this.curve.pointFromX(s.add(this.curve.n),d):this.curve.pointFromX(s,d);var h=t.r.invm(i),p=i.sub(a).mul(h).umod(i),m=c.mul(h).umod(i);return this.g.mulAdd(p,s,m)},d.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new u(t,r)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(n))return o}throw new Error("Unable to find valid recovery factor")}})),a.register("h84tF",(function(e,t){"use strict";var n=a("ba8bl"),r=a("8Znt4"),o=a("iGZtb");function i(e){if(!(this instanceof i))return new i(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=r.toArray(e.entropy,e.entropyEnc||"hex"),n=r.toArray(e.nonce,e.nonceEnc||"hex"),a=r.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,a)}e.exports=i,i.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},i.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},i.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},i.prototype.reseed=function(e,t,n,i){"string"!=typeof t&&(i=n,n=t,t=null),e=r.toArray(e,t),n=r.toArray(n,i),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},i.prototype.generate=function(e,t,n,o){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(o=n,n=t,t=null),n&&(n=r.toArray(n,o||"hex"),this._update(n));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var a=i.slice(0,e);return this._update(n),this._reseed++,r.encode(a,t)}})),a.register("8HvNn",(function(e,t){"use strict";var n=a("jXr8Y"),r=a("fp2gt").assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,n){return t instanceof o?t:new o(e,{pub:t,pubEnc:n})},o.fromPrivate=function(e,t,n){return t instanceof o?t:new o(e,{priv:t,privEnc:n})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?r(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||r(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||r(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}})),a.register("k8sA6",(function(e,t){"use strict";var n=a("jXr8Y"),r=a("fp2gt"),o=r.assert;function i(e,t){if(e instanceof i)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function l(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var o=0,i=0,a=t.place;i<r;i++,a++)o<<=8,o|=e[a],o>>>=0;return!(o<=127)&&(t.place=a,o)}function c(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t<n;)t++;return 0===t?e:e.slice(t)}function u(e,t){if(t<128)e.push(t);else{var n=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}e.exports=i,i.prototype._importDER=function(e,t){e=r.toArray(e,t);var o=new s;if(48!==e[o.place++])return!1;var i=l(e,o);if(!1===i)return!1;if(i+o.place!==e.length)return!1;if(2!==e[o.place++])return!1;var a=l(e,o);if(!1===a)return!1;var c=e.slice(o.place,a+o.place);if(o.place+=a,2!==e[o.place++])return!1;var u=l(e,o);if(!1===u)return!1;if(e.length!==u+o.place)return!1;var d=e.slice(o.place,u+o.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new n(c),this.s=new n(d),this.recoveryParam=null,!0},i.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=c(t),n=c(n);!(n[0]||128&n[1]);)n=n.slice(1);var o=[2];u(o,t.length),(o=o.concat(t)).push(2),u(o,n.length);var i=o.concat(n),a=[48];return u(a,i.length),a=a.concat(i),r.encode(a,e)}})),a.register("ieJqr",(function(e,t){"use strict";var n=a("ba8bl"),r=a("gU8eC"),o=a("fp2gt"),i=o.assert,s=o.parseBytes,l=a("knAIT"),c=a("8CdZY");function u(e){if(i("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof u))return new u(e);e=r[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=u,u.prototype.sign=function(e,t){e=s(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),o=this.g.mul(r),i=this.encodePoint(o),a=this.hashInt(i,n.pubBytes(),e).mul(n.priv()),l=r.add(a).umod(this.curve.n);return this.makeSignature({R:o,S:l,Rencoded:i})},u.prototype.verify=function(e,t,n){e=s(e),t=this.makeSignature(t);var r=this.keyFromPublic(n),o=this.hashInt(t.Rencoded(),r.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(r.pub().mul(o)).eq(i)},u.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},u.prototype.keyFromPublic=function(e){return l.fromPublic(this,e)},u.prototype.keyFromSecret=function(e){return l.fromSecret(this,e)},u.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},u.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},u.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,n=e.slice(0,t).concat(-129&e[t]),r=0!=(128&e[t]),i=o.intFromLE(n);return this.curve.pointFromY(i,r)},u.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},u.prototype.decodeInt=function(e){return o.intFromLE(e)},u.prototype.isPoint=function(e){return e instanceof this.pointClass}})),a.register("knAIT",(function(e,t){"use strict";var n=a("fp2gt"),r=n.assert,o=n.parseBytes,i=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},i(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),i(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),i(s,"privBytes",(function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,r=t.slice(0,e.encodingLength);return r[0]&=248,r[n]&=127,r[n]|=64,r})),i(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),i(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),i(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(e){return r(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return r(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s})),a.register("8CdZY",(function(e,t){"use strict";var n=a("jXr8Y"),r=a("fp2gt"),o=r.assert,i=r.cachedProperty,s=r.parseBytes;function l(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}i(l,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),i(l,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),i(l,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),i(l,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),l.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},l.prototype.toHex=function(){return r.encode(this.toBytes(),"hex").toUpperCase()},e.exports=l})),a.register("fmDmL",(function(e,t){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var i;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:a("1DJXa").Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function l(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,r,o){for(var i=0,a=0,s=Math.min(e.length,r),l=t;l<s;l++){var c=e.charCodeAt(l)-48;i*=o,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<o,"Invalid character"),i+=a}return i}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,r):(this._parseBase(e,t,o),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,s=0;if("be"===r)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var o,i=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)o=l(e,t,r)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)o=l(e,t,r)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,l=0,u=n;u<s;u+=r)l=c(e,u,u+r,t),this.imuln(o),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var d=1;for(l=c(e,u,e.length,t),u=0;u<a;u++)d*=t;this.imuln(d),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){u(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(e){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var o=0,i=0,a=0;a<this.length;a++){var s=this.words[a],l=(16777215&(s<<o|i)).toString(16);i=s>>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),r=0!==i||a!==this.length-1?f[6-l.length]+l+r:l+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],u=p[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(u).toString(e);r=(d=d.idivn(u)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},i&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(i,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,l=a/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var u=l>>>26,d=67108863&l,f=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=f;h++){var p=c-h|0;u+=(a=(o=0|e.words[p])*(i=0|t.words[h])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,l=0|u}return 0!==l?n.words[c]=0|l:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var o=this.byteLength(),i=r||Math.max(1,o);n(o<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,o),a},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,o=0,i=0;o<this.length;o++){var a=this.words[o]<<i|r;e[n++]=255&a,n<e.length&&(e[n++]=a>>8&255),n<e.length&&(e[n++]=a>>16&255),6===i?(n<e.length&&(e[n++]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,o=0,i=0;o<this.length;o++){var a=this.words[o]<<i|r;e[n--]=255&a,n>=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===i?(n>=0&&(e[n--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return r>0&&(this.words[o]=~this.words[o]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<o:this.words[r]&~(1<<o),this._strip()},o.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i<r.length;i++)t=(0|n.words[i])+(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<n.length;i++)t=(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)i=(t=(0|n.words[a])-(0|r.words[a])+i)>>26,this.words[a]=67108863&t;for(;0!==i&&a<n.length;a++)i=(t=(0|n.words[a])+i)>>26,this.words[a]=67108863&t;if(0===i&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,n){var r,o,i,a=e.words,s=t.words,l=n.words,c=0,u=0|a[0],d=8191&u,f=u>>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],v=8191&g,b=g>>>13,y=0|a[3],w=8191&y,x=y>>>13,S=0|a[4],M=8191&S,_=S>>>13,E=0|a[5],A=8191&E,C=E>>>13,k=0|a[6],T=8191&k,I=k>>>13,O=0|a[7],R=8191&O,P=O>>>13,N=0|a[8],L=8191&N,B=N>>>13,D=0|a[9],j=8191&D,F=D>>>13,z=0|s[0],U=8191&z,H=z>>>13,G=0|s[1],W=8191&G,V=G>>>13,q=0|s[2],K=8191&q,$=q>>>13,J=0|s[3],X=8191&J,Q=J>>>13,Y=0|s[4],Z=8191&Y,ee=Y>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],le=8191&se,ce=se>>>13,ue=0|s[8],de=8191&ue,fe=ue>>>13,he=0|s[9],pe=8191&he,me=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(c+(r=Math.imul(d,U))|0)+((8191&(o=(o=Math.imul(d,H))+Math.imul(f,U)|0))<<13)|0;c=((i=Math.imul(f,H))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,U),o=(o=Math.imul(p,H))+Math.imul(m,U)|0,i=Math.imul(m,H);var ve=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(o=(o=o+Math.imul(d,V)|0)+Math.imul(f,W)|0))<<13)|0;c=((i=i+Math.imul(f,V)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,U),o=(o=Math.imul(v,H))+Math.imul(b,U)|0,i=Math.imul(b,H),r=r+Math.imul(p,W)|0,o=(o=o+Math.imul(p,V)|0)+Math.imul(m,W)|0,i=i+Math.imul(m,V)|0;var be=(c+(r=r+Math.imul(d,K)|0)|0)+((8191&(o=(o=o+Math.imul(d,$)|0)+Math.imul(f,K)|0))<<13)|0;c=((i=i+Math.imul(f,$)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,U),o=(o=Math.imul(w,H))+Math.imul(x,U)|0,i=Math.imul(x,H),r=r+Math.imul(v,W)|0,o=(o=o+Math.imul(v,V)|0)+Math.imul(b,W)|0,i=i+Math.imul(b,V)|0,r=r+Math.imul(p,K)|0,o=(o=o+Math.imul(p,$)|0)+Math.imul(m,K)|0,i=i+Math.imul(m,$)|0;var ye=(c+(r=r+Math.imul(d,X)|0)|0)+((8191&(o=(o=o+Math.imul(d,Q)|0)+Math.imul(f,X)|0))<<13)|0;c=((i=i+Math.imul(f,Q)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(M,U),o=(o=Math.imul(M,H))+Math.imul(_,U)|0,i=Math.imul(_,H),r=r+Math.imul(w,W)|0,o=(o=o+Math.imul(w,V)|0)+Math.imul(x,W)|0,i=i+Math.imul(x,V)|0,r=r+Math.imul(v,K)|0,o=(o=o+Math.imul(v,$)|0)+Math.imul(b,K)|0,i=i+Math.imul(b,$)|0,r=r+Math.imul(p,X)|0,o=(o=o+Math.imul(p,Q)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,Q)|0;var we=(c+(r=r+Math.imul(d,Z)|0)|0)+((8191&(o=(o=o+Math.imul(d,ee)|0)+Math.imul(f,Z)|0))<<13)|0;c=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(A,U),o=(o=Math.imul(A,H))+Math.imul(C,U)|0,i=Math.imul(C,H),r=r+Math.imul(M,W)|0,o=(o=o+Math.imul(M,V)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,V)|0,r=r+Math.imul(w,K)|0,o=(o=o+Math.imul(w,$)|0)+Math.imul(x,K)|0,i=i+Math.imul(x,$)|0,r=r+Math.imul(v,X)|0,o=(o=o+Math.imul(v,Q)|0)+Math.imul(b,X)|0,i=i+Math.imul(b,Q)|0,r=r+Math.imul(p,Z)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,Z)|0,i=i+Math.imul(m,ee)|0;var xe=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(o=(o=o+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;c=((i=i+Math.imul(f,re)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(T,U),o=(o=Math.imul(T,H))+Math.imul(I,U)|0,i=Math.imul(I,H),r=r+Math.imul(A,W)|0,o=(o=o+Math.imul(A,V)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(M,K)|0,o=(o=o+Math.imul(M,$)|0)+Math.imul(_,K)|0,i=i+Math.imul(_,$)|0,r=r+Math.imul(w,X)|0,o=(o=o+Math.imul(w,Q)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,Q)|0,r=r+Math.imul(v,Z)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(b,Z)|0,i=i+Math.imul(b,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(m,ne)|0,i=i+Math.imul(m,re)|0;var Se=(c+(r=r+Math.imul(d,ie)|0)|0)+((8191&(o=(o=o+Math.imul(d,ae)|0)+Math.imul(f,ie)|0))<<13)|0;c=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,U),o=(o=Math.imul(R,H))+Math.imul(P,U)|0,i=Math.imul(P,H),r=r+Math.imul(T,W)|0,o=(o=o+Math.imul(T,V)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,V)|0,r=r+Math.imul(A,K)|0,o=(o=o+Math.imul(A,$)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,$)|0,r=r+Math.imul(M,X)|0,o=(o=o+Math.imul(M,Q)|0)+Math.imul(_,X)|0,i=i+Math.imul(_,Q)|0,r=r+Math.imul(w,Z)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(x,Z)|0,i=i+Math.imul(x,ee)|0,r=r+Math.imul(v,ne)|0,o=(o=o+Math.imul(v,re)|0)+Math.imul(b,ne)|0,i=i+Math.imul(b,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0;var Me=(c+(r=r+Math.imul(d,le)|0)|0)+((8191&(o=(o=o+Math.imul(d,ce)|0)+Math.imul(f,le)|0))<<13)|0;c=((i=i+Math.imul(f,ce)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(L,U),o=(o=Math.imul(L,H))+Math.imul(B,U)|0,i=Math.imul(B,H),r=r+Math.imul(R,W)|0,o=(o=o+Math.imul(R,V)|0)+Math.imul(P,W)|0,i=i+Math.imul(P,V)|0,r=r+Math.imul(T,K)|0,o=(o=o+Math.imul(T,$)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,$)|0,r=r+Math.imul(A,X)|0,o=(o=o+Math.imul(A,Q)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,Q)|0,r=r+Math.imul(M,Z)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(_,Z)|0,i=i+Math.imul(_,ee)|0,r=r+Math.imul(w,ne)|0,o=(o=o+Math.imul(w,re)|0)+Math.imul(x,ne)|0,i=i+Math.imul(x,re)|0,r=r+Math.imul(v,ie)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,ae)|0,r=r+Math.imul(p,le)|0,o=(o=o+Math.imul(p,ce)|0)+Math.imul(m,le)|0,i=i+Math.imul(m,ce)|0;var _e=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(o=(o=o+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;c=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(j,U),o=(o=Math.imul(j,H))+Math.imul(F,U)|0,i=Math.imul(F,H),r=r+Math.imul(L,W)|0,o=(o=o+Math.imul(L,V)|0)+Math.imul(B,W)|0,i=i+Math.imul(B,V)|0,r=r+Math.imul(R,K)|0,o=(o=o+Math.imul(R,$)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,$)|0,r=r+Math.imul(T,X)|0,o=(o=o+Math.imul(T,Q)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,Q)|0,r=r+Math.imul(A,Z)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(C,Z)|0,i=i+Math.imul(C,ee)|0,r=r+Math.imul(M,ne)|0,o=(o=o+Math.imul(M,re)|0)+Math.imul(_,ne)|0,i=i+Math.imul(_,re)|0,r=r+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,r=r+Math.imul(v,le)|0,o=(o=o+Math.imul(v,ce)|0)+Math.imul(b,le)|0,i=i+Math.imul(b,ce)|0,r=r+Math.imul(p,de)|0,o=(o=o+Math.imul(p,fe)|0)+Math.imul(m,de)|0,i=i+Math.imul(m,fe)|0;var Ee=(c+(r=r+Math.imul(d,pe)|0)|0)+((8191&(o=(o=o+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;c=((i=i+Math.imul(f,me)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,W),o=(o=Math.imul(j,V))+Math.imul(F,W)|0,i=Math.imul(F,V),r=r+Math.imul(L,K)|0,o=(o=o+Math.imul(L,$)|0)+Math.imul(B,K)|0,i=i+Math.imul(B,$)|0,r=r+Math.imul(R,X)|0,o=(o=o+Math.imul(R,Q)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Q)|0,r=r+Math.imul(T,Z)|0,o=(o=o+Math.imul(T,ee)|0)+Math.imul(I,Z)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(A,ne)|0,o=(o=o+Math.imul(A,re)|0)+Math.imul(C,ne)|0,i=i+Math.imul(C,re)|0,r=r+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,r=r+Math.imul(w,le)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(x,le)|0,i=i+Math.imul(x,ce)|0,r=r+Math.imul(v,de)|0,o=(o=o+Math.imul(v,fe)|0)+Math.imul(b,de)|0,i=i+Math.imul(b,fe)|0;var Ae=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),o=(o=Math.imul(j,$))+Math.imul(F,K)|0,i=Math.imul(F,$),r=r+Math.imul(L,X)|0,o=(o=o+Math.imul(L,Q)|0)+Math.imul(B,X)|0,i=i+Math.imul(B,Q)|0,r=r+Math.imul(R,Z)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(P,Z)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(T,ne)|0,o=(o=o+Math.imul(T,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,ae)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,ae)|0,r=r+Math.imul(M,le)|0,o=(o=o+Math.imul(M,ce)|0)+Math.imul(_,le)|0,i=i+Math.imul(_,ce)|0,r=r+Math.imul(w,de)|0,o=(o=o+Math.imul(w,fe)|0)+Math.imul(x,de)|0,i=i+Math.imul(x,fe)|0;var Ce=(c+(r=r+Math.imul(v,pe)|0)|0)+((8191&(o=(o=o+Math.imul(v,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((i=i+Math.imul(b,me)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,X),o=(o=Math.imul(j,Q))+Math.imul(F,X)|0,i=Math.imul(F,Q),r=r+Math.imul(L,Z)|0,o=(o=o+Math.imul(L,ee)|0)+Math.imul(B,Z)|0,i=i+Math.imul(B,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(P,ne)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(T,ie)|0,o=(o=o+Math.imul(T,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(A,le)|0,o=(o=o+Math.imul(A,ce)|0)+Math.imul(C,le)|0,i=i+Math.imul(C,ce)|0,r=r+Math.imul(M,de)|0,o=(o=o+Math.imul(M,fe)|0)+Math.imul(_,de)|0,i=i+Math.imul(_,fe)|0;var ke=(c+(r=r+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(x,pe)|0))<<13)|0;c=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,Z),o=(o=Math.imul(j,ee))+Math.imul(F,Z)|0,i=Math.imul(F,ee),r=r+Math.imul(L,ne)|0,o=(o=o+Math.imul(L,re)|0)+Math.imul(B,ne)|0,i=i+Math.imul(B,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,ae)|0,r=r+Math.imul(T,le)|0,o=(o=o+Math.imul(T,ce)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,ce)|0,r=r+Math.imul(A,de)|0,o=(o=o+Math.imul(A,fe)|0)+Math.imul(C,de)|0,i=i+Math.imul(C,fe)|0;var Te=(c+(r=r+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,me)|0)+Math.imul(_,pe)|0))<<13)|0;c=((i=i+Math.imul(_,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ne),o=(o=Math.imul(j,re))+Math.imul(F,ne)|0,i=Math.imul(F,re),r=r+Math.imul(L,ie)|0,o=(o=o+Math.imul(L,ae)|0)+Math.imul(B,ie)|0,i=i+Math.imul(B,ae)|0,r=r+Math.imul(R,le)|0,o=(o=o+Math.imul(R,ce)|0)+Math.imul(P,le)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(T,de)|0,o=(o=o+Math.imul(T,fe)|0)+Math.imul(I,de)|0,i=i+Math.imul(I,fe)|0;var Ie=(c+(r=r+Math.imul(A,pe)|0)|0)+((8191&(o=(o=o+Math.imul(A,me)|0)+Math.imul(C,pe)|0))<<13)|0;c=((i=i+Math.imul(C,me)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,ie),o=(o=Math.imul(j,ae))+Math.imul(F,ie)|0,i=Math.imul(F,ae),r=r+Math.imul(L,le)|0,o=(o=o+Math.imul(L,ce)|0)+Math.imul(B,le)|0,i=i+Math.imul(B,ce)|0,r=r+Math.imul(R,de)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,fe)|0;var Oe=(c+(r=r+Math.imul(T,pe)|0)|0)+((8191&(o=(o=o+Math.imul(T,me)|0)+Math.imul(I,pe)|0))<<13)|0;c=((i=i+Math.imul(I,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,le),o=(o=Math.imul(j,ce))+Math.imul(F,le)|0,i=Math.imul(F,ce),r=r+Math.imul(L,de)|0,o=(o=o+Math.imul(L,fe)|0)+Math.imul(B,de)|0,i=i+Math.imul(B,fe)|0;var Re=(c+(r=r+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,me)|0)+Math.imul(P,pe)|0))<<13)|0;c=((i=i+Math.imul(P,me)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,de),o=(o=Math.imul(j,fe))+Math.imul(F,de)|0,i=Math.imul(F,fe);var Pe=(c+(r=r+Math.imul(L,pe)|0)|0)+((8191&(o=(o=o+Math.imul(L,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((i=i+Math.imul(B,me)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(c+(r=Math.imul(j,pe))|0)+((8191&(o=(o=Math.imul(j,me))+Math.imul(F,pe)|0))<<13)|0;return c=((i=Math.imul(F,me))+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,l[0]=ge,l[1]=ve,l[2]=be,l[3]=ye,l[4]=we,l[5]=xe,l[6]=Se,l[7]=Me,l[8]=_e,l[9]=Ee,l[10]=Ae,l[11]=Ce,l[12]=ke,l[13]=Te,l[14]=Ie,l[15]=Oe,l[16]=Re,l[17]=Pe,l[18]=Ne,0!==c&&(l[19]=c,n.length++),n};function v(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i<n.length-1;i++){var a=o;o=0;for(var s=67108863&r,l=Math.min(i,t.length-1),c=Math.max(0,i-e.length+1);c<=l;c++){var u=i-c,d=(0|e.words[u])*(0|t.words[c]),f=67108863&d;s=67108863&(f=f+s|0),o+=(a=(a=a+(d/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n._strip()}function b(e,t,n){return v(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(g=m),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?m(this,e,t):n<1024?v(this,e,t):b(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},y.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,o=0;o<t;o++)r|=(1&e)<<t-o-1,e>>=1;return r},y.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a<i;a++)r[a]=t[e[a]],o[a]=n[e[a]]},y.prototype.transform=function(e,t,n,r,o,i){this.permute(i,e,t,n,r,o);for(var a=1;a<o;a<<=1)for(var s=a<<1,l=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),u=0;u<o;u+=s)for(var d=l,f=c,h=0;h<a;h++){var p=n[u+h],m=r[u+h],g=n[u+h+a],v=r[u+h+a],b=d*g-f*v;v=d*v+f*g,g=b,n[u+h]=p+g,r[u+h]=m+v,n[u+h+a]=p-g,r[u+h+a]=m-v,h!==s&&(b=l*d-c*f,f=l*f+c*d,d=b)}},y.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,o=0;for(n=n/2|0;n;n>>>=1)o++;return 1<<o+1+r},y.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var o=e[r];e[r]=e[n-r-1],e[n-r-1]=o,o=t[r],t[r]=-t[n-r-1],t[n-r-1]=-o}},y.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var o=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&o,n=o<67108864?0:o/67108864|0}return e},y.prototype.convert13b=function(e,t,r,o){for(var i=0,a=0;a<t;a++)i+=0|e[a],r[2*a]=8191&i,i>>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a<o;++a)r[a]=0;n(0===i),n(0==(-8192&i))},y.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},y.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),o=this.makeRBT(r),i=this.stub(r),a=new Array(r),s=new Array(r),l=new Array(r),c=new Array(r),u=new Array(r),d=new Array(r),f=n.words;f.length=r,this.convert13b(e.words,e.length,a,r),this.convert13b(t.words,t.length,c,r),this.transform(a,i,s,l,r,o),this.transform(c,i,u,d,r,o);for(var h=0;h<r;h++){var p=s[h]*u[h]-l[h]*d[h];l[h]=s[h]*d[h]+l[h]*u[h],s[h]=p}return this.conjugate(s,l,r),this.transform(s,l,f,i,r,o),this.conjugate(f,i,r),this.normalize13b(f,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,o=0;o<this.length;o++){var i=(0|this.words[o])*e,a=(67108863&i)+(67108863&r);r>>=26,r+=i/67108864|0,r+=a>>>26,this.words[o]=67108863&a}return 0!==r&&(this.words[o]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,o=n%26;t[n]=e.words[r]>>>o&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())0!==t[r]&&(n=n.mul(i));return n},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,o=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&i,l=(0|this.words[t])-s<<r;this.words[t]=l|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var o;n("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<<i,l=r;if(o-=a,o=Math.max(0,o),l){for(var c=0;c<a;c++)l.words[c]=this.words[c];l.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=o);c--){var d=0|this.words[c];this.words[c]=u<<26-i|d>>>i,u=d&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,o=1<<t;return!(this.length<=r)&&!!(this.words[r]&o)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var o,i,a=e.length+r;this._expand(a);var s=0;for(o=0;o<e.length;o++){i=(0|this.words[o+r])+s;var l=(0|e.words[o])*t;s=((i-=67108863&l)>>26)-(l/67108864|0),this.words[o+r]=67108863&i}for(;o<this.length-r;o++)s=(i=(0|this.words[o+r])+s)>>26,this.words[o+r]=67108863&i;if(0===s)return this._strip();for(n(-1===s),s=0,o=0;o<this.length;o++)s=(i=-(0|this.words[o])+s)>>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,l=r.length-i.length;if("mod"!==t){(s=new o(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var u=r.clone()._ishlnsubmul(i,1,l);0===u.negative&&(r=u,s&&(s.words[l]=1));for(var d=l-1;d>=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(i,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=f)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=67108864%e,o=0,i=this.length-1;i>=0;i--)o=(r*o+(0|this.words[i]))%e;return t?-o:o},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*r;this.words[o]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),l=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(u),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(d)),s.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(l)):(r.isub(t),s.isub(i),l.isub(a))}return{a:s,b:l,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),l=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(t.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);for(var d=0,f=1;0==(r.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,o=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=o,this;for(var i=o,a=r;0!==i&&a<this.length;a++){var s=0|this.words[a];i=(s+=i)>>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){r<o?t=-1:r>o&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new A(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function C(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},r(S,x),S.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),o=0;o<r;o++)t.words[o]=e.words[o];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&n,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&n)<<4|i>>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(M,x),r(_,x),r(E,x),E.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,o=67108863&r;r>>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new S;else if("p224"===e)t=new M;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return w[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var d=this.pow(u,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<p);var v=this.pow(d,new o(1).iushln(p-g-1));f=f.redMul(v),d=v.redSqr(),h=h.redMul(d),p=g}return f},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new o(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var i=n[0],a=0,s=0,l=t.bitLength()%26;for(0===l&&(l=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],u=l-1;u>=0;u--){var d=c>>u&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===u)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}l=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new C(e)},r(C,A),C.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},C.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},C.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},C.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},C.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)})),a.register("fEs62",(function(e,t){var n=a("7BZGE"),r=a("ei3QW"),o=a("3skN1"),i=a("duD0R"),s=a("cabM3"),l=a("8ByQm").Buffer;function c(e){var t;"object"!=typeof e||l.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=l.from(e));var a,c,u=o(e,t),d=u.tag,f=u.data;switch(d){case"CERTIFICATE":c=n.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=n.PublicKey.decode(f,"der")),a=c.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=n.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+a)}case"ENCRYPTED PRIVATE KEY":f=function(e,t){var n=e.algorithm.decrypt.kde.kdeparams.salt,o=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),a=r[e.algorithm.decrypt.cipher.algo.join(".")],c=e.algorithm.decrypt.cipher.iv,u=e.subjectPrivateKey,d=parseInt(a.split("-")[1],10)/8,f=s.pbkdf2Sync(t,n,o,d,"sha1"),h=i.createDecipheriv(a,f,c),p=[];return p.push(h.update(u)),p.push(h.final()),l.concat(p)}(f=n.EncryptedPrivateKey.decode(f,"der"),t);case"PRIVATE KEY":switch(a=(c=n.PrivateKey.decode(f,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:n.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=n.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+a)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return{curve:(f=n.ECPrivateKey.decode(f,"der")).parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+d)}}e.exports=c,c.signature=n.signature})),a.register("7BZGE",(function(t,n){var r,o,i,s,l,c,u,d,f,h;e(t.exports,"certificate",(()=>r),(e=>r=e)),e(t.exports,"RSAPrivateKey",(()=>o),(e=>o=e)),e(t.exports,"RSAPublicKey",(()=>i),(e=>i=e)),e(t.exports,"PublicKey",(()=>s),(e=>s=e)),e(t.exports,"PrivateKey",(()=>l),(e=>l=e)),e(t.exports,"EncryptedPrivateKey",(()=>c),(e=>c=e)),e(t.exports,"DSAPrivateKey",(()=>u),(e=>u=e)),e(t.exports,"DSAparam",(()=>d),(e=>d=e)),e(t.exports,"ECPrivateKey",(()=>f),(e=>f=e)),e(t.exports,"signature",(()=>h),(e=>h=e));var p=a("fXArl");r=a("jT65m");var m=p.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));o=m;var g=p.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));i=g;var v=p.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(b),this.key("subjectPublicKey").bitstr())}));s=v;var b=p.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),y=p.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(b),this.key("subjectPrivateKey").octstr())}));l=y;var w=p.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));c=w;var x=p.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));u=x,d=p.define("DSAparam",(function(){this.int()}));var S=p.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(M),this.key("publicKey").optional().explicit(1).bitstr())}));f=S;var M=p.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));h=p.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))})),a.register("fXArl",(function(e,t){"use strict";const n=e.exports;n.bignum=a("jXr8Y"),n.define=a("i8Q43").define,n.base=a("2LhNZ"),n.constants=a("bPkB2"),n.decoders=a("f0HFe"),n.encoders=a("gxTVa")})),a.register("i8Q43",(function(e,t){"use strict";var n=a("gxTVa"),r=a("f0HFe"),o=a("5jAh8");function i(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}e.exports.define=function(e,t){return new i(e,t)},i.prototype._createNamed=function(e){const t=this.name;function n(e){this._initNamed(e,t)}return o(n,e),n.prototype._initNamed=function(t,n){e.call(this,t,n)},new n(this)},i.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(r[e])),this.decoders[e]},i.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)},i.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},i.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}})),a.register("gxTVa",(function(e,t){"use strict";const n=e.exports;n.der=a("ak7Mt"),n.pem=a("2SPPK")})),a.register("ak7Mt",(function(e,t){"use strict";var n=a("5jAh8"),r=a("lfHxF").Buffer,o=a("LjaX0"),i=a("jPxyL");function s(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){o.call(this,"der",e)}function c(e){return e<10?"0"+e:e}e.exports=s,s.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(l,o),l.prototype._encodeComposite=function(e,t,n,o){const a=function(e,t,n,r){let o;"seqof"===e?e="seq":"setof"===e&&(e="set");if(i.tagByName.hasOwnProperty(e))o=i.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return r.error("Unknown tag: "+e);o=e}if(o>=31)return r.error("Multi-octet tag encoding unsupported");t||(o|=32);return o|=i.tagClassByName[n||"universal"]<<6,o}(e,t,n,this.reporter);if(o.length<128){const e=r.alloc(2);return e[0]=a,e[1]=o.length,this._createEncoderBuffer([e,o])}let s=1;for(let e=o.length;e>=256;e>>=8)s++;const l=r.alloc(2+s);l[0]=a,l[1]=128|s;for(let e=1+s,t=o.length;t>0;e--,t>>=8)l[e]=255&t;return this._createEncoderBuffer([l,o])},l.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=r.alloc(2*e.length);for(let n=0;n<e.length;n++)t.writeUInt16BE(e.charCodeAt(n),2*n);return this._createEncoderBuffer(t)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},l.prototype._encodeObjid=function(e,t,n){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let t=0;t<e.length;t++)e[t]|=0}else if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!n){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let o=0;for(let t=0;t<e.length;t++){let n=e[t];for(o++;n>=128;n>>=7)o++}const i=r.alloc(o);let a=i.length-1;for(let t=e.length-1;t>=0;t--){let n=e[t];for(i[a--]=127&n;(n>>=7)>0;)i[a--]=128|127&n}return this._createEncoderBuffer(i)},l.prototype._encodeTime=function(e,t){let n;const r=new Date(e);return"gentime"===t?n=[c(r.getUTCFullYear()),c(r.getUTCMonth()+1),c(r.getUTCDate()),c(r.getUTCHours()),c(r.getUTCMinutes()),c(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[c(r.getUTCFullYear()%100),c(r.getUTCMonth()+1),c(r.getUTCDate()),c(r.getUTCHours()),c(r.getUTCMinutes()),c(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},l.prototype._encodeNull=function(){return this._createEncoderBuffer("")},l.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!r.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=r.from(t)}if(r.isBuffer(e)){let t=e.length;0===e.length&&t++;const n=r.alloc(t);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let t=e;t>=256;t>>=8)n++;const o=new Array(n);for(let t=o.length-1;t>=0;t--)o[t]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(r.from(o))},l.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},l.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},l.prototype._skipDefault=function(e,t,n){const r=this._baseState;let o;if(null===r.default)return!1;const i=e.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r.default,t,n).join()),i.length!==r.defaultBuffer.length)return!1;for(o=0;o<i.length;o++)if(i[o]!==r.defaultBuffer[o])return!1;return!0}})),a.register("lfHxF",(function(e,t){var n,r=a("ePtPP"),o=a("bqBrJ"),i=o.Buffer,s={};for(n in o)o.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(s[n]=o[n]);var l=s.Buffer={};for(n in i)i.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(l[n]=i[n]);if(s.Buffer.prototype=i.prototype,l.from&&l.from!==Uint8Array.from||(l.from=function(e,t,n){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return i(e,t,n)}),l.alloc||(l.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2147483648)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=i(e);return t&&0!==t.length?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r}),!s.kStringMaxLength)try{s.kStringMaxLength=r.binding("buffer").kStringMaxLength}catch(e){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),e.exports=s})),a.register("LjaX0",(function(e,t){"use strict";var n=a("9PoU3").Reporter,r=a("bJRdc").EncoderBuffer,o=a("bJRdc").DecoderBuffer,i=a("iGZtb");const s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],l=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function c(e,t,n){const r={};this._baseState=r,r.name=n,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}e.exports=c;const u=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){const e=this._baseState,t={};u.forEach((function(n){t[n]=e[n]}));const n=new this.constructor(t.parent);return n._baseState=t,n},c.prototype._wrap=function(){const e=this._baseState;l.forEach((function(t){this[t]=function(){const n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}}),this)},c.prototype._init=function(e){const t=this._baseState;i(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),i.equal(t.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){const t=this._baseState,n=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==n.length&&(i(null===t.children),t.children=n,n.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(i(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(n){n==(0|n)&&(n|=0);const r=e[n];t[r]=n})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){c.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),s.forEach((function(e){c.prototype[e]=function(){const t=this._baseState,n=Array.prototype.slice.call(arguments);return i(null===t.tag),t.tag=e,this._useArgs(n),this}})),c.prototype.use=function(e){i(e);const t=this._baseState;return i(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){const t=this._baseState;return i(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){const t=this._baseState;return i(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){const t=this._baseState;return i(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){const t=this._baseState;return i(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(e){const t=this._baseState;return i(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},c.prototype.contains=function(e){const t=this._baseState;return i(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){const n=this._baseState;if(null===n.parent)return e.wrapResult(n.children[0]._decode(e,t));let r,i=n.default,a=!0,s=null;if(null!==n.key&&(s=e.enterKey(n.key)),n.optional){let r=null;if(null!==n.explicit?r=n.explicit:null!==n.implicit?r=n.implicit:null!==n.tag&&(r=n.tag),null!==r||n.any){if(a=this._peekTag(e,r,n.any),e.isError(a))return a}else{const r=e.save();try{null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),a=!0}catch(e){a=!1}e.restore(r)}}if(n.obj&&a&&(r=e.enterObject()),a){if(null!==n.explicit){const t=this._decodeTag(e,n.explicit);if(e.isError(t))return t;e=t}const r=e.offset;if(null===n.use&&null===n.choice){let t;n.any&&(t=e.save());const r=this._decodeTag(e,null!==n.implicit?n.implicit:n.tag,n.any);if(e.isError(r))return r;n.any?i=e.raw(t):e=r}if(t&&t.track&&null!==n.tag&&t.track(e.path(),r,e.length,"tagged"),t&&t.track&&null!==n.tag&&t.track(e.path(),e.offset,e.length,"content"),n.any||(i=null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(n.any||null!==n.choice||null===n.children||n.children.forEach((function(n){n._decode(e,t)})),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){const r=new o(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(r,t)}}return n.obj&&a&&(i=e.leaveObject(r)),null===n.key||null===i&&!0!==a?null!==s&&e.exitKey(s):e.leaveKey(s,n.key,i),i},c.prototype._decodeGeneric=function(e,t,n){const r=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):"objid"===e&&r.args?this._decodeObjid(t,r.args[0],r.args[1],n):"objid"===e?this._decodeObjid(t,null,null,n):"gentime"===e||"utctime"===e?this._decodeTime(t,e,n):"null_"===e?this._decodeNull(t,n):"bool"===e?this._decodeBool(t,n):"objDesc"===e?this._decodeStr(t,e,n):"int"===e||"enum"===e?this._decodeInt(t,r.args&&r.args[0],n):null!==r.use?this._getUse(r.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)},c.prototype._getUse=function(e,t){const n=this._baseState;return n.useDecoder=this._use(e,t),i(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},c.prototype._decodeChoice=function(e,t){const n=this._baseState;let r=null,o=!1;return Object.keys(n.choice).some((function(i){const a=e.save(),s=n.choice[i];try{const n=s._decode(e,t);if(e.isError(n))return!1;r={type:i,value:n},o=!0}catch(t){return e.restore(a),!1}return!0}),this),o?r:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new r(e,this.reporter)},c.prototype._encode=function(e,t,n){const r=this._baseState;if(null!==r.default&&r.default===e)return;const o=this._encodeValue(e,t,n);return void 0===o||this._skipDefault(o,t,n)?void 0:o},c.prototype._encodeValue=function(e,t,r){const o=this._baseState;if(null===o.parent)return o.children[0]._encode(e,t||new n);let i=null;if(this.reporter=t,o.optional&&void 0===e){if(null===o.default)return;e=o.default}let a=null,s=!1;if(o.any)i=this._createEncoderBuffer(e);else if(o.choice)i=this._encodeChoice(e,t);else if(o.contains)a=this._getUse(o.contains,r)._encode(e,t),s=!0;else if(o.children)a=o.children.map((function(n){if("null_"===n._baseState.tag)return n._encode(null,t,e);if(null===n._baseState.key)return t.error("Child should have a key");const r=t.enterKey(n._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const o=n._encode(e[n._baseState.key],t,e);return t.leaveKey(r),o}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===o.tag||"setof"===o.tag){if(!o.args||1!==o.args.length)return t.error("Too many args for : "+o.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const n=this.clone();n._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(n){const r=this._baseState;return this._getUse(r.args[0],e)._encode(n,t)}),n))}else null!==o.use?i=this._getUse(o.use,r)._encode(e,t):(a=this._encodePrimitive(o.tag,e),s=!0);if(!o.any&&null===o.choice){const e=null!==o.implicit?o.implicit:o.tag,n=null===o.implicit?"universal":"context";null===e?null===o.use&&t.error("Tag could be omitted only for .use()"):null===o.use&&(i=this._encodeComposite(e,s,n,a))}return null!==o.explicit&&(i=this._encodeComposite(o.explicit,!1,"context",i)),i},c.prototype._encodeChoice=function(e,t){const n=this._baseState,r=n.choice[e.type];return r||i(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)},c.prototype._encodePrimitive=function(e,t){const n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}})),a.register("9PoU3",(function(t,n){var r;e(t.exports,"Reporter",(()=>r),(e=>r=e));var o=a("5jAh8");function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function s(e,t){this.path=e,this.rethrow(t)}r=i,i.prototype.isError=function(e){return e instanceof s},i.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,n){const r=this._reporterState;this.exitKey(e),null!==r.obj&&(r.obj[t]=n)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){const t=this._reporterState,n=t.obj;return t.obj=e,n},i.prototype.error=function(e){let t;const n=this._reporterState,r=e instanceof s;if(t=r?e:new s(n.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!n.options.partial)throw t;return r||n.errors.push(t),t},i.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},o(s,Error),s.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,s),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}})),a.register("bJRdc",(function(t,n){var r,o;e(t.exports,"DecoderBuffer",(()=>r),(e=>r=e)),e(t.exports,"EncoderBuffer",(()=>o),(e=>o=e));var i=a("5jAh8"),s=a("9PoU3").Reporter,l=a("lfHxF").Buffer;function c(e,t){s.call(this,t),l.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function u(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return u.isEncoderBuffer(e)||(e=new u(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=l.byteLength(e);else{if(!l.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}i(c,s),r=c,c.isDecoderBuffer=function(e){if(e instanceof c)return!0;return"object"==typeof e&&l.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},c.prototype.save=function(){return{offset:this.offset,reporter:s.prototype.save.call(this)}},c.prototype.restore=function(e){const t=new c(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,s.prototype.restore.call(this,e.reporter),t},c.prototype.isEmpty=function(){return this.offset===this.length},c.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},c.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const n=new c(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},c.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},o=u,u.isEncoderBuffer=function(e){if(e instanceof u)return!0;return"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},u.prototype.join=function(e,t){return e||(e=l.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(n){n.join(e,t),t+=n.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):l.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}})),a.register("jPxyL",(function(t,n){var r,o,i,a;function s(e){const t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);const r=e[n];t[r]=n})),t}e(t.exports,"tagClass",(()=>r),(e=>r=e)),e(t.exports,"tagClassByName",(()=>o),(e=>o=e)),e(t.exports,"tag",(()=>i),(e=>i=e)),e(t.exports,"tagByName",(()=>a),(e=>a=e)),o=s(r={0:"universal",1:"application",2:"context",3:"private"}),a=s(i={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"})})),a.register("2SPPK",(function(e,t){"use strict";var n=a("5jAh8"),r=a("ak7Mt");function o(e){r.call(this,e),this.enc="pem"}n(o,r),e.exports=o,o.prototype.encode=function(e,t){const n=r.prototype.encode.call(this,e).toString("base64"),o=["-----BEGIN "+t.label+"-----"];for(let e=0;e<n.length;e+=64)o.push(n.slice(e,e+64));return o.push("-----END "+t.label+"-----"),o.join("\n")}})),a.register("f0HFe",(function(e,t){"use strict";const n=e.exports;n.der=a("hGpEk"),n.pem=a("cpbbP")})),a.register("hGpEk",(function(e,t){"use strict";var n=a("5jAh8"),r=a("jXr8Y"),o=a("bJRdc").DecoderBuffer,i=a("LjaX0"),s=a("jPxyL");function l(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){i.call(this,"der",e)}function u(e,t){let n=e.readUInt8(t);if(e.isError(n))return n;const r=s.tagClass[n>>6],o=0==(32&n);if(31==(31&n)){let r=n;for(n=0;128==(128&r);){if(r=e.readUInt8(t),e.isError(r))return r;n<<=7,n|=127&r}}else n&=31;return{cls:r,primitive:o,tag:n,tagStr:s.tag[n]}}function d(e,t,n){let r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&128===r)return null;if(0==(128&r))return r;const o=127&r;if(o>4)return e.error("length octect is too long");r=0;for(let t=0;t<o;t++){r<<=8;const t=e.readUInt8(n);if(e.isError(t))return t;r|=t}return r}e.exports=l,l.prototype.decode=function(e,t){return o.isDecoderBuffer(e)||(e=new o(e,t)),this.tree._decode(e,t)},n(c,i),c.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;const r=e.save(),o=u(e,'Failed to peek tag: "'+t+'"');return e.isError(o)?o:(e.restore(r),o.tag===t||o.tagStr===t||o.tagStr+"of"===t||n)},c.prototype._decodeTag=function(e,t,n){const r=u(e,'Failed to decode tag of "'+t+'"');if(e.isError(r))return r;let o=d(e,r.primitive,'Failed to get length of "'+t+'"');if(e.isError(o))return o;if(!n&&r.tag!==t&&r.tagStr!==t&&r.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(r.primitive||null!==o)return e.skip(o,'Failed to match body of: "'+t+'"');const i=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(o=e.offset-i.offset,e.restore(i),e.skip(o,'Failed to match body of: "'+t+'"'))},c.prototype._skipUntilEnd=function(e,t){for(;;){const n=u(e,t);if(e.isError(n))return n;const r=d(e,n.primitive,t);if(e.isError(r))return r;let o;if(o=n.primitive||null!==r?e.skip(r):this._skipUntilEnd(e,t),e.isError(o))return o;if("end"===n.tagStr)break}},c.prototype._decodeList=function(e,t,n,r){const o=[];for(;!e.isEmpty();){const t=this._peekTag(e,"end");if(e.isError(t))return t;const i=n.decode(e,"der",r);if(e.isError(i)&&t)break;o.push(i)}return o},c.prototype._decodeStr=function(e,t){if("bitstr"===t){const t=e.readUInt8();return e.isError(t)?t:{unused:t,data:e.raw()}}if("bmpstr"===t){const t=e.raw();if(t.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");let n="";for(let e=0;e<t.length/2;e++)n+=String.fromCharCode(t.readUInt16BE(2*e));return n}if("numstr"===t){const t=e.raw().toString("ascii");return this._isNumstr(t)?t:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){const t=e.raw().toString("ascii");return this._isPrintstr(t)?t:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},c.prototype._decodeObjid=function(e,t,n){let r;const o=[];let i=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),i<<=7,i|=127&a,0==(128&a)&&(o.push(i),i=0);128&a&&o.push(i);const s=o[0]/40|0,l=o[0]%40;if(r=n?o:[s,l].concat(o.slice(1)),t){let e=t[r.join(" ")];void 0===e&&(e=t[r.join(".")]),void 0!==e&&(r=e)}return r},c.prototype._decodeTime=function(e,t){const n=e.raw().toString();let r,o,i,a,s,l;if("gentime"===t)r=0|n.slice(0,4),o=0|n.slice(4,6),i=0|n.slice(6,8),a=0|n.slice(8,10),s=0|n.slice(10,12),l=0|n.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");r=0|n.slice(0,2),o=0|n.slice(2,4),i=0|n.slice(4,6),a=0|n.slice(6,8),s=0|n.slice(8,10),l=0|n.slice(10,12),r=r<70?2e3+r:1900+r}return Date.UTC(r,o-1,i,a,s,l,0)},c.prototype._decodeNull=function(){return null},c.prototype._decodeBool=function(e){const t=e.readUInt8();return e.isError(t)?t:0!==t},c.prototype._decodeInt=function(e,t){const n=e.raw();let o=new r(n);return t&&(o=t[o.toString(10)]||o),o},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}})),a.register("cpbbP",(function(e,t){"use strict";var n=a("5jAh8"),r=a("lfHxF").Buffer,o=a("hGpEk");function i(e){o.call(this,e),this.enc="pem"}n(i,o),e.exports=i,i.prototype.decode=function(e,t){const n=e.toString().split(/[\r\n]+/g),i=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/;let s=-1,l=-1;for(let e=0;e<n.length;e++){const t=n[e].match(a);if(null!==t&&t[2]===i){if(-1!==s){if("END"!==t[1])break;l=e;break}if("BEGIN"!==t[1])break;s=e}}if(-1===s||-1===l)throw new Error("PEM section not found for: "+i);const c=n.slice(s+1,l).join("");c.replace(/[^a-z0-9+/=]+/gi,"");const u=r.from(c,"base64");return o.prototype.decode.call(this,u,t)}})),a.register("2LhNZ",(function(e,t){"use strict";const n=e.exports;n.Reporter=a("9PoU3").Reporter,n.DecoderBuffer=a("bJRdc").DecoderBuffer,n.EncoderBuffer=a("bJRdc").EncoderBuffer,n.Node=a("LjaX0")})),a.register("bPkB2",(function(e,t){"use strict";const n=e.exports;n._reverse=function(e){const t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);const r=e[n];t[r]=n})),t},n.der=a("jPxyL")})),a.register("jT65m",(function(e,t){"use strict";var n=a("fXArl"),r=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),i=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())})),l=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),c=n.define("RDNSequence",(function(){this.seqof(l)})),u=n.define("Name",(function(){this.choice({rdnSequence:this.use(c)})})),d=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(r),this.key("notAfter").use(r))})),f=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),h=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(i),this.key("issuer").use(u),this.key("validity").use(d),this.key("subject").use(u),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(h),this.key("signatureAlgorithm").use(i),this.key("signatureValue").bitstr())}));e.exports=p})),a.register("ei3QW",(function(e,t){e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')})),a.register("3skN1",(function(e,t){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,r=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,i=a("2tkTk"),s=a("duD0R"),l=a("8ByQm").Buffer;e.exports=function(e,t){var a,c=e.toString(),u=c.match(n);if(u){var d="aes"+u[1],f=l.from(u[2],"hex"),h=l.from(u[3].replace(/[\r\n]/g,""),"base64"),p=i(t,f.slice(0,8),parseInt(u[1],10)).key,m=[],g=s.createDecipheriv(d,p,f);m.push(g.update(h)),m.push(g.final()),a=l.concat(m)}else{var v=c.match(o);a=l.from(v[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(r)[1],data:a}}})),a.register("g4OMi",(function(e,t){e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')})),a.register("ajRoR",(function(e,t){var n=a("8ByQm").Buffer,r=a("fmDmL"),o=a("dkUCk").ec,i=a("fEs62"),s=a("g4OMi");function l(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,t,a,c,u){var d=i(a);if("ec"===d.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,n){var r=s[n.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+n.data.algorithm.curve.join("."));var i=new o(r),a=n.data.subjectPrivateKey.data;return i.verify(t,e,a)}(e,t,d)}if("dsa"===d.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,n){var o=n.data.p,a=n.data.q,s=n.data.g,c=n.data.pub_key,u=i.signature.decode(e,"der"),d=u.s,f=u.r;l(d,a),l(f,a);var h=r.mont(o),p=d.invm(a),m=s.toRed(h).redPow(new r(t).mul(p).mod(a)).fromRed().mul(c.toRed(h).redPow(f.mul(p).mod(a)).fromRed()).mod(o).mod(a);return 0===m.cmp(f)}(e,t,d)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");t=n.concat([u,t]);for(var f=d.modulus.byteLength(),h=[1],p=0;t.length+h.length+2<f;)h.push(255),p++;h.push(0);for(var m=-1;++m<t.length;)h.push(t[m]);h=n.from(h);var g=r.mont(d.modulus);e=(e=new r(e).toRed(g)).redPow(new r(d.publicExponent)),e=n.from(e.fromRed().toArray());var v=p<8?1:0;for(f=Math.min(e.length,h.length),e.length!==h.length&&(v=1),m=-1;++m<f;)v|=e[m]^h[m];return 0===v}})),a.register("5nTVb",(function(e,t){var n=a("bqBrJ").Buffer,r=a("dkUCk"),o=a("jXr8Y");e.exports=function(e){return new s(e)};var i={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(e){this.curveType=i[e],this.curveType||(this.curveType={name:e}),this.curve=new r.ec(this.curveType.name),this.keys=void 0}function l(e,t,r){Array.isArray(e)||(e=e.toArray());var o=new n(e);if(r&&o.length<r){var i=new n(r-o.length);i.fill(0),o=n.concat([i,o])}return t?o.toString(t):o}i.p224=i.secp224r1,i.p256=i.secp256r1=i.prime256v1,i.p192=i.secp192r1=i.prime192v1,i.p384=i.secp384r1,i.p521=i.secp521r1,s.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},s.prototype.computeSecret=function(e,t,r){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),l(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},s.prototype.getPublicKey=function(e,t){var n=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(n[n.length-1]%2?n[0]=7:n[0]=6),l(n,e)},s.prototype.getPrivateKey=function(e){return l(this.keys.getPrivate(),e)},s.prototype.setPublicKey=function(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this.keys._importPublic(e),this},s.prototype.setPrivateKey=function(e,t){t=t||"utf8",n.isBuffer(e)||(e=new n(e,t));var r=new o(e);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this}})),a.register("5IN4o",(function(t,n){var r,o,i,s;e(t.exports,"publicEncrypt",(()=>r),(e=>r=e)),e(t.exports,"privateDecrypt",(()=>o),(e=>o=e)),e(t.exports,"privateEncrypt",(()=>i),(e=>i=e)),e(t.exports,"publicDecrypt",(()=>s),(e=>s=e)),r=a("9FMrF"),o=a("42pBv"),i=function(e,t){return r(e,t,!0)},s=function(e,t){return o(e,t,!0)}})),a.register("9FMrF",(function(e,t){var n=a("fEs62"),r=a("3xr1Z"),o=a("d8QYu"),i=a("hvg46"),s=a("f936l"),l=a("jXr8Y"),c=a("3jVNX"),u=a("8sAbQ"),d=a("8ByQm").Buffer;e.exports=function(e,t,a){var f;f=e.padding?e.padding:a?1:4;var h,p=n(e);if(4===f)h=function(e,t){var n=e.modulus.byteLength(),a=t.length,c=o("sha1").update(d.alloc(0)).digest(),u=c.length,f=2*u;if(a>n-f-2)throw new Error("message too long");var h=d.alloc(n-a-f-2),p=n-u-1,m=r(u),g=s(d.concat([c,h,d.alloc(1,1),t],p),i(m,p)),v=s(m,i(g,u));return new l(d.concat([d.alloc(1),v,g],n))}(p,t);else if(1===f)h=function(e,t,n){var o,i=t.length,a=e.modulus.byteLength();if(i>a-11)throw new Error("message too long");o=n?d.alloc(a-i-3,255):function(e){var t,n=d.allocUnsafe(e),o=0,i=r(2*e),a=0;for(;o<e;)a===i.length&&(i=r(2*e),a=0),(t=i[a++])&&(n[o++]=t);return n}(a-i-3);return new l(d.concat([d.from([0,n?1:2]),o,d.alloc(1),t],a))}(p,t,a);else{if(3!==f)throw new Error("unknown padding");if((h=new l(t)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return a?u(h,p):c(h,p)}})),a.register("hvg46",(function(e,t){var n=a("d8QYu"),r=a("8ByQm").Buffer;function o(e){var t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}e.exports=function(e,t){for(var i,a=r.alloc(0),s=0;a.length<t;)i=o(s++),a=r.concat([a,n("sha1").update(e).update(i).digest()]);return a.slice(0,t)}})),a.register("f936l",(function(e,t){e.exports=function(e,t){for(var n=e.length,r=-1;++r<n;)e[r]^=t[r];return e}})),a.register("3jVNX",(function(e,t){var n=a("jXr8Y"),r=a("8ByQm").Buffer;e.exports=function(e,t){return r.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}})),a.register("42pBv",(function(e,t){var n=a("fEs62"),r=a("hvg46"),o=a("f936l"),i=a("jXr8Y"),s=a("8sAbQ"),l=a("d8QYu"),c=a("3jVNX"),u=a("8ByQm").Buffer;e.exports=function(e,t,a){var d;d=e.padding?e.padding:a?1:4;var f,h=n(e),p=h.modulus.byteLength();if(t.length>p||new i(t).cmp(h.modulus)>=0)throw new Error("decryption error");f=a?c(new i(t),h):s(t,h);var m=u.alloc(p-f.length);if(f=u.concat([m,f],p),4===d)return function(e,t){var n=e.modulus.byteLength(),i=l("sha1").update(u.alloc(0)).digest(),a=i.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),c=t.slice(a+1),d=o(s,r(c,a)),f=o(c,r(d,n-a-1));if(function(e,t){e=u.from(e),t=u.from(t);var n=0,r=e.length;e.length!==t.length&&(n++,r=Math.min(e.length,t.length));var o=-1;for(;++o<r;)n+=e[o]^t[o];return n}(i,f.slice(0,a)))throw new Error("decryption error");var h=a;for(;0===f[h];)h++;if(1!==f[h++])throw new Error("decryption error");return f.slice(h)}(h,f);if(1===d)return function(e,t,n){var r=t.slice(0,2),o=2,i=0;for(;0!==t[o++];)if(o>=t.length){i++;break}var a=t.slice(2,o-1);("0002"!==r.toString("hex")&&!n||"0001"!==r.toString("hex")&&n)&&i++;a.length<8&&i++;if(i)throw new Error("decryption error");return t.slice(o)}(0,f,a);if(3===d)return f;throw new Error("unknown padding")}})),a.register("lPq1P",(function(n,r){var o,i;e(n.exports,"randomFill",(()=>o),(e=>o=e)),e(n.exports,"randomFillSync",(()=>i),(e=>i=e));var s=a("ePtPP");function l(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var c=a("8ByQm"),u=(a("3xr1Z"),c.Buffer),d=c.kMaxLength,f=t.crypto||t.msCrypto,h=Math.pow(2,32)-1;function p(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>h||e<0)throw new TypeError("offset must be a uint32");if(e>d||e>t)throw new RangeError("offset out of range")}function m(e,t,n){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>h||e<0)throw new TypeError("size must be a uint32");if(e+t>n||e>d)throw new RangeError("buffer too small")}function g(e,t,n,r){var o=e.buffer,i=new Uint8Array(o,t,n);if(f.getRandomValues(i),!r)return e;s.nextTick((function(){r(null,e)}))}f&&f.getRandomValues?(o=function(e,n,r,o){if(!(u.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof n)o=n,n=0,r=e.length;else if("function"==typeof r)o=r,r=e.length-n;else if("function"!=typeof o)throw new TypeError('"cb" argument must be a function');return p(n,e.length),m(r,n,e.length),g(e,n,r,o)},i=function(e,n,r){void 0===n&&(n=0);if(!(u.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');p(n,e.length),void 0===r&&(r=e.length-n);return m(r,n,e.length),g(e,n,r)}):(o=l,i=l)})),a.register("2bMu7",(function(e,t){var n=a("ePtPP"),r=a("5U18c"),o=a("9gzJO"),i=a("8iXHm"),s=a("1DJXa");e.exports=function(e,t){var a,l=!0;function c(e,r){if(l)return l=!1,void n.nextTick((function(){t(e,r)}));t(e,r)}try{a=r.request.generate(e.cert,e.issuer)}catch(e){return c(e)}var u=s["id-pkix-ocsp"].join(".");r.utils.getAuthorityInfo(a.cert,u,(function(t,n){if(t)return c(t);var s;s=void 0!==e.httpOptions?o._extend(e.httpOptions,i.parse(n)):n,r.utils.getResponse(s,a.data,(function(e,t){if(e)return c(e);r.verify({request:a,response:t},c)}))})),l=!1}})),a.register("ahZQv",(function(e,t){var n=a("ePtPP"),r=a("5U18c"),o=a("1DJXa"),i=a("dc7aw");e.exports=function(e,t){var a,s=e.request;function l(e){n.nextTick((function(){t(e,h&&h.certStatus)}))}try{a=s.issuer||o.Certificate.decode(r.utils.toDER(e.issuer,"CERTIFICATE"),"der"),h=r.utils.parseResponse(e.response)}catch(e){return l(e)}var c=e.response.slice(h.start,h.end),u=h.certs,d=h.certsTbs.map((function(t){return e.response.slice(t.start,t.end)}));h=h.value;var f=r.utils.sign[h.signatureAlgorithm.algorithm.join(".")];if(f){var h,p=function(e,t,n){var a=e.tbsCertificate.subjectPublicKeyInfo;a=r.utils.toPEM(o.SubjectPublicKeyInfo.encode(a,"der"),"PUBLIC KEY");for(var s=0;s<t.length;s++){var l=t[s],c=r.utils.sign[l.signatureAlgorithm.algorithm.join(".")];if(!c)throw new Error("Unknown signature algorithm "+l.signatureAlgorithm.algorithm);var u=i.createVerify(c);if(u.update(n[s]),!u.verify(a,l.signature.data))throw new Error("Invalid signature");var d=l.tbsCertificate.subjectPublicKeyInfo;return r.utils.toPEM(o.SubjectPublicKeyInfo.encode(d,"der"),"PUBLIC KEY")}return a}(a,u,d),m=i.createVerify(f),g=h.tbsResponseData,v=h.signature.data;if(m.update(c),!m.verify(p,v))return l(new Error("Invalid signature"));if(g.responses.length<1)return l(new Error("Expected at least one response"));if((h=g.responses[0]).certId.hashAlgorithm.algorithm.join(".")!==s.certID.hashAlgorithm.algorithm.join("."))return l(new Error("Hash algorithm mismatch"));if(h.certId.issuerNameHash.toString("hex")!==s.certID.issuerNameHash.toString("hex"))return l(new Error("Issuer name hash mismatch"));if(h.certId.issuerKeyHash.toString("hex")!==s.certID.issuerKeyHash.toString("hex"))return l(new Error("Issuer key hash mismatch"));if(0!==h.certId.serialNumber.cmp(s.certID.serialNumber))return l(new Error("Serial number mismatch"));if("good"!==h.certStatus.type)return l(new Error("OCSP Status: "+h.certStatus.type));var b=+new Date,y=e.nudge||6e4;return h.thisUpdate-y>b||h.nextUpdate+y<b?l(new Error("OCSP Response expired")):l(null)}l(new Error("Unknown signature algorithm "+h.signatureAlgorithm.algorithm))}})),a.register("iEMHh",(function(t,n){var r,o,i,s,l,c,u,d,f,h,p,m;e(t.exports,"id-ad-caIssuers",(()=>r),(e=>r=e)),e(t.exports,"id-kp-OCSPSigning",(()=>o),(e=>o=e)),e(t.exports,"getResponse",(()=>i),(e=>i=e)),e(t.exports,"parseResponse",(()=>s),(e=>s=e)),e(t.exports,"digest",(()=>l),(e=>l=e)),e(t.exports,"digestRev",(()=>c),(e=>c=e)),e(t.exports,"sign",(()=>u),(e=>u=e)),e(t.exports,"signRev",(()=>d),(e=>d=e)),e(t.exports,"toPEM",(()=>f),(e=>f=e)),e(t.exports,"toDER",(()=>h),(e=>h=e)),e(t.exports,"getAuthorityInfo",(()=>p),(e=>p=e)),e(t.exports,"RSAPrivateKey",(()=>m),(e=>m=e));var g=a("bqBrJ").Buffer,v=a("fnFC9"),b=a("9gzJO"),y=a("8iXHm"),w=a("fXArl"),x=a("1DJXa");r=[1,3,6,1,5,5,7,48,2],o=[1,3,6,1,5,5,7,3,9],i=function(e,t,n){"object"!=typeof e&&(e=y.parse(e));var r=b._extend({method:"POST",headers:{"Content-Type":"application/ocsp-request","Content-Length":t.length}},e);function o(e,t){n&&n(e,t),n=null}v.request(r,(function(e){if(e.statusCode<200||e.statusCode>=400)return o(new Error("Failed to obtain OCSP response: "+e.statusCode));var t=[];e.on("readable",(function(){var n=e.read();n&&t.push(n)})),e.on("end",(function(){o(null,g.concat(t))}))})).on("error",o).end(t)},s=function(e){var t={start:0,end:e.length},n=x.OCSPResponse.decode(e,"der",{track:function(e,n,r,o){"content"===o&&"responseBytes/response"===e&&(t.start=n,t.end=r)}}),r=n.responseStatus;if("successful"!==r)throw new Error("Bad OCSP response status: "+r);var i=n.responseBytes.responseType;if("id-pkix-ocsp-basic"!==i)throw new Error("Unknown OCSP response type: "+i);var a=n.responseBytes.response,s={start:t.start,end:t.end},l=[],c=x.BasicOCSPResponse.decode(a,"der",{track:function(e,n,r,o){"tagged"===o&&("tbsResponseData"===e?(s.start=t.start+n,s.end=t.start+r):"certs/tbsCertificate"===e&&l.push({start:t.start+n,end:t.start+r}))}}),u=o.join("."),d=(c.certs||[]).filter((function(e){return e.tbsCertificate.extensions.some((function(e){return"extendedKeyUsage"===e.extnID&&e.extnValue.some((function(e){return e.join(".")===u}))}))}));return{start:s.start,end:s.end,value:c,certs:d,certsTbs:l}},l={"1.3.14.3.2.26":"sha1","2.16.840.1.101.3.4.2.1":"sha256"},c={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1"},u={"1.2.840.113549.1.1.5":"sha1WithRSAEncryption","1.2.840.113549.1.1.11":"sha256WithRSAEncryption","1.2.840.113549.1.1.12":"sha384WithRSAEncryption","1.2.840.113549.1.1.13":"sha512WithRSAEncryption"},d={sha1WithRSAEncryption:[1,2,840,113549,1,1,5],sha256WithRSAEncryption:[1,2,840,113549,1,1,11],sha384WithRSAEncryption:[1,2,840,113549,1,1,12],sha512WithRSAEncryption:[1,2,840,113549,1,1,13]},f=function(e,t){for(var n=e.toString("base64"),r=["-----BEGIN "+t+"-----"],o=0;o<n.length;o+=64)r.push(n.slice(o,o+64));return r.push("-----END "+t+"-----"),r.join("\n")},h=function(e,t){var n=e.toString().match(new RegExp("-----BEGIN "+t+"-----([^-]*)-----END "+t+"-----"));return n=n?new g(n[1].replace(/[\r\n]/g,""),"base64"):"string"==typeof e?new g(e):e},p=function(e,t,n){var r=e.tbsCertificate.extensions;r||(r=[]);var o=r.filter((function(e){return"authorityInformationAccess"===e.extnID}));if(0===o.length)return n(new Error("AuthorityInfoAccess not found in extensions"));var i=null;return o.some((function(e){return e.extnValue.some((function(e){if(e.accessMethod.join(".")!==t)return!1;var n=e.accessLocation;return"uniformResourceIdentifier"===n.type&&(i=n.value+"",!0)}))}))?n(null,i):n(new Error(t+" not found in AuthorityInfoAccess"))};var S=w.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));m=S})),a.register("kagof",(function(e,t){var n=a("7NQ4Y"),r=a("6pNVr"),o=a("krREx"),i=a("bL5iF");e.exports=function(e,t){return n(e)||r(e,t)||o(e,t)||i()},e.exports.__esModule=!0,e.exports.default=e.exports})),a.register("7NQ4Y",(function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports})),a.register("6pNVr",(function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports})),a.register("krREx",(function(e,t){var n=a("cc2cE");e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports})),a.register("cc2cE",(function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports})),a.register("bL5iF",(function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports})),a.register("4qTFT",(function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports})),a.register("9uC66",(function(e,t){var n=a("1NHVw");function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports})),a.register("1NHVw",(function(e,t){var n=a("CrfWb").default,r=a("dTNrl");e.exports=function(e){var t=r(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports})),a.register("CrfWb",(function(e,t){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})),a.register("dTNrl",(function(e,t){var n=a("CrfWb").default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports})),a.register("4IUwl",(function(e,t){
53
53
  /*!
@@ -87,7 +87,7 @@ var r,o,i,a,s,l,c,u,d,f,h,p,m,g,v,b,y,w,x,S,M,_,E,A,C,k,T,I;e(t.exports,"AsyncMo
87
87
  * @internal
88
88
  * @license Modernizr 3.0.0pre (Custom Build) | MIT
89
89
  */,e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,i=o in document;if(!i){var a=document.createElement("div");a.setAttribute(o,"return;"),i="function"==typeof a[o]}return!i&&n&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}})),a.register("3sU9E",(function(e,t){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};e.exports=r})),a("juxiN").register(JSON.parse('{"adfgW":"index.js","cmazm":"abap.bc6c1a94.js","jPTA1":"abnf.a3fdbafa.js","jdWNC":"actionscript.59d9b9ea.js","2CBqg":"ada.7ae8a3a8.js","3wHhO":"agda.c22a72e2.js","kFVdl":"al.43edf93f.js","3V4RR":"antlr4.fab93bd9.js","ksX9L":"apacheconf.1ea6f6bc.js","3N81M":"apex.5f5d0b00.js","lBh32":"apl.f0e0255a.js","1cOI2":"applescript.f8873ad2.js","hwV5I":"aql.0596cd74.js","cxQUy":"arduino.8a10351d.js","h8XDs":"arff.b6eba224.js","1glOK":"asciidoc.3591554e.js","5YI5Q":"asm6502.eb3baf93.js","5aM2c":"asmatmel.93b67168.js","aKcNk":"aspnet.a154be94.js","bYGuI":"csharp.60bc2788.js","4ffJ6":"autohotkey.dc99c6b5.js","6o8gr":"autoit.7bd54007.js","d0QlI":"avisynth.506bbdad.js","1vpfH":"avro-idl.ab78e3d7.js","d78C2":"basic.09310972.js","1V5ou":"batch.5c48c918.js","h9qnw":"bbcode.4e0cb2f2.js","eluAn":"bicep.e394696d.js","jD2Yh":"birb.54766d79.js","3ligT":"bison.2c2552ab.js","cSnAi":"bnf.ec556d42.js","gmloY":"brainfuck.4e81eb1d.js","77rtQ":"brightscript.3c7cc723.js","hfFki":"bro.8db28f8a.js","8SYqo":"bsl.260fabfb.js","i4HkI":"cfscript.92c90b90.js","1rBYK":"chaiscript.76481f4b.js","gQYEz":"cil.622792d1.js","bq2uf":"clike.36346267.js","h7tza":"clojure.9da4900e.js","aK2oY":"cmake.234b57e3.js","3V5TZ":"cobol.2e8bd2ea.js","72v5N":"coffeescript.261b318a.js","lNJYg":"concurnas.9d189a8c.js","cHo4f":"coq.917e2a53.js","7GKmU":"crystal.d23925f3.js","a5f4n":"cshtml.92086949.js","2nOzn":"csp.9b5dd573.js","iZH8k":"css-extras.7f3088a6.js","3V9km":"css.fb6f00e3.js","7TCh4":"csv.06af3522.js","8MqYl":"cypher.6af6e534.js","6Oo3A":"d.303192e5.js","6ks0D":"dart.6fb62874.js","huqsT":"dataweave.e97ef31d.js","YtcLG":"dax.013d5e9a.js","1s9Hz":"dhall.d5ee83ba.js","b677V":"diff.9ef56ea8.js","ak2pO":"django.13b0bb49.js","8LDFZ":"dns-zone-file.189b08c5.js","1awLf":"docker.1da9769e.js","9dPYr":"dot.8dca92f3.js","e2ZjS":"ebnf.58c0fa63.js","9h8KW":"editorconfig.9c7b63a5.js","4SWgd":"eiffel.090bab86.js","6HmuU":"ejs.0ee535c3.js","2KAkF":"elixir.dc192ee6.js","jPV3v":"elm.c88782bd.js","agNrQ":"erb.55ec7cf0.js","9BmS2":"erlang.956455fa.js","fqf1c":"etlua.79f6dba5.js","cgMSr":"lua.88c0a077.js","92McF":"excel-formula.d0dd1424.js","juFxG":"factor.e311ca38.js","1dWPh":"false.a93fe44c.js","2k0b2":"firestore-security-rules.4ea155d7.js","dvL1Q":"flow.96e0f48a.js","5oumN":"fortran.0811bc79.js","fP8jO":"fsharp.0119d0fd.js","7L6sP":"ftl.c5671dbe.js","2ujce":"gap.b0574953.js","hzgIA":"gcode.29260c31.js","5MUDD":"gdscript.545f127b.js","ghckm":"gedcom.d53f8a81.js","ian9z":"gherkin.0c5a099f.js","dsuH3":"git.2d89a25c.js","dvV8S":"glsl.0bf837a6.js","6BDWE":"gml.04204c1b.js","btSYt":"gn.cbb4c3be.js","j94Lr":"go-module.2bebc9b8.js","207xG":"go.cc49e5b2.js","iQ4Nh":"graphql.3d658adb.js","9E9pJ":"groovy.3e5836cd.js","hLXUt":"haml.9a056759.js","5ob5h":"handlebars.8c13dfe6.js","1nDhS":"haskell.3c80aa72.js","kQehe":"haxe.40a1dc98.js","1sziu":"hcl.84488f47.js","28Tam":"hlsl.323b0c17.js","awNOU":"hoon.df16cb45.js","eeLMI":"hpkp.9c950797.js","gjEKw":"hsts.0440ab7b.js","3bCJ7":"http.96d5f1c1.js","id4YZ":"ichigojam.c0bd16f5.js","5TKHe":"icon.439feb9f.js","eijPh":"icu-message-format.e96f6551.js","lv8gR":"idris.d3811412.js","bW8K3":"iecst.3fdbbc52.js","b8EBv":"ignore.00726ce9.js","jOS96":"inform7.65978ef5.js","dn3Yf":"ini.1cbb0515.js","iUSU6":"io.e628fd7e.js","6wbwo":"j.b959d174.js","5qA0j":"java.0ffd8069.js","hdx4d":"javadoc.b99752ae.js","jRMSs":"javadoclike.8cc3d825.js","l2DRD":"javascript.fe729813.js","cpOeo":"javastacktrace.cc22fb4b.js","fSVrK":"jexl.2cce5cc0.js","03mi8":"jolie.d8f352cd.js","j6YjP":"jq.65b95777.js","6JQIv":"js-extras.7d041902.js","5nVrm":"js-templates.a3463d0b.js","9gPZY":"jsdoc.0c5cc4d3.js","8q0xA":"json5.b9de5531.js","fIx8j":"jsonp.eefdc553.js","a3ur7":"jsstacktrace.8d3a2b71.js","bKtxi":"julia.679e1c74.js","9vqI0":"keepalived.e694c167.js","lDUCl":"keyman.d1406200.js","gcEXq":"kotlin.fd040b34.js","cxxOt":"kumir.b2072cfc.js","b8NIc":"kusto.98546fcc.js","iXz7U":"latex.ecc17a0d.js","9nRbn":"latte.18295a4f.js","lWxq2":"less.a8a986ab.js","7dEcL":"lilypond.0423d709.js","ck7Ll":"scheme.4039466f.js","hI3m3":"liquid.533f073c.js","7qpQZ":"lisp.b075bd53.js","8Cm1D":"livescript.2b19fb05.js","9sT8D":"llvm.6b74465d.js","gQkTU":"log.b74346d6.js","86y52":"lolcode.0fbc730a.js","6bXdx":"magma.bbb66246.js","hDIxO":"makefile.bf1a7653.js","4wRUQ":"markdown.4a5510a8.js","66rgq":"markup.973a8c4c.js","iAx9A":"matlab.caaa1e9f.js","5SXMq":"maxscript.58a0bf4d.js","gnQ55":"mel.c5da9d2e.js","8G54S":"mermaid.ced53190.js","gfXsu":"mizar.4e6d6035.js","7nZsb":"mongodb.5c4e0cf9.js","hUs37":"monkey.9be800f3.js","fKqwA":"moonscript.fc782589.js","luHXo":"n1ql.7f05115f.js","j0sqX":"n4js.318f41b7.js","avS2d":"nand2tetris-hdl.be3bb656.js","8fNUI":"naniscript.ec3afc9a.js","6PKtR":"nasm.1ee2623a.js","2LUGi":"neon.1d5a4ec8.js","esMLb":"nevod.6908715c.js","jQ8dR":"nginx.404fbeb4.js","1kuW2":"nim.36bf497b.js","7YxPR":"nix.3af3b6b2.js","b1EPY":"nsis.94e1fb71.js","j169M":"objectivec.49a6b342.js","1b4qw":"ocaml.c5fca1eb.js","c0JxA":"opencl.4194613a.js","54ivl":"openqasm.4b589cb3.js","kYO5l":"oz.498e9cbd.js","811Qi":"parigp.ed6a3789.js","gXO52":"parser.3329b2ab.js","4SQCy":"pascal.82aebbcf.js","9KuwN":"pascaligo.4bbd3a85.js","eM7TR":"pcaxis.e636466e.js","6w6GH":"peoplecode.32e124c6.js","eQPpI":"perl.7d72d7fd.js","b83gb":"php-extras.9606406b.js","l8BPM":"phpdoc.617f8af6.js","2cVRv":"plsql.482f8da9.js","gOyA3":"powerquery.486ee359.js","1BYb4":"powershell.856a4dd0.js","lIwm5":"processing.2c7d4403.js","cHCln":"prolog.812b5c86.js","d460J":"promql.8e6b9da4.js","lAnQP":"properties.40afd4d0.js","dG8OA":"protobuf.84963e3e.js","eRbDh":"psl.9c32166c.js","27W0o":"pug.54462c11.js","75Y4h":"puppet.2646aef5.js","kgGGG":"pure.a10bd6b4.js","hFuIq":"purebasic.629b75cd.js","db2yj":"purescript.216751ba.js","8ZppB":"q.b46a94a4.js","iFM89":"qml.bd71f711.js","7FNJV":"qore.d7e006f8.js","6AsUF":"qsharp.7bab07d1.js","7Xrsp":"r.3036c5c0.js","dh9BI":"racket.b867dd29.js","8pRTf":"reason.405183ad.js","kUbHD":"regex.aa4684b4.js","bNx4l":"rego.61da6b5d.js","jbksA":"renpy.ff0ce389.js","gP26j":"rest.91bee177.js","6FCYh":"rip.33f479a4.js","lEjxk":"roboconf.0ba2e9bf.js","c8BOJ":"robotframework.72ccad61.js","elAoE":"rust.9a35cb62.js","eDL1o":"sas.b3b3be64.js","gIQMB":"sass.165275f3.js","i7Y8T":"scala.a51a6234.js","OzRer":"shell-session.c47a7880.js","hZA2W":"smali.46e3f703.js","gT51y":"smalltalk.fb31e155.js","2OoIP":"smarty.abd6973e.js","33hrk":"sml.6d8c2545.js","3uuqi":"solidity.80562c5b.js","kHJvD":"solution-file.30e00f5f.js","6iiDq":"soy.46a7ec1f.js","2TkEp":"sparql.dbb56be0.js","eirDq":"turtle.b8836781.js","jmDes":"splunk-spl.149146f6.js","81dr7":"sqf.ea070acb.js","i4XqC":"squirrel.1efaf6f3.js","1zw3p":"stan.6efb4565.js","kfIG2":"stylus.d4d41ca4.js","dksml":"swift.ea86fdd0.js","4w3mZ":"systemd.df819c28.js","6b6p1":"t4-cs.b3eaa646.js","budu0":"t4-templating.db399052.js","7RUUk":"t4-vb.082c208c.js","2cwdT":"vbnet.ac572fcc.js","fBA7X":"tap.82e5520b.js","gqbYu":"yaml.3d0bf472.js","lCVk7":"tcl.fffb53bb.js","aKXaK":"textile.20ae1d45.js","ks7hU":"toml.69754057.js","kCJbl":"tremor.262b95d4.js","iZ71n":"tt2.f07906cb.js","5mLLA":"twig.a95c4964.js","i9AIa":"typoscript.3dbd38d9.js","iHNMy":"unrealscript.e5c3fc1d.js","bKWLJ":"uorazor.cf3ed6dc.js","2XcAn":"uri.59c4e10c.js","enDcg":"v.fe8e0874.js","db4Ta":"vala.386e6270.js","cmaSk":"velocity.9a0ffb21.js","29RKO":"verilog.4308f028.js","4aBVG":"vhdl.ca8ee4c0.js","6Jrfy":"vim.897929a5.js","kNyzl":"visual-basic.bc36aaac.js","4LJ5s":"warpscript.6d00b50f.js","6Ocza":"wasm.029f651e.js","hvPGO":"web-idl.97fc763d.js","lS90V":"wiki.1179d7f8.js","9LY8Y":"wolfram.7017e6a0.js","bFBdJ":"wren.d4121438.js","iskNq":"xeora.cce693be.js","ek7X7":"xml-doc.025d4193.js","hwA94":"xojo.843f212e.js","f8rnQ":"xquery.50701bd4.js","3Q9qv":"yang.2c70775f.js","a0Oht":"zig.e33efe11.js","dnGOp":"core.ade097c7.js","9u7s7":"index.css"}'));var s;s=a("9Hk4c"),a("85Hg2");var l,c=a("2BCLI"),u=a("85Hg2");l=a("bG9xl")();var d,f=a("dCyaf"),h=new Uint8Array(16);function p(){if(!d&&!(d="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return d(h)}var m=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var g=function(e){return"string"==typeof e&&m.test(e)},v=[],b=0;b<256;++b)v.push((b+256).toString(16).substr(1));var y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(v[e[t+0]]+v[e[t+1]]+v[e[t+2]]+v[e[t+3]]+"-"+v[e[t+4]]+v[e[t+5]]+"-"+v[e[t+6]]+v[e[t+7]]+"-"+v[e[t+8]]+v[e[t+9]]+"-"+v[e[t+10]]+v[e[t+11]]+v[e[t+12]]+v[e[t+13]]+v[e[t+14]]+v[e[t+15]]).toLowerCase();if(!g(n))throw TypeError("Stringified UUID is invalid");return n};var w=function(e,t,n){var r=(e=e||{}).random||(e.rng||p)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return y(r)};const x=()=>w(),S=()=>x().replace(new RegExp("-","g"),"").toUpperCase();var M,_,E,A,C,k,T,I;(_=M||(M={}))[_.Debug=0]="Debug",_[_.Info=1]="Info",_[_.Warning=2]="Warning",_[_.Error=3]="Error";class O{constructor(e,t){this.privName=e,this.privEventId=S(),this.privEventTime=(new Date).toISOString(),this.privEventType=t,this.privMetadata={}}get name(){return this.privName}get eventId(){return this.privEventId}get eventTime(){return this.privEventTime}get eventType(){return this.privEventType}get metadata(){return this.privMetadata}}class R extends O{constructor(e,t,n=M.Info){super(e,n),this.privAudioSourceId=t}get audioSourceId(){return this.privAudioSourceId}}class P extends R{constructor(e){super("AudioSourceInitializingEvent",e)}}class N extends R{constructor(e){super("AudioSourceReadyEvent",e)}}class L extends R{constructor(e){super("AudioSourceOffEvent",e)}}class B extends R{constructor(e,t){super("AudioSourceErrorEvent",e,M.Error),this.privError=t}get error(){return this.privError}}class D extends R{constructor(e,t,n){super(e,t),this.privAudioNodeId=n}get audioNodeId(){return this.privAudioNodeId}}class j extends D{constructor(e,t){super("AudioStreamNodeAttachingEvent",e,t)}}class F extends D{constructor(e,t){super("AudioStreamNodeAttachedEvent",e,t)}}class z extends D{constructor(e,t){super("AudioStreamNodeDetachedEvent",e,t)}}class U extends D{constructor(e,t,n){super("AudioStreamNodeErrorEvent",e,t),this.privError=n}get error(){return this.privError}}class H extends O{constructor(e,t,n=M.Info){super(e,n),this.privJsonResult=t}get jsonString(){return this.privJsonResult}}class G extends O{constructor(e,t,n=M.Info){super(e,n),this.privConnectionId=t}get connectionId(){return this.privConnectionId}}class W extends G{constructor(e,t,n){super("ConnectionStartEvent",e),this.privUri=t,this.privHeaders=n}get uri(){return this.privUri}get headers(){return this.privHeaders}}class V extends G{constructor(e,t){super("ConnectionEstablishedEvent",e)}}class q extends G{constructor(e,t,n){super("ConnectionClosedEvent",e,M.Debug),this.privReason=n,this.privStatusCode=t}get reason(){return this.privReason}get statusCode(){return this.privStatusCode}}class K extends G{constructor(e,t,n){super("ConnectionErrorEvent",e,M.Debug),this.privMessage=t,this.privType=n}get message(){return this.privMessage}get type(){return this.privType}}class $ extends G{constructor(e,t,n){super("ConnectionEstablishErrorEvent",e,M.Error),this.privStatusCode=t,this.privReason=n}get reason(){return this.privReason}get statusCode(){return this.privStatusCode}}class J extends G{constructor(e,t,n){super("ConnectionMessageReceivedEvent",e),this.privNetworkReceivedTime=t,this.privMessage=n}get networkReceivedTime(){return this.privNetworkReceivedTime}get message(){return this.privMessage}}class X extends G{constructor(e,t,n){super("ConnectionMessageSentEvent",e),this.privNetworkSentTime=t,this.privMessage=n}get networkSentTime(){return this.privNetworkSentTime}get message(){return this.privMessage}}class Q extends Error{constructor(e){super(e),this.name="ArgumentNull",this.message=e}}class Y extends Error{constructor(e){super(e),this.name="InvalidOperation",this.message=e}}class Z extends Error{constructor(e,t){super(t),this.name=e+"ObjectDisposed",this.message=t}}(A=E||(E={}))[A.Text=0]="Text",A[A.Binary=1]="Binary";class ee{constructor(e,t,n,r){if(this.privBody=null,e===E.Text&&t&&"string"!=typeof t)throw new Y("Payload must be a string");if(e===E.Binary&&t&&!(t instanceof ArrayBuffer))throw new Y("Payload must be ArrayBuffer");switch(this.privMessageType=e,this.privBody=t,this.privHeaders=n||{},this.privId=r||S(),this.messageType){case E.Binary:this.privSize=null!==this.binaryBody?this.binaryBody.byteLength:0;break;case E.Text:this.privSize=this.textBody.length}}get messageType(){return this.privMessageType}get headers(){return this.privHeaders}get body(){return this.privBody}get textBody(){if(this.privMessageType===E.Binary)throw new Y("Not supported for binary message");return this.privBody}get binaryBody(){if(this.privMessageType===E.Text)throw new Y("Not supported for text message");return this.privBody}get id(){return this.privId}}class te{constructor(e,t){this.privStatusCode=e,this.privReason=t}get statusCode(){return this.privStatusCode}get reason(){return this.privReason}}class ne{constructor(e){this.privEventListeners={},this.privIsDisposed=!1,this.onEvent=e=>{if(this.isDisposed())throw new Z("EventSource");if(this.metadata)for(const t in this.metadata)t&&e.metadata&&(e.metadata[t]||(e.metadata[t]=this.metadata[t]));for(const t in this.privEventListeners)t&&this.privEventListeners[t]&&this.privEventListeners[t](e)},this.attach=e=>{const t=S();return this.privEventListeners[t]=e,{detach:()=>(delete this.privEventListeners[t],Promise.resolve())}},this.attachListener=e=>this.attach(e.onEvent),this.isDisposed=()=>this.privIsDisposed,this.dispose=()=>{this.privEventListeners=null,this.privIsDisposed=!0},this.privMetadata=e}get metadata(){return this.privMetadata}}class re{static get instance(){return re.privInstance}}re.privInstance=new ne,re.setEventSource=e=>{if(!e)throw new Q("eventSource");re.privInstance=e},(k=C||(C={}))[k.None=0]="None",k[k.Connected=1]="Connected",k[k.Connecting=2]="Connecting",k[k.Disconnected=3]="Disconnected",(I=T||(T={}))[I.None=0]="None",I[I.Resolved=1]="Resolved",I[I.Rejected=2]="Rejected";class oe{constructor(){this.resolve=e=>(this.privResolve(e),this),this.reject=e=>(this.privReject(e),this),this.privPromise=new Promise(((e,t)=>{this.privResolve=e,this.privReject=t}))}get promise(){return this.privPromise}}function ie(e,t,n){e.then((e=>{try{t&&t(e)}catch(e){if(n)try{if(e instanceof Error){const t=e;n(t.name+": "+t.message)}else n(e)}catch(e){}}}),(e=>{if(n)try{if(e instanceof Error){const t=e;n(t.name+": "+t.message)}else n(e)}catch(e){}}))}var ae={};e(ae,"Queue",(()=>de),(e=>de=e));class se{constructor(e){if(this.privSubscriptionIdCounter=0,this.privAddSubscriptions={},this.privRemoveSubscriptions={},this.privDisposedSubscriptions={},this.privDisposeReason=null,this.get=e=>(this.throwIfDisposed(),this.privList[e]),this.first=()=>this.get(0),this.last=()=>this.get(this.length()-1),this.add=e=>{this.throwIfDisposed(),this.insertAt(this.privList.length,e)},this.insertAt=(e,t)=>{this.throwIfDisposed(),0===e?this.privList.unshift(t):e===this.privList.length?this.privList.push(t):this.privList.splice(e,0,t),this.triggerSubscriptions(this.privAddSubscriptions)},this.removeFirst=()=>(this.throwIfDisposed(),this.removeAt(0)),this.removeLast=()=>(this.throwIfDisposed(),this.removeAt(this.length()-1)),this.removeAt=e=>(this.throwIfDisposed(),this.remove(e,1)[0]),this.remove=(e,t)=>{this.throwIfDisposed();const n=this.privList.splice(e,t);return this.triggerSubscriptions(this.privRemoveSubscriptions),n},this.clear=()=>{this.throwIfDisposed(),this.remove(0,this.length())},this.length=()=>(this.throwIfDisposed(),this.privList.length),this.onAdded=e=>{this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privAddSubscriptions[t]=e,{detach:()=>(delete this.privAddSubscriptions[t],Promise.resolve())}},this.onRemoved=e=>{this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privRemoveSubscriptions[t]=e,{detach:()=>(delete this.privRemoveSubscriptions[t],Promise.resolve())}},this.onDisposed=e=>{this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privDisposedSubscriptions[t]=e,{detach:()=>(delete this.privDisposedSubscriptions[t],Promise.resolve())}},this.join=e=>(this.throwIfDisposed(),this.privList.join(e)),this.toArray=()=>{const e=Array();return this.privList.forEach((t=>{e.push(t)})),e},this.any=e=>(this.throwIfDisposed(),e?this.where(e).length()>0:this.length()>0),this.all=e=>(this.throwIfDisposed(),this.where(e).length()===this.length()),this.forEach=e=>{this.throwIfDisposed();for(let t=0;t<this.length();t++)e(this.privList[t],t)},this.select=e=>{this.throwIfDisposed();const t=[];for(let n=0;n<this.privList.length;n++)t.push(e(this.privList[n],n));return new se(t)},this.where=e=>{this.throwIfDisposed();const t=new se;for(let n=0;n<this.privList.length;n++)e(this.privList[n],n)&&t.add(this.privList[n]);return t},this.orderBy=e=>{this.throwIfDisposed();const t=this.toArray().sort(e);return new se(t)},this.orderByDesc=e=>(this.throwIfDisposed(),this.orderBy(((t,n)=>e(n,t)))),this.clone=()=>(this.throwIfDisposed(),new se(this.toArray())),this.concat=e=>(this.throwIfDisposed(),new se(this.privList.concat(e.toArray()))),this.concatArray=e=>(this.throwIfDisposed(),new se(this.privList.concat(e))),this.isDisposed=()=>null==this.privList,this.dispose=e=>{this.isDisposed()||(this.privDisposeReason=e,this.privList=null,this.privAddSubscriptions=null,this.privRemoveSubscriptions=null,this.triggerSubscriptions(this.privDisposedSubscriptions))},this.throwIfDisposed=()=>{if(this.isDisposed())throw new Z("List",this.privDisposeReason)},this.triggerSubscriptions=e=>{if(e)for(const t in e)t&&e[t]()},this.privList=[],e)for(const t of e)this.privList.push(t)}}var le,ce,ue=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};(ce=le||(le={}))[ce.Dequeue=0]="Dequeue",ce[ce.Peek=1]="Peek";class de{constructor(e){this.privPromiseStore=new se,this.privIsDrainInProgress=!1,this.privIsDisposing=!1,this.privDisposeReason=null,this.enqueue=e=>{this.throwIfDispose(),this.enqueueFromPromise(new Promise(((t,n)=>{t(e)})))},this.enqueueFromPromise=e=>{this.throwIfDispose(),e.then((e=>{this.privList.add(e)}),(e=>{}))},this.dequeue=()=>{this.throwIfDispose();const e=new oe;return this.privSubscribers&&(this.privSubscribers.add({deferral:e,type:le.Dequeue}),this.drain()),e.promise},this.peek=()=>{this.throwIfDispose();const e=new oe;return this.privSubscribers&&(this.privSubscribers.add({deferral:e,type:le.Peek}),this.drain()),e.promise},this.length=()=>(this.throwIfDispose(),this.privList.length()),this.isDisposed=()=>null==this.privSubscribers,this.drain=()=>{if(!this.privIsDrainInProgress&&!this.privIsDisposing){this.privIsDrainInProgress=!0;const e=this.privSubscribers,t=this.privList;if(e&&t){for(;t.length()>0&&e.length()>0&&!this.privIsDisposing;){const n=e.removeFirst();if(n.type===le.Peek)n.deferral.resolve(t.first());else{const e=t.removeFirst();n.deferral.resolve(e)}}this.privSubscribers===e&&(this.privSubscribers=e),this.privList===t&&(this.privList=t)}this.privIsDrainInProgress=!1}},this.throwIfDispose=()=>{if(this.isDisposed()){if(this.privDisposeReason)throw new Y(this.privDisposeReason);throw new Z("Queue")}if(this.privIsDisposing)throw new Y("Queue disposing")},this.privList=e||new se,this.privDetachables=[],this.privSubscribers=new se,this.privDetachables.push(this.privList.onAdded(this.drain))}drainAndDispose(e,t){return ue(this,void 0,void 0,(function*(){if(!this.isDisposed()&&!this.privIsDisposing){this.privDisposeReason=t,this.privIsDisposing=!0;const n=this.privSubscribers;if(n){for(;n.length()>0;){n.removeFirst().deferral.resolve(void 0)}this.privSubscribers===n&&(this.privSubscribers=n)}for(const e of this.privDetachables)yield e.detach();if(this.privPromiseStore.length()>0&&e){const t=[];return this.privPromiseStore.toArray().forEach((e=>{t.push(e)})),Promise.all(t).finally((()=>{this.privSubscribers=null,this.privList.forEach(((t,n)=>{e(t)})),this.privList=null})).then()}this.privSubscribers=null,this.privList=null}}))}dispose(e){return ue(this,void 0,void 0,(function*(){yield this.drainAndDispose(null,e)}))}}class fe{constructor(e,t,n){if(this.privPayload=null,!t)throw new Q("payload");if(e===E.Binary&&"ArrayBuffer"!==t.__proto__.constructor.name)throw new Y("Payload must be ArrayBuffer");if(e===E.Text&&"string"!=typeof t)throw new Y("Payload must be a string");this.privMessageType=e,this.privPayload=t,this.privId=n||S()}get messageType(){return this.privMessageType}get payload(){return this.privPayload}get textContent(){if(this.privMessageType===E.Binary)throw new Y("Not supported for binary message");return this.privPayload}get binaryContent(){if(this.privMessageType===E.Text)throw new Y("Not supported for text message");return this.privPayload}get id(){return this.privId}}class he{constructor(e,t){this.encode=e=>{const t=this.downSampleAudioFrame(e,this.privActualSampleRate,this.privDesiredSampleRate);if(!t)return null;const n=2*t.length,r=new ArrayBuffer(n),o=new DataView(r);return this.floatTo16BitPCM(o,0,t),r},this.setString=(e,t,n)=>{for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))},this.floatTo16BitPCM=(e,t,n)=>{for(let r=0;r<n.length;r++,t+=2){const o=Math.max(-1,Math.min(1,n[r]));e.setInt16(t,o<0?32768*o:32767*o,!0)}},this.downSampleAudioFrame=(e,t,n)=>{if(!e)return null;if(n===t||n>t)return e;const r=t/n,o=Math.round(e.length/r),i=new Float32Array(o);let a=0,s=0;for(;s<o;){const t=Math.round((s+1)*r);let n=0,o=0;for(;a<t&&a<e.length;)n+=e[a++],o++;i[s++]=n/o}return i},this.privActualSampleRate=e,this.privDesiredSampleRate=t}}var pe={};e(pe,"Stream",(()=>be),(e=>be=e));var me,ge,ve=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class be{constructor(e){this.privIsWriteEnded=!1,this.privIsReadEnded=!1,this.read=()=>{if(this.privIsReadEnded)throw new Y("Stream read has already finished");return this.privReaderQueue.dequeue().then((e=>ve(this,void 0,void 0,(function*(){return(void 0===e||e.isEnd)&&(yield this.privReaderQueue.dispose("End of stream reached")),e}))))},this.readEnded=()=>{this.privIsReadEnded||(this.privIsReadEnded=!0,this.privReaderQueue=new(0,ae.Queue))},this.throwIfClosed=()=>{if(this.privIsWriteEnded)throw new Y("Stream closed")},this.privId=e||S(),this.privReaderQueue=new(0,ae.Queue)}get isClosed(){return this.privIsWriteEnded}get isReadEnded(){return this.privIsReadEnded}get id(){return this.privId}close(){this.privIsWriteEnded||(this.writeStreamChunk({buffer:null,isEnd:!0,timeReceived:Date.now()}),this.privIsWriteEnded=!0)}writeStreamChunk(e){if(this.throwIfClosed(),!this.privReaderQueue.isDisposed())try{this.privReaderQueue.enqueue(e)}catch(e){}}}(ge=me||(me={}))[ge.Success=0]="Success",ge[ge.Error=1]="Error";class ye extends pe.Stream{constructor(e,t){super(t),this.privTargetChunkSize=e,this.privNextBufferReadyBytes=0}writeStreamChunk(e){if(e.isEnd||0===this.privNextBufferReadyBytes&&e.buffer.byteLength===this.privTargetChunkSize)return void super.writeStreamChunk(e);let t=0;for(;t<e.buffer.byteLength;){void 0===this.privNextBufferToWrite&&(this.privNextBufferToWrite=new ArrayBuffer(this.privTargetChunkSize),this.privNextBufferStartTime=e.timeReceived);const n=Math.min(e.buffer.byteLength-t,this.privTargetChunkSize-this.privNextBufferReadyBytes),r=new Uint8Array(this.privNextBufferToWrite),o=new Uint8Array(e.buffer.slice(t,n+t));r.set(o,this.privNextBufferReadyBytes),this.privNextBufferReadyBytes+=n,t+=n,this.privNextBufferReadyBytes===this.privTargetChunkSize&&(super.writeStreamChunk({buffer:this.privNextBufferToWrite,isEnd:!1,timeReceived:this.privNextBufferStartTime}),this.privNextBufferReadyBytes=0,this.privNextBufferToWrite=void 0)}}close(){0===this.privNextBufferReadyBytes||this.isClosed||super.writeStreamChunk({buffer:this.privNextBufferToWrite.slice(0,this.privNextBufferReadyBytes),isEnd:!1,timeReceived:this.privNextBufferStartTime}),super.close()}}class we{}we.workerTimers=null,we.clearTimeout=e=>we.timers().clearTimeout(e),we.setTimeout=(e,t)=>we.timers().setTimeout(e,t),we.load=e=>{const t=new Map([[0,()=>{}]]),n=new Map,r=new Worker(e);r.addEventListener("message",(({data:e})=>{if(we.isCallNotification(e)){const{params:{timerId:r}}=e,o=t.get(r);if("number"==typeof o){const e=n.get(o);if(void 0===e||e!==r)throw new Error("The timer is in an undefined state.")}else{if(void 0===o)throw new Error("The timer is in an undefined state.");o(),t.delete(r)}}else{if(!we.isClearResponse(e)){const{error:{message:t}}=e;throw new Error(t)}{const{id:r}=e,o=n.get(r);if(void 0===o)throw new Error("The timer is in an undefined state.");n.delete(r),t.delete(o)}}}));return{clearTimeout:e=>{const o=Math.random();n.set(o,e),t.set(e,o),r.postMessage({id:o,method:"clear",params:{timerId:e}})},setTimeout:(e,n)=>{const o=Math.random();return t.set(o,e),r.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:o}}),o}}},we.loadWorkerTimers=()=>()=>{if(null!==we.workerTimers)return we.workerTimers;const e=new Blob(['!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return d}));const r=new Map,o=new Map,i=e=>{const t=r.get(e);if(void 0===t)throw new Error(\'There is no interval scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),r.delete(e)},u=e=>{const t=o.get(e);if(void 0===t)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),o.delete(e)},f=(e,t)=>{let n,r;if("performance"in self){const o=performance.now();n=o,r=e-Math.max(0,o-t)}else n=Date.now(),r=e;return{expected:n+r,remainingDelay:r}},c=(e,t,n,r)=>{const o="performance"in self?performance.now():Date.now();o>n?postMessage({id:null,method:"call",params:{timerId:t}}):e.set(t,setTimeout(c,n-o,e,t,n))},a=(e,t,n)=>{const{expected:o,remainingDelay:i}=f(e,n);r.set(t,setTimeout(c,i,r,t,o))},d=(e,t,n)=>{const{expected:r,remainingDelay:i}=f(e,n);o.set(t,setTimeout(c,i,o,t,r))}},function(e,t,n){"use strict";n.r(t);var r=n(2);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(3);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(4);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o);var f=n(5);for(var o in f)"default"!==o&&function(e){n.d(t,e,(function(){return f[e]}))}(o);var c=n(6);for(var o in c)"default"!==o&&function(e){n.d(t,e,(function(){return c[e]}))}(o);var a=n(7);for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);var d=n(8);for(var o in d)"default"!==o&&function(e){n.d(t,e,(function(){return d[e]}))}(o);var s=n(9);for(var o in s)"default"!==o&&function(e){n.d(t,e,(function(){return s[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(11);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(12);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(13);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);var u=n(10);for(var i in u)"default"!==i&&function(e){n.d(t,e,(function(){return u[e]}))}(i);addEventListener("message",({data:e})=>{try{if("clear"===e.method){const{id:t,params:{timerId:n}}=e;Object(r.b)(n),postMessage({error:null,id:t})}else{if("set"!==e.method)throw new Error(\'The given method "\'.concat(e.method,\'" is not supported\'));{const{params:{delay:t,now:n,timerId:o}}=e;Object(r.d)(t,o,n)}}}catch(t){postMessage({error:{message:t.message},id:e.id,result:null})}})}]);'],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return we.workerTimers=we.load(t),we.workerTimers.setTimeout((()=>URL.revokeObjectURL(t)),0),we.workerTimers},we.timers=we.loadWorkerTimers(),we.isCallNotification=e=>void 0!==e.method&&"call"===e.method,we.isClearResponse=e=>null===e.error&&"number"==typeof e.id;class xe extends O{constructor(e,t,n){super(e,t),this.privSignature=n}}class Se extends xe{constructor(e){super("OCSPMemoryCacheHitEvent",M.Debug,e)}}class Me extends xe{constructor(e){super("OCSPCacheMissEvent",M.Debug,e)}}class _e extends xe{constructor(e){super("OCSPDiskCacheHitEvent",M.Debug,e)}}class Ee extends xe{constructor(e){super("OCSPCacheUpdateNeededEvent",M.Debug,e)}}class Ae extends xe{constructor(e){super("OCSPMemoryCacheStoreEvent",M.Debug,e)}}class Ce extends xe{constructor(e){super("OCSPDiskCacheStoreEvent",M.Debug,e)}}class ke extends xe{constructor(e){super("OCSPCacheUpdateCompleteEvent",M.Debug,e)}}class Te extends xe{constructor(){super("OCSPStapleReceivedEvent",M.Debug,"")}}class Ie extends xe{constructor(e,t){super("OCSPCacheEntryExpiredEvent",M.Debug,e),this.privExpireTime=t}}class Oe extends xe{constructor(e,t,n){super("OCSPCacheEntryNeedsRefreshEvent",M.Debug,e),this.privExpireTime=n,this.privStartTime=t}}class Re extends xe{constructor(e,t,n){super("OCSPCacheHitEvent",M.Debug,e),this.privExpireTime=n,this.privExpireTimeString=new Date(n).toLocaleDateString(),this.privStartTime=t,this.privStartTimeString=new Date(t).toLocaleTimeString()}}class Pe extends xe{constructor(e,t){super("OCSPVerificationFailedEvent",M.Debug,e),this.privError=t}}class Ne extends xe{constructor(e,t){super("OCSPCacheFetchErrorEvent",M.Debug,e),this.privError=t}}class Le extends xe{constructor(e){super("OCSPResponseRetrievedEvent",M.Debug,e)}}class Be extends xe{constructor(e,t){super("OCSPCacheUpdateErrorEvent",M.Debug,e),this.privError=t}}class De extends O{constructor(e){super("BackgroundEvent",M.Error),this.privError=e}get error(){return this.privError}}var je={};e(je,"MicAudioSource",(()=>rr),(e=>rr=e));class Fe{}Fe.AuthKey="Ocp-Apim-Subscription-Key",Fe.ConnectionId="X-ConnectionId",Fe.ContentType="Content-Type",Fe.CustomCommandsAppId="X-CommandsAppId",Fe.Path="Path",Fe.RequestId="X-RequestId",Fe.RequestStreamId="X-StreamId",Fe.RequestTimestamp="X-Timestamp";class ze{constructor(e,t){this.privHeaderName=e,this.privToken=t}get headerName(){return this.privHeaderName}get token(){return this.privToken}}class Ue{constructor(e){if(this.fetch=e=>Promise.resolve(this.privAuthInfo),this.fetchOnExpiry=e=>Promise.resolve(this.privAuthInfo),!e)throw new Q("subscriptionKey");this.privAuthInfo=new ze(Fe.AuthKey,e)}}const He="Authorization";class Ge{constructor(e,t){if(this.fetch=e=>this.privFetchCallback(e).then((e=>new ze(He,Ge.privTokenPrefix+e))),this.fetchOnExpiry=e=>this.privFetchOnExpiryCallback(e).then((e=>new ze(He,Ge.privTokenPrefix+e))),!e)throw new Q("fetchCallback");if(!t)throw new Q("fetchOnExpiryCallback");this.privFetchCallback=e,this.privFetchOnExpiryCallback=t}}Ge.privTokenPrefix="bearer ";var We,Ve,qe,Ke,$e,Je,Xe={};e(Xe,"ServiceRecognizerBase",(()=>ct),(e=>ct=e)),(Ve=We||(We={}))[Ve.Error=0]="Error",Ve[Ve.EndOfStream=1]="EndOfStream",(Ke=qe||(qe={}))[Ke.NoError=0]="NoError",Ke[Ke.AuthenticationFailure=1]="AuthenticationFailure",Ke[Ke.BadRequestParameters=2]="BadRequestParameters",Ke[Ke.TooManyRequests=3]="TooManyRequests",Ke[Ke.ConnectionFailure=4]="ConnectionFailure",Ke[Ke.ServiceTimeout=5]="ServiceTimeout",Ke[Ke.ServiceError=6]="ServiceError",Ke[Ke.RuntimeError=7]="RuntimeError",Ke[Ke.Forbidden=8]="Forbidden",(Je=$e||($e={}))[Je.SpeechServiceConnection_Key=0]="SpeechServiceConnection_Key",Je[Je.SpeechServiceConnection_Endpoint=1]="SpeechServiceConnection_Endpoint",Je[Je.SpeechServiceConnection_Region=2]="SpeechServiceConnection_Region",Je[Je.SpeechServiceAuthorization_Token=3]="SpeechServiceAuthorization_Token",Je[Je.SpeechServiceAuthorization_Type=4]="SpeechServiceAuthorization_Type",Je[Je.SpeechServiceConnection_EndpointId=5]="SpeechServiceConnection_EndpointId",Je[Je.SpeechServiceConnection_TranslationToLanguages=6]="SpeechServiceConnection_TranslationToLanguages",Je[Je.SpeechServiceConnection_TranslationVoice=7]="SpeechServiceConnection_TranslationVoice",Je[Je.SpeechServiceConnection_TranslationFeatures=8]="SpeechServiceConnection_TranslationFeatures",Je[Je.SpeechServiceConnection_IntentRegion=9]="SpeechServiceConnection_IntentRegion",Je[Je.SpeechServiceConnection_ProxyHostName=10]="SpeechServiceConnection_ProxyHostName",Je[Je.SpeechServiceConnection_ProxyPort=11]="SpeechServiceConnection_ProxyPort",Je[Je.SpeechServiceConnection_ProxyUserName=12]="SpeechServiceConnection_ProxyUserName",Je[Je.SpeechServiceConnection_ProxyPassword=13]="SpeechServiceConnection_ProxyPassword",Je[Je.SpeechServiceConnection_RecoMode=14]="SpeechServiceConnection_RecoMode",Je[Je.SpeechServiceConnection_RecoLanguage=15]="SpeechServiceConnection_RecoLanguage",Je[Je.Speech_SessionId=16]="Speech_SessionId",Je[Je.SpeechServiceConnection_SynthLanguage=17]="SpeechServiceConnection_SynthLanguage",Je[Je.SpeechServiceConnection_SynthVoice=18]="SpeechServiceConnection_SynthVoice",Je[Je.SpeechServiceConnection_SynthOutputFormat=19]="SpeechServiceConnection_SynthOutputFormat",Je[Je.SpeechServiceConnection_AutoDetectSourceLanguages=20]="SpeechServiceConnection_AutoDetectSourceLanguages",Je[Je.SpeechServiceResponse_RequestDetailedResultTrueFalse=21]="SpeechServiceResponse_RequestDetailedResultTrueFalse",Je[Je.SpeechServiceResponse_RequestProfanityFilterTrueFalse=22]="SpeechServiceResponse_RequestProfanityFilterTrueFalse",Je[Je.SpeechServiceResponse_JsonResult=23]="SpeechServiceResponse_JsonResult",Je[Je.SpeechServiceResponse_JsonErrorDetails=24]="SpeechServiceResponse_JsonErrorDetails",Je[Je.CancellationDetails_Reason=25]="CancellationDetails_Reason",Je[Je.CancellationDetails_ReasonText=26]="CancellationDetails_ReasonText",Je[Je.CancellationDetails_ReasonDetailedText=27]="CancellationDetails_ReasonDetailedText",Je[Je.LanguageUnderstandingServiceResponse_JsonResult=28]="LanguageUnderstandingServiceResponse_JsonResult",Je[Je.SpeechServiceConnection_Url=29]="SpeechServiceConnection_Url",Je[Je.SpeechServiceConnection_InitialSilenceTimeoutMs=30]="SpeechServiceConnection_InitialSilenceTimeoutMs",Je[Je.SpeechServiceConnection_EndSilenceTimeoutMs=31]="SpeechServiceConnection_EndSilenceTimeoutMs",Je[Je.SpeechServiceConnection_EnableAudioLogging=32]="SpeechServiceConnection_EnableAudioLogging",Je[Je.SpeechServiceResponse_ProfanityOption=33]="SpeechServiceResponse_ProfanityOption",Je[Je.SpeechServiceResponse_PostProcessingOption=34]="SpeechServiceResponse_PostProcessingOption",Je[Je.SpeechServiceResponse_RequestWordLevelTimestamps=35]="SpeechServiceResponse_RequestWordLevelTimestamps",Je[Je.SpeechServiceResponse_StablePartialResultThreshold=36]="SpeechServiceResponse_StablePartialResultThreshold",Je[Je.SpeechServiceResponse_OutputFormatOption=37]="SpeechServiceResponse_OutputFormatOption",Je[Je.SpeechServiceResponse_TranslationRequestStablePartialResult=38]="SpeechServiceResponse_TranslationRequestStablePartialResult",Je[Je.Conversation_ApplicationId=39]="Conversation_ApplicationId",Je[Je.Conversation_DialogType=40]="Conversation_DialogType",Je[Je.Conversation_Initial_Silence_Timeout=41]="Conversation_Initial_Silence_Timeout",Je[Je.Conversation_From_Id=42]="Conversation_From_Id",Je[Je.Conversation_Conversation_Id=43]="Conversation_Conversation_Id",Je[Je.Conversation_Custom_Voice_Deployment_Ids=44]="Conversation_Custom_Voice_Deployment_Ids",Je[Je.Conversation_Speech_Activity_Template=45]="Conversation_Speech_Activity_Template",Je[Je.Conversation_Request_Bot_Status_Messages=46]="Conversation_Request_Bot_Status_Messages",Je[Je.Conversation_Agent_Connection_Id=47]="Conversation_Agent_Connection_Id",Je[Je.SpeechServiceConnection_Host=48]="SpeechServiceConnection_Host",Je[Je.ConversationTranslator_Host=49]="ConversationTranslator_Host",Je[Je.ConversationTranslator_Name=50]="ConversationTranslator_Name",Je[Je.ConversationTranslator_CorrelationId=51]="ConversationTranslator_CorrelationId",Je[Je.ConversationTranslator_Token=52]="ConversationTranslator_Token",Je[Je.PronunciationAssessment_ReferenceText=53]="PronunciationAssessment_ReferenceText",Je[Je.PronunciationAssessment_GradingSystem=54]="PronunciationAssessment_GradingSystem",Je[Je.PronunciationAssessment_Granularity=55]="PronunciationAssessment_Granularity",Je[Je.PronunciationAssessment_EnableMiscue=56]="PronunciationAssessment_EnableMiscue",Je[Je.PronunciationAssessment_Json=57]="PronunciationAssessment_Json",Je[Je.PronunciationAssessment_Params=58]="PronunciationAssessment_Params",Je[Je.SpeakerRecognition_Api_Version=59]="SpeakerRecognition_Api_Version";class Qe{constructor(e){this.privSessionId=e}get sessionId(){return this.privSessionId}}class Ye extends Qe{constructor(e,t){super(t),this.privOffset=e}get offset(){return this.privOffset}}class Ze extends ee{constructor(e,t,n,r,o,i,a,s){if(!t)throw new Q("path");if(!n)throw new Q("requestId");const l={};if(l[Fe.Path]=t,l[Fe.RequestId]=n,l[Fe.RequestTimestamp]=(new Date).toISOString(),r&&(l[Fe.ContentType]=r),i&&(l[Fe.RequestStreamId]=i),a)for(const e in a)e&&(l[e]=a[e]);s?super(e,o,l,s):super(e,o,l),this.privPath=t,this.privRequestId=n,this.privContentType=r,this.privStreamId=i,this.privAdditionalHeaders=a}get path(){return this.privPath}get requestId(){return this.privRequestId}get contentType(){return this.privContentType}get streamId(){return this.privStreamId}get additionalHeaders(){return this.privAdditionalHeaders}}Ze.fromConnectionMessage=e=>{let t=null,n=null,r=null,o=null,i=null;const a={};if(e.headers)for(const s in e.headers)s&&(s.toLowerCase()===Fe.Path.toLowerCase()?t=e.headers[s]:s.toLowerCase()===Fe.RequestId.toLowerCase()?n=e.headers[s]:s.toLowerCase()===Fe.RequestTimestamp.toLowerCase()?o=e.headers[s]:s.toLowerCase()===Fe.ContentType.toLowerCase()?r=e.headers[s]:s.toLowerCase()===Fe.RequestStreamId.toLowerCase()?i=e.headers[s]:a[s]=e.headers[s]);return new Ze(e.messageType,t,n,r,e.body,i,a,e.id)};var et,tt,nt,rt,ot,it,at,st,lt=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class ct{constructor(e,t,n,r,o){if(this.privSetTimeout=setTimeout,this.privIsLiveAudio=!1,this.recognizeOverride=void 0,this.disconnectOverride=void 0,this.receiveMessageOverride=void 0,this.sendSpeechContext=e=>{const t=this.speechContext.toJSON();if(this.privRequestSession.onSpeechContext(),t)return e.send(new Ze(E.Text,"speech.context",this.privRequestSession.requestId,"application/json",t))},this.sendPrePayloadJSONOverride=void 0,this.postConnectImplOverride=void 0,this.configConnectionOverride=void 0,this.sendSpeechServiceConfig=(e,t,n)=>{if(!0!==ct.telemetryDataEnabled){const e={context:{system:JSON.parse(n).context.system}};n=JSON.stringify(e)}if("true"===this.privRecognizerConfig.parameters.getProperty("TranscriptionService_SingleChannel","false").toLowerCase()){const e=JSON.parse(n);e.context.DisableReferenceChannel="True",e.context.MicSpec="1_0_0",n=JSON.stringify(e)}if(n)return e.send(new Ze(E.Text,"speech.config",t.requestId,"application/json",n))},!e)throw new Q("authentication");if(!t)throw new Q("connectionFactory");if(!n)throw new Q("audioSource");if(!r)throw new Q("recognizerConfig");this.privMustReportEndOfStream=!1,this.privAuthentication=e,this.privConnectionFactory=t,this.privAudioSource=n,this.privRecognizerConfig=r,this.privIsDisposed=!1,this.privRecognizer=o,this.privRequestSession=new(0,Vt.RequestSession)(this.privAudioSource.id()),this.privConnectionEvents=new ne,this.privServiceEvents=new ne,this.privDynamicGrammar=new cn,this.privSpeechContext=new ln(this.privDynamicGrammar),this.privAgentConfig=new Cn,"undefined"!=typeof Blob&&"undefined"!=typeof Worker&&(this.privSetTimeout=we.setTimeout),this.connectionEvents.attach((e=>lt(this,void 0,void 0,(function*(){if("ConnectionClosedEvent"===e.name){const t=e;(1003===t.statusCode||1007===t.statusCode||1002===t.statusCode||4e3===t.statusCode||this.privRequestSession.numConnectionAttempts>this.privRecognizerConfig.maxRetryCount)&&(yield this.cancelRecognitionLocal(We.Error,1007===t.statusCode?qe.BadRequestParameters:qe.ConnectionFailure,t.reason+" websocket error code: "+t.statusCode))}}))))}get audioSource(){return this.privAudioSource}get speechContext(){return this.privSpeechContext}get dynamicGrammar(){return this.privDynamicGrammar}get agentConfig(){return this.privAgentConfig}set conversationTranslatorToken(e){this.privRecognizerConfig.parameters.setProperty($e.ConversationTranslator_Token,e)}set authentication(e){this.privAuthentication=this.authentication}isDisposed(){return this.privIsDisposed}dispose(e){return lt(this,void 0,void 0,(function*(){if(this.privIsDisposed=!0,this.privConnectionConfigurationPromise)try{const t=yield this.privConnectionConfigurationPromise;yield t.dispose(e)}catch(e){return}}))}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}get recognitionMode(){return this.privRecognizerConfig.recognitionMode}recognize(e,t,n){return lt(this,void 0,void 0,(function*(){if(void 0!==this.recognizeOverride)return this.recognizeOverride(e,t,n);this.privConnectionConfigurationPromise=null,this.privRecognizerConfig.recognitionMode=e,this.privSuccessCallback=t,this.privErrorCallback=n,this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privAudioSource.events);const r=this.connectImpl();let o;try{const e=yield this.audioSource.attach(this.privRequestSession.audioNodeId),t=yield this.audioSource.format,n=yield this.audioSource.deviceInfo;this.privIsLiveAudio=n.type&&n.type===at.Microphones,o=new Hr(e,t.avgBytesPerSec),yield this.privRequestSession.onAudioSourceAttachCompleted(o,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:n}}catch(e){throw yield this.privRequestSession.onStopRecognizing(),e}try{yield r}catch(e){return void(yield this.cancelRecognitionLocal(We.Error,qe.ConnectionFailure,e))}const i=new Qe(this.privRequestSession.sessionId);this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,i);this.receiveMessage();this.sendAudio(o).catch((e=>lt(this,void 0,void 0,(function*(){yield this.cancelRecognitionLocal(We.Error,qe.RuntimeError,e)}))))}))}stopRecognizing(){return lt(this,void 0,void 0,(function*(){if(this.privRequestSession.isRecognizing)try{yield this.audioSource.turnOff(),yield this.sendFinalAudio(),yield this.privRequestSession.onStopRecognizing(),yield this.privRequestSession.turnCompletionPromise}finally{yield this.privRequestSession.dispose()}}))}connect(){return lt(this,void 0,void 0,(function*(){return yield this.connectImpl(),Promise.resolve()}))}connectAsync(e,t){this.connectImpl().then((n=>{try{e&&e()}catch(e){t&&t(e)}}),(e=>{try{t&&t(e)}catch(e){}}))}disconnect(){return lt(this,void 0,void 0,(function*(){yield this.cancelRecognitionLocal(We.Error,qe.NoError,"Disconnecting"),void 0!==this.disconnectOverride&&(yield this.disconnectOverride());try{yield(yield this.privConnectionPromise).dispose()}catch(e){}this.privConnectionPromise=null}))}sendMessage(e){}sendNetworkMessage(e,t){return lt(this,void 0,void 0,(function*(){const n="string"==typeof t?E.Text:E.Binary,r="string"==typeof t?"application/json":"";return(yield this.fetchConnection()).send(new Ze(n,e,this.privRequestSession.requestId,r,t))}))}set activityTemplate(e){this.privActivityTemplate=e}get activityTemplate(){return this.privActivityTemplate}sendTelemetryData(){return lt(this,void 0,void 0,(function*(){const e=this.privRequestSession.getTelemetry();if(!0!==ct.telemetryDataEnabled||this.privIsDisposed||null===e)return;if(ct.telemetryData)try{ct.telemetryData(e)}catch(e){}const t=yield this.fetchConnection();yield t.send(new Ze(E.Text,"telemetry",this.privRequestSession.requestId,"application/json",e))}))}cancelRecognitionLocal(e,t,n){return lt(this,void 0,void 0,(function*(){this.privRequestSession.isRecognizing&&(yield this.privRequestSession.onStopRecognizing(),this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,e,t,n))}))}receiveMessage(){return lt(this,void 0,void 0,(function*(){try{if(this.privIsDisposed)return;let e=yield this.fetchConnection();const t=yield e.read();if(void 0!==this.receiveMessageOverride)return this.receiveMessageOverride();if(!t)return this.privRequestSession.isRecognizing?this.receiveMessage():void 0;this.privServiceHasSentMessage=!0;const n=Ze.fromConnectionMessage(t);if(n.requestId.toLowerCase()===this.privRequestSession.requestId.toLowerCase())switch(n.path.toLowerCase()){case"turn.start":this.privMustReportEndOfStream=!0,this.privRequestSession.onServiceTurnStartResponse();break;case"speech.startdetected":const t=Pt.fromJSON(n.textBody),r=new Ye(t.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechStartDetected&&this.privRecognizer.speechStartDetected(this.privRecognizer,r);break;case"speech.enddetected":let o;o=n.textBody.length>0?n.textBody:"{ Offset: 0 }";const i=Pt.fromJSON(o);this.privRecognizerConfig.isContinuousRecognition&&this.privRequestSession.onServiceRecognized(i.Offset+this.privRequestSession.currentTurnAudioOffset);const a=new Ye(i.Offset+this.privRequestSession.currentTurnAudioOffset,this.privRequestSession.sessionId);this.privRecognizer.speechEndDetected&&this.privRecognizer.speechEndDetected(this.privRecognizer,a);break;case"turn.end":yield this.sendTelemetryData(),this.privRequestSession.isSpeechEnded&&this.privMustReportEndOfStream&&(this.privMustReportEndOfStream=!1,yield this.cancelRecognitionLocal(We.EndOfStream,qe.NoError,void 0));const s=new Qe(this.privRequestSession.sessionId);if(yield this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition),!this.privRecognizerConfig.isContinuousRecognition||this.privRequestSession.isSpeechEnded||!this.privRequestSession.isRecognizing)return void(this.privRecognizer.sessionStopped&&this.privRecognizer.sessionStopped(this.privRecognizer,s));e=yield this.fetchConnection(),yield this.sendPrePayloadJSON(e);break;default:(yield this.processTypeSpecificMessages(n))||this.privServiceEvents&&this.serviceEvents.onEvent(new H(n.path.toLowerCase(),n.textBody))}return this.receiveMessage()}catch(e){return null}}))}sendPrePayloadJSON(e){return lt(this,void 0,void 0,(function*(){if(void 0!==this.sendPrePayloadJSONOverride)return this.sendPrePayloadJSONOverride(e);yield this.sendSpeechContext(e),yield this.sendWaveHeader(e)}))}sendWaveHeader(e){return lt(this,void 0,void 0,(function*(){const t=yield this.audioSource.format;return e.send(new Ze(E.Binary,"audio",this.privRequestSession.requestId,"audio/x-wav",t.header))}))}connectImpl(){return this.privConnectionPromise?this.privConnectionPromise.then((e=>e.state()===C.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=null,this.privServiceHasSentMessage=!1,this.connectImpl()):this.privConnectionPromise),(e=>(this.privConnectionId=null,this.privConnectionPromise=null,this.privServiceHasSentMessage=!1,this.connectImpl()))):(this.privConnectionPromise=this.retryableConnect(),this.privConnectionPromise.catch((()=>{})),void 0!==this.postConnectImplOverride?this.postConnectImplOverride(this.privConnectionPromise):this.privConnectionPromise)}fetchConnection(){return lt(this,void 0,void 0,(function*(){return this.privConnectionConfigurationPromise?this.privConnectionConfigurationPromise.then((e=>e.state()===C.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=null,this.privServiceHasSentMessage=!1,this.fetchConnection()):this.privConnectionConfigurationPromise),(e=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=null,this.privServiceHasSentMessage=!1,this.fetchConnection()))):(this.privConnectionConfigurationPromise=this.configureConnection(),yield this.privConnectionConfigurationPromise)}))}sendAudio(e){return lt(this,void 0,void 0,(function*(){const t=yield this.audioSource.format;let n=Date.now();const r=this.privRecognizerConfig.parameters.getProperty("SPEECH-TransmitLengthBeforThrottleMs","5000"),o=t.avgBytesPerSec/1e3*parseInt(r,10),i=this.privRequestSession.recogNumber,a=()=>lt(this,void 0,void 0,(function*(){if(!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===i){const r=yield this.fetchConnection(),s=yield e.read();if(this.privRequestSession.isSpeechEnded)return;let l,c;if(!s||s.isEnd?(l=null,c=0):(l=s.buffer,this.privRequestSession.onAudioSent(l.byteLength),c=o>=this.privRequestSession.bytesSent?0:Math.max(0,n-Date.now())),0!==c&&(yield this.delay(c)),null!==l&&(n=Date.now()+1e3*l.byteLength/(2*t.avgBytesPerSec)),!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===i){if(r.send(new Ze(E.Binary,"audio",this.privRequestSession.requestId,null,l)).catch((()=>{this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition).catch((()=>{}))})),!(null==s?void 0:s.isEnd))return a();this.privIsLiveAudio||this.privRequestSession.onSpeechEnded()}}}));return a()}))}retryableConnect(){return lt(this,void 0,void 0,(function*(){let e=!1;this.privAuthFetchEventId=S();const t=this.privRequestSession.sessionId;this.privConnectionId=void 0!==t?t:S(),this.privRequestSession.onPreConnectionStart(this.privAuthFetchEventId,this.privConnectionId);let n=0,r="";for(;this.privRequestSession.numConnectionAttempts<=this.privRecognizerConfig.maxRetryCount;){const t=e?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId),o=yield t;yield this.privRequestSession.onAuthCompleted(!1);const i=this.privConnectionFactory.create(this.privRecognizerConfig,o,this.privConnectionId);this.privRequestSession.listenForServiceTelemetry(i.events),i.events.attach((e=>{this.connectionEvents.onEvent(e)}));const a=yield i.open();if(200===a.statusCode)return yield this.privRequestSession.onConnectionEstablishCompleted(a.statusCode),Promise.resolve(i);1006===a.statusCode&&(e=!0),n=a.statusCode,r=a.reason,this.privRequestSession.onRetryConnection()}return yield this.privRequestSession.onConnectionEstablishCompleted(n,r),Promise.reject(`Unable to contact server. StatusCode: ${n}, ${this.privRecognizerConfig.parameters.getProperty($e.SpeechServiceConnection_Endpoint)} Reason: ${r}`)}))}delay(e){return new Promise(((t,n)=>{this.privSetTimeout(t,e)}))}writeBufferToConsole(e){let t="Buffer Size: ";if(null===e)t+="null";else{const n=new Uint8Array(e);t+=e.byteLength+"\r\n";for(let r=0;r<e.byteLength;r++)t+=n[r].toString(16).padStart(2,"0")+" "}console.info(t)}sendFinalAudio(){return lt(this,void 0,void 0,(function*(){const e=yield this.fetchConnection();yield e.send(new Ze(E.Binary,"audio",this.privRequestSession.requestId,null,null))}))}configureConnection(){return lt(this,void 0,void 0,(function*(){const e=yield this.connectImpl();return void 0!==this.configConnectionOverride?this.configConnectionOverride(e):(yield this.sendSpeechServiceConfig(e,this.privRequestSession,this.privRecognizerConfig.SpeechServiceConfig.serialize()),yield this.sendPrePayloadJSON(e),e)}))}}ct.telemetryDataEnabled=!0,(tt=et||(et={}))[tt.Interactive=0]="Interactive",tt[tt.Conversation=1]="Conversation",tt[tt.Dictation=2]="Dictation",(rt=nt||(nt={}))[rt.Simple=0]="Simple",rt[rt.Detailed=1]="Detailed";class ut{constructor(e,t){this.privRecognitionMode=et.Interactive,this.privSpeechServiceConfig=e||new dt(new ft(null)),this.privParameters=t,this.privMaxRetryCount=parseInt(t.getProperty("SPEECH-Error-MaxRetryCount","4"),10)}get parameters(){return this.privParameters}get recognitionMode(){return this.privRecognitionMode}set recognitionMode(e){this.privRecognitionMode=e,this.privRecognitionActivityTimeout=e===et.Interactive?8e3:25e3,this.privSpeechServiceConfig.Recognition=et[e]}get SpeechServiceConfig(){return this.privSpeechServiceConfig}get recognitionActivityTimeout(){return this.privRecognitionActivityTimeout}get isContinuousRecognition(){return this.privRecognitionMode!==et.Interactive}get autoDetectSourceLanguages(){return this.parameters.getProperty($e.SpeechServiceConnection_AutoDetectSourceLanguages,void 0)}get maxRetryCount(){return this.privMaxRetryCount}}class dt{constructor(e){this.serialize=()=>JSON.stringify(this,((e,t)=>{if(t&&"object"==typeof t){const e={};for(const n in t)Object.hasOwnProperty.call(t,n)&&(e[n&&n.charAt(0).toLowerCase()+n.substring(1)]=t[n]);return e}return t})),this.context=e}get Context(){return this.context}get Recognition(){return this.recognition}set Recognition(e){this.recognition=e.toLowerCase()}}class ft{constructor(e){this.system=new ht,this.os=e}}class ht{constructor(){this.name="SpeechSDK",this.version="1.20.0",this.build="JavaScript",this.lang="JavaScript"}}class pt{constructor(e,t,n){this.platform=e,this.name=t,this.version=n}}(it=ot||(ot={})).Bluetooth="Bluetooth",it.Wired="Wired",it.WiFi="WiFi",it.Cellular="Cellular",it.InBuilt="InBuilt",it.Unknown="Unknown",(st=at||(at={})).Phone="Phone",st.Speaker="Speaker",st.Car="Car",st.Headset="Headset",st.Thermostat="Thermostat",st.Microphones="Microphones",st.Deskphone="Deskphone",st.RemoteControl="RemoteControl",st.Unknown="Unknown",st.File="File",st.Stream="Stream";class mt{constructor(){this.toConnectionMessage=e=>{const t=new oe;try{if(e.messageType===E.Text){const n=e.textContent;let r={},o=null;if(n){const e=n.split("\r\n\r\n");e&&e.length>0&&(r=this.parseHeaders(e[0]),e.length>1&&(o=e[1]))}t.resolve(new ee(e.messageType,o,r,e.id))}else if(e.messageType===E.Binary){const n=e.binaryContent;let r={},o=null;if(!n||n.byteLength<2)throw new Error("Invalid binary message format. Header length missing.");const i=new DataView(n),a=i.getInt16(0);if(n.byteLength<a+2)throw new Error("Invalid binary message format. Header content missing.");let s="";for(let e=0;e<a;e++)s+=String.fromCharCode(i.getInt8(e+2));r=this.parseHeaders(s),n.byteLength>a+2&&(o=n.slice(2+a)),t.resolve(new ee(e.messageType,o,r,e.id))}}catch(e){t.reject(`Error formatting the message. Error: ${e}`)}return t.promise},this.fromConnectionMessage=e=>{const t=new oe;try{if(e.messageType===E.Text){const n=`${this.makeHeaders(e)}\r\n${e.textBody?e.textBody:""}`;t.resolve(new fe(E.Text,n,e.id))}else if(e.messageType===E.Binary){const n=this.makeHeaders(e),r=e.binaryBody,o=this.stringToArrayBuffer(n),i=new Int8Array(o),a=i.byteLength,s=new Int8Array(2+a+(r?r.byteLength:0));if(s[0]=a>>8&255,s[1]=255&a,s.set(i,2),r){const e=new Int8Array(r);s.set(e,2+a)}const l=s.buffer;t.resolve(new fe(E.Binary,l,e.id))}}catch(e){t.reject(`Error formatting the message. ${e}`)}return t.promise},this.makeHeaders=e=>{let t="";if(e.headers)for(const n in e.headers)n&&(t+=`${n}: ${e.headers[n]}\r\n`);return t},this.parseHeaders=e=>{const t={};if(e){const n=e.match(/[^\r\n]+/g);if(t)for(const e of n)if(e){const n=e.indexOf(":"),r=n>0?e.substr(0,n).trim().toLowerCase():e,o=n>0&&e.length>n+1?e.substr(n+1).trim():"";t[r]=o}}return t},this.stringToArrayBuffer=e=>{const t=new ArrayBuffer(e.length),n=new DataView(t);for(let t=0;t<e.length;t++)n.setUint8(t,e.charCodeAt(t));return t}}}var gt,vt,bt,yt,wt,xt,St,Mt;(vt=gt||(gt={}))[vt.Simple=0]="Simple",vt[vt.Detailed=1]="Detailed";class _t{}_t.BotId="botid",_t.CustomSpeechDeploymentId="cid",_t.CustomVoiceDeploymentId="deploymentId",_t.EnableAudioLogging="storeAudio",_t.EnableLanguageId="lidEnabled",_t.EnableWordLevelTimestamps="wordLevelTimestamps",_t.EndSilenceTimeoutMs="endSilenceTimeoutMs",_t.Format="format",_t.InitialSilenceTimeoutMs="initialSilenceTimeoutMs",_t.Language="language",_t.Profanity="profanity",_t.RequestBotStatusMessages="enableBotMessageStatus",_t.StableIntermediateThreshold="stableIntermediateThreshold",_t.StableTranslation="stableTranslation",_t.TestHooks="testhooks";class Et{static getHostSuffix(e){if(e){if(e.toLowerCase().startsWith("china"))return".azure.cn";if(e.toLowerCase().startsWith("usgov"))return".azure.us"}return".microsoft.com"}setCommonUrlParams(e,t,n){this.setUrlParameter($e.SpeechServiceConnection_EnableAudioLogging,_t.EnableAudioLogging,e,t,n),this.setUrlParameter($e.SpeechServiceResponse_RequestWordLevelTimestamps,_t.EnableWordLevelTimestamps,e,t,n),this.setUrlParameter($e.SpeechServiceResponse_ProfanityOption,_t.Profanity,e,t,n),this.setUrlParameter($e.SpeechServiceConnection_InitialSilenceTimeoutMs,_t.InitialSilenceTimeoutMs,e,t,n),this.setUrlParameter($e.SpeechServiceConnection_EndSilenceTimeoutMs,_t.EndSilenceTimeoutMs,e,t,n),this.setUrlParameter($e.SpeechServiceResponse_StablePartialResultThreshold,_t.StableIntermediateThreshold,e,t,n);const r=JSON.parse(e.parameters.getProperty(er,"{}"));Object.keys(r).forEach(((e,n,o)=>{t[e]=r[e]}))}setUrlParameter(e,t,n,r,o){const i=n.parameters.getProperty(e,void 0);!i||o&&-1!==o.search(t)||(r[t]=i.toLocaleLowerCase())}}class At extends Et{constructor(){super(...arguments),this.interactiveRelativeUri="/speech/recognition/interactive/cognitiveservices/v1",this.conversationRelativeUri="/speech/recognition/conversation/cognitiveservices/v1",this.dictationRelativeUri="/speech/recognition/dictation/cognitiveservices/v1",this.create=(e,t,n)=>{let r=e.parameters.getProperty($e.SpeechServiceConnection_Endpoint,void 0);const o=e.parameters.getProperty($e.SpeechServiceConnection_Region,void 0),i=Et.getHostSuffix(o),a=e.parameters.getProperty($e.SpeechServiceConnection_Host,"wss://"+o+".stt.speech"+i),s={},l=e.parameters.getProperty($e.SpeechServiceConnection_EndpointId,void 0),c=e.parameters.getProperty($e.SpeechServiceConnection_RecoLanguage,void 0);if(l?r&&-1!==r.search(_t.CustomSpeechDeploymentId)||(s[_t.CustomSpeechDeploymentId]=l):c&&(r&&-1!==r.search(_t.Language)||(s[_t.Language]=c)),r&&-1!==r.search(_t.Format)||(s[_t.Format]=e.parameters.getProperty(Yn,gt[gt.Simple]).toLowerCase()),void 0!==e.autoDetectSourceLanguages&&(s[_t.EnableLanguageId]="true"),this.setCommonUrlParams(e,s,r),!r)switch(e.recognitionMode){case et.Conversation:r="true"===e.parameters.getProperty(tr,"false")?a+this.dictationRelativeUri:a+this.conversationRelativeUri;break;case et.Dictation:r=a+this.dictationRelativeUri;break;default:r=a+this.interactiveRelativeUri}const u={};void 0!==t.token&&""!==t.token&&(u[t.headerName]=t.token),u[Fe.ConnectionId]=n,e.parameters.setProperty($e.SpeechServiceConnection_Url,r);const d="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new(0,lr.WebsocketConnection)(r,s,u,new mt,Wr.fromRecognizerConfig(e),d,n)}}}class Ct{constructor(){this.synthesisUri="/cognitiveservices/websocket/v1",this.create=(e,t,n)=>{let r=e.parameters.getProperty($e.SpeechServiceConnection_Endpoint,void 0);const o=e.parameters.getProperty($e.SpeechServiceConnection_Region,void 0),i=Et.getHostSuffix(o),a=e.parameters.getProperty($e.SpeechServiceConnection_EndpointId,void 0),s=void 0===a?"tts":"voice",l=e.parameters.getProperty($e.SpeechServiceConnection_Host,"wss://"+o+"."+s+".speech"+i);r||(r=l+this.synthesisUri);const c={};void 0!==t.token&&""!==t.token&&(c[t.headerName]=t.token),c[Fe.ConnectionId]=n,void 0!==a&&(c[_t.CustomVoiceDeploymentId]=a),e.parameters.setProperty($e.SpeechServiceConnection_Url,r);const u="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new(0,lr.WebsocketConnection)(r,{},c,new mt,Wr.fromParameters(e.parameters),u,n)}}}(yt=bt||(bt={}))[yt.NoMatch=0]="NoMatch",yt[yt.Canceled=1]="Canceled",yt[yt.RecognizingSpeech=2]="RecognizingSpeech",yt[yt.RecognizedSpeech=3]="RecognizedSpeech",yt[yt.RecognizedKeyword=4]="RecognizedKeyword",yt[yt.RecognizingIntent=5]="RecognizingIntent",yt[yt.RecognizedIntent=6]="RecognizedIntent",yt[yt.TranslatingSpeech=7]="TranslatingSpeech",yt[yt.TranslatedSpeech=8]="TranslatedSpeech",yt[yt.SynthesizingAudio=9]="SynthesizingAudio",yt[yt.SynthesizingAudioCompleted=10]="SynthesizingAudioCompleted",yt[yt.SynthesizingAudioStarted=11]="SynthesizingAudioStarted",yt[yt.EnrollingVoiceProfile=12]="EnrollingVoiceProfile",yt[yt.EnrolledVoiceProfile=13]="EnrolledVoiceProfile",yt[yt.RecognizedSpeakers=14]="RecognizedSpeakers",yt[yt.RecognizedSpeaker=15]="RecognizedSpeaker",yt[yt.ResetVoiceProfile=16]="ResetVoiceProfile",yt[yt.DeletedVoiceProfile=17]="DeletedVoiceProfile",yt[yt.VoicesListRetrieved=18]="VoicesListRetrieved";class kt{static implTranslateRecognitionResult(e){let t=bt.Canceled;switch(e){case St.Success:t=bt.RecognizedSpeech;break;case St.NoMatch:case St.InitialSilenceTimeout:case St.BabbleTimeout:case St.EndOfDictation:t=bt.NoMatch;break;case St.Error:case St.BadRequest:case St.Forbidden:default:t=bt.Canceled}return t}static implTranslateCancelResult(e){let t=We.EndOfStream;switch(e){case St.Success:case St.EndOfDictation:case St.NoMatch:t=We.EndOfStream;break;case St.InitialSilenceTimeout:case St.BabbleTimeout:case St.Error:case St.BadRequest:case St.Forbidden:default:t=We.Error}return t}static implTranslateCancelErrorCode(e){let t=qe.NoError;switch(e){case St.Error:t=qe.ServiceError;break;case St.TooManyRequests:t=qe.TooManyRequests;break;case St.BadRequest:t=qe.BadRequestParameters;break;case St.Forbidden:t=qe.Forbidden;break;default:t=qe.NoError}return t}static implTranslateErrorDetails(e){let t="The speech service encountered an internal error and could not continue.";switch(e){case qe.Forbidden:t="The recognizer is using a free subscription that ran out of quota.";break;case qe.BadRequestParameters:t="Invalid parameter or unsupported audio format in the request.";break;case qe.TooManyRequests:t="The number of parallel requests exceeded the number of allowed concurrent transcriptions."}return t}}(xt=wt||(wt={}))[xt.Success=0]="Success",xt[xt.SynthesisEnd=1]="SynthesisEnd",xt[xt.Error=2]="Error",(Mt=St||(St={}))[Mt.Success=0]="Success",Mt[Mt.NoMatch=1]="NoMatch",Mt[Mt.InitialSilenceTimeout=2]="InitialSilenceTimeout",Mt[Mt.BabbleTimeout=3]="BabbleTimeout",Mt[Mt.Error=4]="Error",Mt[Mt.EndOfDictation=5]="EndOfDictation",Mt[Mt.TooManyRequests=6]="TooManyRequests",Mt[Mt.BadRequest=7]="BadRequest",Mt[Mt.Forbidden=8]="Forbidden";class Tt{static throwIfNullOrUndefined(e,t){if(null==e)throw new Error("throwIfNullOrUndefined:"+t)}static throwIfNull(e,t){if(null===e)throw new Error("throwIfNull:"+t)}static throwIfNullOrWhitespace(e,t){if(Tt.throwIfNullOrUndefined(e,t),(""+e).trim().length<1)throw new Error("throwIfNullOrWhitespace:"+t)}static throwIfDisposed(e){if(e)throw new Error("the object is already disposed")}static throwIfArrayEmptyOrWhitespace(e,t){if(Tt.throwIfNullOrUndefined(e,t),0===e.length)throw new Error("throwIfArrayEmptyOrWhitespace:"+t);for(const n of e)Tt.throwIfNullOrWhitespace(n,t)}static throwIfFileDoesNotExist(e,t){Tt.throwIfNullOrWhitespace(e,t)}static throwIfNotUndefined(e,t){if(void 0!==e)throw new Error("throwIfNotUndefined:"+t)}}class It{constructor(){this.privKeys=[],this.privValues=[]}getProperty(e,t){let n;n="string"==typeof e?e:$e[e];for(let e=0;e<this.privKeys.length;e++)if(this.privKeys[e]===n)return this.privValues[e];return t}setProperty(e,t){let n;n="string"==typeof e?e:$e[e];for(let e=0;e<this.privKeys.length;e++)if(this.privKeys[e]===n)return void(this.privValues[e]=t);this.privKeys.push(n),this.privValues.push(t)}clone(){const e=new It;for(let t=0;t<this.privKeys.length;t++)e.privKeys.push(this.privKeys[t]),e.privValues.push(this.privValues[t]);return e}mergeTo(e){this.privKeys.forEach((t=>{if(void 0===e.getProperty(t,void 0)){const n=this.getProperty(t);e.setProperty(t,n)}}))}get keys(){return this.privKeys}}class Ot{constructor(e,t,n,r,o,i,a,s,l,c){this.privResultId=e,this.privReason=t,this.privText=n,this.privDuration=r,this.privOffset=o,this.privLanguage=i,this.privLanguageDetectionConfidence=a,this.privErrorDetails=s,this.privJson=l,this.privProperties=c}get resultId(){return this.privResultId}get reason(){return this.privReason}get text(){return this.privText}get duration(){return this.privDuration}get offset(){return this.privOffset}get language(){return this.privLanguage}get languageDetectionConfidence(){return this.privLanguageDetectionConfidence}get errorDetails(){return this.privErrorDetails}get json(){return this.privJson}get properties(){return this.privProperties}}class Rt extends Ot{constructor(e,t,n,r,o,i,a,s,l,c,u){super(e,t,n,r,o,i,a,l,c,u),this.privSpeakerId=s}get speakerId(){return this.privSpeakerId}}class Pt{constructor(e){this.privSpeechStartDetected=JSON.parse(e)}static fromJSON(e){return new Pt(e)}get Offset(){return this.privSpeechStartDetected.Offset}}class Nt{constructor(e){this.privSpeechHypothesis=JSON.parse(e)}static fromJSON(e){return new Nt(e)}get Text(){return this.privSpeechHypothesis.Text}get Offset(){return this.privSpeechHypothesis.Offset}get Duration(){return this.privSpeechHypothesis.Duration}get Language(){return void 0===this.privSpeechHypothesis.PrimaryLanguage?void 0:this.privSpeechHypothesis.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privSpeechHypothesis.PrimaryLanguage?void 0:this.privSpeechHypothesis.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSpeechHypothesis.SpeakerId}}var Lt={};e(Lt,"SpeechServiceRecognizer",(()=>zt),(e=>zt=e));class Bt extends Ye{constructor(e,t,n){super(t,n),this.privResult=e}get result(){return this.privResult}}class Dt extends Ye{constructor(e,t,n,r,o){super(r,o),this.privReason=e,this.privErrorDetails=t,this.privErrorCode=n}get reason(){return this.privReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}}class jt extends Dt{}var Ft=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class zt extends Xe.ServiceRecognizerBase{constructor(e,t,n,r,o){if(super(e,t,n,r,o),this.privSpeechRecognizer=o,void 0!==r.autoDetectSourceLanguages){const e=r.autoDetectSourceLanguages.split(",");this.privSpeechContext.setSection("languageId",{languages:e,onSuccess:{action:"Recognize"},onUnknown:{action:"None"}}),this.privSpeechContext.setSection("phraseOutput",{interimResults:{resultType:"Auto"},phraseResults:{resultType:"Always"}})}}processTypeSpecificMessages(e){return Ft(this,void 0,void 0,(function*(){let t;const n=new It;n.setProperty($e.SpeechServiceResponse_JsonResult,e.textBody);let r=!1;switch(e.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":const o=Nt.fromJSON(e.textBody),i=o.Offset+this.privRequestSession.currentTurnAudioOffset;t=new Rt(this.privRequestSession.requestId,bt.RecognizingSpeech,o.Text,o.Duration,i,o.Language,o.LanguageDetectionConfidence,void 0,void 0,e.textBody,n),this.privRequestSession.onHypothesis(i);const a=new Bt(t,o.Duration,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognizing)try{this.privSpeechRecognizer.recognizing(this.privSpeechRecognizer,a)}catch(e){}r=!0;break;case"speech.phrase":const s=Ht.fromJSON(e.textBody),l=kt.implTranslateRecognitionResult(s.RecognitionStatus);if(this.privRequestSession.onPhraseRecognized(this.privRequestSession.currentTurnAudioOffset+s.Offset+s.Duration),bt.Canceled===l){const e=kt.implTranslateCancelResult(s.RecognitionStatus),t=kt.implTranslateCancelErrorCode(s.RecognitionStatus);yield this.cancelRecognitionLocal(e,t,kt.implTranslateErrorDetails(t))}else{if(!this.privRequestSession.isSpeechEnded||l!==bt.NoMatch||s.RecognitionStatus===St.InitialSilenceTimeout){if(this.privRecognizerConfig.parameters.getProperty(Yn)===gt[gt.Simple])t=new Rt(this.privRequestSession.requestId,l,s.DisplayText,s.Duration,s.Offset+this.privRequestSession.currentTurnAudioOffset,s.Language,s.LanguageDetectionConfidence,void 0,void 0,e.textBody,n);else{const r=Ut.fromJSON(e.textBody),o=r.Offset+this.privRequestSession.currentTurnAudioOffset,i=r.getJsonWithCorrectedOffsets(o);t=new Rt(this.privRequestSession.requestId,l,r.RecognitionStatus===St.Success?r.NBest[0].Display:void 0,r.Duration,o,r.Language,r.LanguageDetectionConfidence,void 0,void 0,i,n)}const r=new Bt(t,t.offset,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognized)try{this.privSpeechRecognizer.recognized(this.privSpeechRecognizer,r)}catch(e){}}if(this.privSuccessCallback){try{this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}r=!0}return r}))}cancelRecognition(e,t,n,r,o){const i=new It;if(i.setProperty(Zn,qe[r]),this.privSpeechRecognizer.canceled){const t=new jt(n,o,r,void 0,e);try{this.privSpeechRecognizer.canceled(this.privSpeechRecognizer,t)}catch(e){}}if(this.privSuccessCallback){const e=new Rt(t,bt.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,o,void 0,i);try{this.privSuccessCallback(e),this.privSuccessCallback=void 0}catch(e){}}}}class Ut{constructor(e){this.privDetailedSpeechPhrase=JSON.parse(e),this.privDetailedSpeechPhrase.RecognitionStatus=St[this.privDetailedSpeechPhrase.RecognitionStatus]}static fromJSON(e){return new Ut(e)}getJsonWithCorrectedOffsets(e){if(this.privDetailedSpeechPhrase.NBest){let t;for(const e of this.privDetailedSpeechPhrase.NBest)if(e.Words&&e.Words[0]){t=e.Words[0].Offset;break}if(t&&t<e){const n=e-t;for(const e of this.privDetailedSpeechPhrase.NBest)if(e.Words)for(const t of e.Words)t.Offset+=n}}return JSON.stringify(this.privDetailedSpeechPhrase)}get RecognitionStatus(){return this.privDetailedSpeechPhrase.RecognitionStatus}get NBest(){return this.privDetailedSpeechPhrase.NBest}get Duration(){return this.privDetailedSpeechPhrase.Duration}get Offset(){return this.privDetailedSpeechPhrase.Offset}get Language(){return void 0===this.privDetailedSpeechPhrase.PrimaryLanguage?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privDetailedSpeechPhrase.PrimaryLanguage?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Confidence}get Text(){return this.privDetailedSpeechPhrase.NBest&&this.privDetailedSpeechPhrase.NBest[0]?this.privDetailedSpeechPhrase.NBest[0].Display:this.privDetailedSpeechPhrase.DisplayText}get SpeakerId(){return this.privDetailedSpeechPhrase.SpeakerId}}class Ht{constructor(e){this.privSimpleSpeechPhrase=JSON.parse(e),this.privSimpleSpeechPhrase.RecognitionStatus=St[this.privSimpleSpeechPhrase.RecognitionStatus]}static fromJSON(e){return new Ht(e)}get RecognitionStatus(){return this.privSimpleSpeechPhrase.RecognitionStatus}get DisplayText(){return this.privSimpleSpeechPhrase.DisplayText}get Offset(){return this.privSimpleSpeechPhrase.Offset}get Duration(){return this.privSimpleSpeechPhrase.Duration}get Language(){return void 0===this.privSimpleSpeechPhrase.PrimaryLanguage?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privSimpleSpeechPhrase.PrimaryLanguage?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSimpleSpeechPhrase.SpeakerId}}var Gt,Wt,Vt={};e(Vt,"RequestSession",(()=>sn),(e=>sn=e));class qt extends O{constructor(e,t,n,r=M.Info){super(e,r),this.privRequestId=t,this.privSessionId=n}get requestId(){return this.privRequestId}get sessionId(){return this.privSessionId}}class Kt extends qt{constructor(e,t,n,r){super("RecognitionTriggeredEvent",e,t),this.privAudioSourceId=n,this.privAudioNodeId=r}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}}class $t extends qt{constructor(e,t,n,r){super("ListeningStartedEvent",e,t),this.privAudioSourceId=n,this.privAudioNodeId=r}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}}class Jt extends qt{constructor(e,t,n){super("ConnectingToServiceEvent",e,n),this.privAuthFetchEventid=t}get authFetchEventid(){return this.privAuthFetchEventid}}class Xt extends qt{constructor(e,t,n,r,o){super("RecognitionStartedEvent",e,o),this.privAudioSourceId=t,this.privAudioNodeId=n,this.privAuthFetchEventId=r}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}get authFetchEventId(){return this.privAuthFetchEventId}}(Wt=Gt||(Gt={}))[Wt.Success=0]="Success",Wt[Wt.AudioSourceError=1]="AudioSourceError",Wt[Wt.AudioSourceTimeout=2]="AudioSourceTimeout",Wt[Wt.AuthTokenFetchError=3]="AuthTokenFetchError",Wt[Wt.AuthTokenFetchTimeout=4]="AuthTokenFetchTimeout",Wt[Wt.UnAuthorized=5]="UnAuthorized",Wt[Wt.ConnectTimeout=6]="ConnectTimeout",Wt[Wt.ConnectError=7]="ConnectError",Wt[Wt.ClientRecognitionActivityTimeout=8]="ClientRecognitionActivityTimeout",Wt[Wt.UnknownError=9]="UnknownError";class Qt{constructor(e,t,n){this.privIsDisposed=!1,this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.onEvent=e=>{if(!this.privIsDisposed&&(e instanceof Kt&&e.requestId===this.privRequestId&&(this.privListeningTriggerMetric={End:e.eventTime,Name:"ListeningTrigger",Start:e.eventTime}),e instanceof j&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=e.eventTime),e instanceof F&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=e.eventTime),e instanceof B&&e.audioSourceId===this.privAudioSourceId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:this.privMicStartTime})),e instanceof U&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:this.privMicStartTime})),e instanceof z&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Name:"Microphone",Start:this.privMicStartTime})),e instanceof Jt&&e.requestId===this.privRequestId&&(this.privConnectionId=e.sessionId),e instanceof W&&e.connectionId===this.privConnectionId&&(this.privConnectionStartTime=e.eventTime),e instanceof V&&e.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:e.eventTime,Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),e instanceof $&&e.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:e.eventTime,Error:this.getConnectionError(e.statusCode),Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),e instanceof J&&e.connectionId===this.privConnectionId&&e.message&&e.message.headers&&e.message.headers.path)){this.privReceivedMessages[e.message.headers.path]||(this.privReceivedMessages[e.message.headers.path]=new Array);const t=50;this.privReceivedMessages[e.message.headers.path].length<t&&this.privReceivedMessages[e.message.headers.path].push(e.networkReceivedTime)}},this.getTelemetry=()=>{const e=new Array;this.privListeningTriggerMetric&&e.push(this.privListeningTriggerMetric),this.privMicMetric&&e.push(this.privMicMetric),this.privConnectionEstablishMetric&&e.push(this.privConnectionEstablishMetric),this.privPhraseLatencies.length>0&&e.push({PhraseLatencyMs:this.privPhraseLatencies}),this.privHypothesisLatencies.length>0&&e.push({FirstHypothesisLatencyMs:this.privHypothesisLatencies});const t={Metrics:e,ReceivedMessages:this.privReceivedMessages},n=JSON.stringify(t);return this.privReceivedMessages={},this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privPhraseLatencies=[],this.privHypothesisLatencies=[],n},this.dispose=()=>{this.privIsDisposed=!0},this.getConnectionError=e=>{switch(e){case 400:case 1002:case 1003:case 1005:case 1007:case 1008:case 1009:return"BadRequest";case 401:return"Unauthorized";case 403:return"Forbidden";case 503:case 1001:return"ServerUnavailable";case 500:case 1011:return"ServerError";case 408:case 504:return"Timeout";default:return"statuscode:"+e.toString()}},this.privRequestId=e,this.privAudioSourceId=t,this.privAudioNodeId=n,this.privReceivedMessages={},this.privPhraseLatencies=[],this.privHypothesisLatencies=[]}phraseReceived(e){e>0&&this.privPhraseLatencies.push(Date.now()-e)}hypothesisReceived(e){e>0&&this.privHypothesisLatencies.push(Date.now()-e)}get hasTelemetry(){return 0!==Object.keys(this.privReceivedMessages).length||null!==this.privListeningTriggerMetric||null!==this.privMicMetric||null!==this.privConnectionEstablishMetric||0!==this.privPhraseLatencies.length||0!==this.privHypothesisLatencies.length}}var Yt,Zt,en,tn,nn,rn,on,an=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class sn{constructor(e){this.privIsDisposed=!1,this.privDetachables=new Array,this.privIsAudioNodeDetached=!1,this.privIsRecognizing=!1,this.privIsSpeechEnded=!1,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privHypothesisReceived=!1,this.privBytesSent=0,this.privRecogNumber=0,this.privInTurn=!1,this.privConnectionAttempts=0,this.onPreConnectionStart=(e,t)=>{this.privAuthFetchEventId=e,this.privSessionId=t,this.onEvent(new Jt(this.privRequestId,this.privAuthFetchEventId,this.privSessionId))},this.onSpeechContext=()=>{this.privRequestId=S()},this.onServiceTurnStartResponse=()=>{this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch((()=>{}))),this.privInTurn=!0,this.privTurnDeferral=new oe},this.getTelemetry=()=>this.privServiceTelemetryListener.hasTelemetry?this.privServiceTelemetryListener.getTelemetry():null,this.onEvent=e=>{this.privServiceTelemetryListener&&this.privServiceTelemetryListener.onEvent(e),re.instance.onEvent(e)},this.privAudioSourceId=e,this.privRequestId=S(),this.privAudioNodeId=S(),this.privTurnDeferral=new oe,this.privTurnDeferral.resolve()}get sessionId(){return this.privSessionId}get requestId(){return this.privRequestId}get audioNodeId(){return this.privAudioNodeId}get turnCompletionPromise(){return this.privTurnDeferral.promise}get isSpeechEnded(){return this.privIsSpeechEnded}get isRecognizing(){return this.privIsRecognizing}get currentTurnAudioOffset(){return this.privTurnStartAudioOffset}get recogNumber(){return this.privRecogNumber}get numConnectionAttempts(){return this.privConnectionAttempts}get bytesSent(){return this.privBytesSent}listenForServiceTelemetry(e){this.privServiceTelemetryListener&&this.privDetachables.push(e.attachListener(this.privServiceTelemetryListener))}startNewRecognition(){this.privIsSpeechEnded=!1,this.privIsRecognizing=!0,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privRecogNumber++,this.privServiceTelemetryListener=new Qt(this.privRequestId,this.privAudioSourceId,this.privAudioNodeId),this.onEvent(new Kt(this.requestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}onAudioSourceAttachCompleted(e,t,n){return an(this,void 0,void 0,(function*(){this.privAudioNode=e,this.privIsAudioNodeDetached=!1,t?yield this.onComplete():this.onEvent(new $t(this.privRequestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}))}onAuthCompleted(e,t){return an(this,void 0,void 0,(function*(){e&&(yield this.onComplete())}))}onConnectionEstablishCompleted(e,t){return an(this,void 0,void 0,(function*(){if(200===e)return this.onEvent(new Xt(this.requestId,this.privAudioSourceId,this.privAudioNodeId,this.privAuthFetchEventId,this.privSessionId)),this.privAudioNode&&this.privAudioNode.replay(),this.privTurnStartAudioOffset=this.privLastRecoOffset,void(this.privBytesSent=0);403===e&&(yield this.onComplete())}))}onServiceTurnEndResponse(e){return an(this,void 0,void 0,(function*(){this.privTurnDeferral.resolve(),!e||this.isSpeechEnded?(yield this.onComplete(),this.privInTurn=!1):(this.privTurnStartAudioOffset=this.privLastRecoOffset,this.privAudioNode.replay())}))}onHypothesis(e){this.privHypothesisReceived||(this.privHypothesisReceived=!0,this.privServiceTelemetryListener.hypothesisReceived(this.privAudioNode.findTimeAtOffset(e)))}onPhraseRecognized(e){this.privServiceTelemetryListener.phraseReceived(this.privAudioNode.findTimeAtOffset(e)),this.onServiceRecognized(e)}onServiceRecognized(e){this.privLastRecoOffset=e,this.privHypothesisReceived=!1,this.privAudioNode.shrinkBuffers(e),this.privConnectionAttempts=0}onAudioSent(e){this.privBytesSent+=e}onRetryConnection(){this.privConnectionAttempts++}dispose(e){var t;return an(this,void 0,void 0,(function*(){if(!this.privIsDisposed){this.privIsDisposed=!0;for(const e of this.privDetachables)yield e.detach();null===(t=this.privServiceTelemetryListener)||void 0===t||t.dispose(),this.privIsRecognizing=!1}}))}onStopRecognizing(){return an(this,void 0,void 0,(function*(){yield this.onComplete()}))}onSpeechEnded(){this.privIsSpeechEnded=!0}onComplete(){return an(this,void 0,void 0,(function*(){this.privIsRecognizing&&(this.privIsRecognizing=!1,yield this.detachAudioNode())}))}detachAudioNode(){return an(this,void 0,void 0,(function*(){this.privIsAudioNodeDetached||(this.privIsAudioNodeDetached=!0,this.privAudioNode&&(yield this.privAudioNode.detach()))}))}}class ln{constructor(e){this.privContext={},this.privDynamicGrammar=e}setSection(e,t){this.privContext[e]=t}setPronunciationAssessmentParams(e){void 0===this.privContext.phraseDetection&&(this.privContext.phraseDetection={enrichment:{pronunciationAssessment:{}}}),this.privContext.phraseDetection.enrichment.pronunciationAssessment=JSON.parse(e),void 0===this.privContext.phraseOutput&&(this.privContext.phraseOutput={detailed:{options:[]},format:{}}),this.privContext.phraseOutput.format="Detailed",this.privContext.phraseOutput.detailed.options.push("PronunciationAssessment"),-1===this.privContext.phraseOutput.detailed.options.indexOf("WordTimings")&&this.privContext.phraseOutput.detailed.options.push("WordTimings"),-1===this.privContext.phraseOutput.detailed.options.indexOf("SNR")&&this.privContext.phraseOutput.detailed.options.push("SNR")}toJSON(){const e=this.privDynamicGrammar.generateGrammarObject();this.setSection("dgi",e);return JSON.stringify(this.privContext)}}class cn{addPhrase(e){this.privPhrases||(this.privPhrases=[]),e instanceof Array?this.privPhrases=this.privPhrases.concat(e):this.privPhrases.push(e)}clearPhrases(){this.privPhrases=void 0}addReferenceGrammar(e){this.privGrammars||(this.privGrammars=[]),e instanceof Array?this.privGrammars=this.privGrammars.concat(e):this.privGrammars.push(e)}clearGrammars(){this.privGrammars=void 0}generateGrammarObject(){if(void 0===this.privGrammars&&void 0===this.privPhrases)return;const e={};if(e.ReferenceGrammars=this.privGrammars,void 0!==this.privPhrases&&0!==this.privPhrases.length){const t=[];this.privPhrases.forEach(((e,n,r)=>{t.push({Text:e})})),e.Groups=[{Type:"Generic",Items:t}]}return e}}(Zt=Yt||(Yt={}))[Zt.Raw8Khz8BitMonoMULaw=0]="Raw8Khz8BitMonoMULaw",Zt[Zt.Riff16Khz16KbpsMonoSiren=1]="Riff16Khz16KbpsMonoSiren",Zt[Zt.Audio16Khz16KbpsMonoSiren=2]="Audio16Khz16KbpsMonoSiren",Zt[Zt.Audio16Khz32KBitRateMonoMp3=3]="Audio16Khz32KBitRateMonoMp3",Zt[Zt.Audio16Khz128KBitRateMonoMp3=4]="Audio16Khz128KBitRateMonoMp3",Zt[Zt.Audio16Khz64KBitRateMonoMp3=5]="Audio16Khz64KBitRateMonoMp3",Zt[Zt.Audio24Khz48KBitRateMonoMp3=6]="Audio24Khz48KBitRateMonoMp3",Zt[Zt.Audio24Khz96KBitRateMonoMp3=7]="Audio24Khz96KBitRateMonoMp3",Zt[Zt.Audio24Khz160KBitRateMonoMp3=8]="Audio24Khz160KBitRateMonoMp3",Zt[Zt.Raw16Khz16BitMonoTrueSilk=9]="Raw16Khz16BitMonoTrueSilk",Zt[Zt.Riff16Khz16BitMonoPcm=10]="Riff16Khz16BitMonoPcm",Zt[Zt.Riff8Khz16BitMonoPcm=11]="Riff8Khz16BitMonoPcm",Zt[Zt.Riff24Khz16BitMonoPcm=12]="Riff24Khz16BitMonoPcm",Zt[Zt.Riff8Khz8BitMonoMULaw=13]="Riff8Khz8BitMonoMULaw",Zt[Zt.Raw16Khz16BitMonoPcm=14]="Raw16Khz16BitMonoPcm",Zt[Zt.Raw24Khz16BitMonoPcm=15]="Raw24Khz16BitMonoPcm",Zt[Zt.Raw8Khz16BitMonoPcm=16]="Raw8Khz16BitMonoPcm",Zt[Zt.Ogg16Khz16BitMonoOpus=17]="Ogg16Khz16BitMonoOpus",Zt[Zt.Ogg24Khz16BitMonoOpus=18]="Ogg24Khz16BitMonoOpus",Zt[Zt.Raw48Khz16BitMonoPcm=19]="Raw48Khz16BitMonoPcm",Zt[Zt.Riff48Khz16BitMonoPcm=20]="Riff48Khz16BitMonoPcm",Zt[Zt.Audio48Khz96KBitRateMonoMp3=21]="Audio48Khz96KBitRateMonoMp3",Zt[Zt.Audio48Khz192KBitRateMonoMp3=22]="Audio48Khz192KBitRateMonoMp3",Zt[Zt.Ogg48Khz16BitMonoOpus=23]="Ogg48Khz16BitMonoOpus",Zt[Zt.Webm16Khz16BitMonoOpus=24]="Webm16Khz16BitMonoOpus",Zt[Zt.Webm24Khz16BitMonoOpus=25]="Webm24Khz16BitMonoOpus",Zt[Zt.Raw24Khz16BitMonoTrueSilk=26]="Raw24Khz16BitMonoTrueSilk",Zt[Zt.Raw8Khz8BitMonoALaw=27]="Raw8Khz8BitMonoALaw",Zt[Zt.Riff8Khz8BitMonoALaw=28]="Riff8Khz8BitMonoALaw",Zt[Zt.Webm24Khz16Bit24KbpsMonoOpus=29]="Webm24Khz16Bit24KbpsMonoOpus",Zt[Zt.Audio16Khz16Bit32KbpsMonoOpus=30]="Audio16Khz16Bit32KbpsMonoOpus",Zt[Zt.Audio24Khz16Bit48KbpsMonoOpus=31]="Audio24Khz16Bit48KbpsMonoOpus",Zt[Zt.Audio24Khz16Bit24KbpsMonoOpus=32]="Audio24Khz16Bit24KbpsMonoOpus",(tn=en||(en={}))[tn.PCM=1]="PCM",tn[tn.MuLaw=2]="MuLaw",tn[tn.Siren=3]="Siren",tn[tn.MP3=4]="MP3",tn[tn.SILKSkype=5]="SILKSkype",tn[tn.OGG_OPUS=6]="OGG_OPUS",tn[tn.WEBM_OPUS=7]="WEBM_OPUS",tn[tn.ALaw=8]="ALaw",tn[tn.FLAC=9]="FLAC",tn[tn.OPUS=10]="OPUS";class un{static getDefaultInputFormat(){return dn.getDefaultInputFormat()}static getWaveFormat(e,t,n,r){return new dn(e,t,n,r)}static getWaveFormatPCM(e,t,n){return new dn(e,t,n)}}class dn extends un{constructor(e=16e3,t=16,n=1,r=en.PCM){super(),this.setString=(e,t,n)=>{for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))};let o=!0;switch(r){case en.PCM:this.formatTag=1;break;case en.ALaw:this.formatTag=6;break;case en.MuLaw:this.formatTag=7;break;default:o=!1}if(this.bitsPerSample=t,this.samplesPerSec=e,this.channels=n,this.avgBytesPerSec=this.samplesPerSec*this.channels*(this.bitsPerSample/8),this.blockAlign=this.channels*Math.max(this.bitsPerSample,8),o){this.privHeader=new ArrayBuffer(44);const e=new DataView(this.privHeader);this.setString(e,0,"RIFF"),e.setUint32(4,0,!0),this.setString(e,8,"WAVEfmt "),e.setUint32(16,16,!0),e.setUint16(20,this.formatTag,!0),e.setUint16(22,this.channels,!0),e.setUint32(24,this.samplesPerSec,!0),e.setUint32(28,this.avgBytesPerSec,!0),e.setUint16(32,this.channels*(this.bitsPerSample/8),!0),e.setUint16(34,this.bitsPerSample,!0),this.setString(e,36,"data"),e.setUint32(40,0,!0)}}static getDefaultInputFormat(){return new dn}static getAudioContext(e){const t=window.AudioContext||window.webkitAudioContext||!1;if(t)return void 0!==e&&navigator.mediaDevices.getSupportedConstraints().sampleRate?new t({sampleRate:e}):new t;throw new Error("Browser does not support Web Audio API (AudioContext is not available).")}close(){}get header(){return this.privHeader}}class fn extends dn{constructor(e,t,n,r,o,i,a,s,l){super(n,i,t,e),this.formatTag=e,this.avgBytesPerSec=r,this.blockAlign=o,this.priAudioFormatString=a,this.priRequestAudioFormatString=s,this.priHasHeader=l}static fromSpeechSynthesisOutputFormat(e){return void 0===e?fn.getDefaultOutputFormat():fn.fromSpeechSynthesisOutputFormatString(fn.SpeechSynthesisOutputFormatToString[e])}static fromSpeechSynthesisOutputFormatString(e){switch(e){case"raw-8khz-8bit-mono-mulaw":return new fn(en.MuLaw,1,8e3,8e3,1,8,e,e,!1);case"riff-16khz-16kbps-mono-siren":return new fn(en.Siren,1,16e3,2e3,40,0,e,"audio-16khz-16kbps-mono-siren",!0);case"audio-16khz-16kbps-mono-siren":return new fn(en.Siren,1,16e3,2e3,40,0,e,e,!1);case"audio-16khz-32kbitrate-mono-mp3":return new fn(en.MP3,1,16e3,4096,2,16,e,e,!1);case"audio-16khz-128kbitrate-mono-mp3":return new fn(en.MP3,1,16e3,16384,2,16,e,e,!1);case"audio-16khz-64kbitrate-mono-mp3":return new fn(en.MP3,1,16e3,8192,2,16,e,e,!1);case"audio-24khz-48kbitrate-mono-mp3":return new fn(en.MP3,1,24e3,6144,2,16,e,e,!1);case"audio-24khz-96kbitrate-mono-mp3":return new fn(en.MP3,1,24e3,12288,2,16,e,e,!1);case"audio-24khz-160kbitrate-mono-mp3":return new fn(en.MP3,1,24e3,20480,2,16,e,e,!1);case"raw-16khz-16bit-mono-truesilk":return new fn(en.SILKSkype,1,16e3,32e3,2,16,e,e,!1);case"riff-8khz-16bit-mono-pcm":return new fn(en.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!0);case"riff-24khz-16bit-mono-pcm":return new fn(en.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!0);case"riff-8khz-8bit-mono-mulaw":return new fn(en.MuLaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-mulaw",!0);case"raw-16khz-16bit-mono-pcm":return new fn(en.PCM,1,16e3,32e3,2,16,e,"raw-16khz-16bit-mono-pcm",!1);case"raw-24khz-16bit-mono-pcm":return new fn(en.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!1);case"raw-8khz-16bit-mono-pcm":return new fn(en.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!1);case"ogg-16khz-16bit-mono-opus":return new fn(en.OGG_OPUS,1,16e3,8192,2,16,e,e,!1);case"ogg-24khz-16bit-mono-opus":return new fn(en.OGG_OPUS,1,24e3,8192,2,16,e,e,!1);case"raw-48khz-16bit-mono-pcm":return new fn(en.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!1);case"riff-48khz-16bit-mono-pcm":return new fn(en.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!0);case"audio-48khz-96kbitrate-mono-mp3":return new fn(en.MP3,1,48e3,12288,2,16,e,e,!1);case"audio-48khz-192kbitrate-mono-mp3":return new fn(en.MP3,1,48e3,24576,2,16,e,e,!1);case"ogg-48khz-16bit-mono-opus":return new fn(en.OGG_OPUS,1,48e3,12e3,2,16,e,e,!1);case"webm-16khz-16bit-mono-opus":return new fn(en.WEBM_OPUS,1,16e3,4e3,2,16,e,e,!1);case"webm-24khz-16bit-mono-opus":return new fn(en.WEBM_OPUS,1,24e3,6e3,2,16,e,e,!1);case"webm-24khz-16bit-24kbps-mono-opus":return new fn(en.WEBM_OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-16khz-16bit-32kbps-mono-opus":return new fn(en.OPUS,1,16e3,4e3,2,16,e,e,!1);case"audio-24khz-16bit-48kbps-mono-opus":return new fn(en.OPUS,1,24e3,6e3,2,16,e,e,!1);case"audio-24khz-16bit-24kbps-mono-opus":return new fn(en.OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-24khz-16bit-mono-flac":return new fn(en.FLAC,1,24e3,24e3,2,16,e,e,!1);case"audio-48khz-16bit-mono-flac":return new fn(en.FLAC,1,48e3,3e4,2,16,e,e,!1);case"raw-24khz-16bit-mono-truesilk":return new fn(en.SILKSkype,1,24e3,48e3,2,16,e,e,!1);case"raw-8khz-8bit-mono-alaw":return new fn(en.ALaw,1,8e3,8e3,1,8,e,e,!1);case"riff-8khz-8bit-mono-alaw":return new fn(en.ALaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-alaw",!0);default:return new fn(en.PCM,1,16e3,32e3,2,16,"riff-16khz-16bit-mono-pcm","raw-16khz-16bit-mono-pcm",!0)}}static getDefaultOutputFormat(){return fn.fromSpeechSynthesisOutputFormatString("undefined"!=typeof window?"audio-24khz-48kbitrate-mono-mp3":"riff-16khz-16bit-mono-pcm")}get hasHeader(){return this.priHasHeader}get header(){if(this.hasHeader)return this.privHeader}updateHeader(e){if(this.priHasHeader){new DataView(this.privHeader).setUint32(40,e,!0)}}get requestAudioFormatString(){return this.priRequestAudioFormatString}}fn.SpeechSynthesisOutputFormatToString={[Yt.Raw8Khz8BitMonoMULaw]:"raw-8khz-8bit-mono-mulaw",[Yt.Riff16Khz16KbpsMonoSiren]:"riff-16khz-16kbps-mono-siren",[Yt.Audio16Khz16KbpsMonoSiren]:"audio-16khz-16kbps-mono-siren",[Yt.Audio16Khz32KBitRateMonoMp3]:"audio-16khz-32kbitrate-mono-mp3",[Yt.Audio16Khz128KBitRateMonoMp3]:"audio-16khz-128kbitrate-mono-mp3",[Yt.Audio16Khz64KBitRateMonoMp3]:"audio-16khz-64kbitrate-mono-mp3",[Yt.Audio24Khz48KBitRateMonoMp3]:"audio-24khz-48kbitrate-mono-mp3",[Yt.Audio24Khz96KBitRateMonoMp3]:"audio-24khz-96kbitrate-mono-mp3",[Yt.Audio24Khz160KBitRateMonoMp3]:"audio-24khz-160kbitrate-mono-mp3",[Yt.Raw16Khz16BitMonoTrueSilk]:"raw-16khz-16bit-mono-truesilk",[Yt.Riff16Khz16BitMonoPcm]:"riff-16khz-16bit-mono-pcm",[Yt.Riff8Khz16BitMonoPcm]:"riff-8khz-16bit-mono-pcm",[Yt.Riff24Khz16BitMonoPcm]:"riff-24khz-16bit-mono-pcm",[Yt.Riff8Khz8BitMonoMULaw]:"riff-8khz-8bit-mono-mulaw",[Yt.Raw16Khz16BitMonoPcm]:"raw-16khz-16bit-mono-pcm",[Yt.Raw24Khz16BitMonoPcm]:"raw-24khz-16bit-mono-pcm",[Yt.Raw8Khz16BitMonoPcm]:"raw-8khz-16bit-mono-pcm",[Yt.Ogg16Khz16BitMonoOpus]:"ogg-16khz-16bit-mono-opus",[Yt.Ogg24Khz16BitMonoOpus]:"ogg-24khz-16bit-mono-opus",[Yt.Raw48Khz16BitMonoPcm]:"raw-48khz-16bit-mono-pcm",[Yt.Riff48Khz16BitMonoPcm]:"riff-48khz-16bit-mono-pcm",[Yt.Audio48Khz96KBitRateMonoMp3]:"audio-48khz-96kbitrate-mono-mp3",[Yt.Audio48Khz192KBitRateMonoMp3]:"audio-48khz-192kbitrate-mono-mp3",[Yt.Ogg48Khz16BitMonoOpus]:"ogg-48khz-16bit-mono-opus",[Yt.Webm16Khz16BitMonoOpus]:"webm-16khz-16bit-mono-opus",[Yt.Webm24Khz16BitMonoOpus]:"webm-24khz-16bit-mono-opus",[Yt.Webm24Khz16Bit24KbpsMonoOpus]:"webm-24khz-16bit-24kbps-mono-opus",[Yt.Raw24Khz16BitMonoTrueSilk]:"raw-24khz-16bit-mono-truesilk",[Yt.Raw8Khz8BitMonoALaw]:"raw-8khz-8bit-mono-alaw",[Yt.Riff8Khz8BitMonoALaw]:"riff-8khz-8bit-mono-alaw",[Yt.Audio16Khz16Bit32KbpsMonoOpus]:"audio-16khz-16bit-32kbps-mono-opus",[Yt.Audio24Khz16Bit48KbpsMonoOpus]:"audio-24khz-16bit-48kbps-mono-opus",[Yt.Audio24Khz16Bit24KbpsMonoOpus]:"audio-24khz-16bit-24kbps-mono-opus"},(rn=nn||(nn={}))[rn.Masked=0]="Masked",rn[rn.Removed=1]="Removed",rn[rn.Raw=2]="Raw";class hn{constructor(){}static fromSubscription(e,t){Tt.throwIfNullOrWhitespace(e,"subscriptionKey"),Tt.throwIfNullOrWhitespace(t,"region");const n=new pn;return n.setProperty($e.SpeechServiceConnection_Region,t),n.setProperty($e.SpeechServiceConnection_IntentRegion,t),n.setProperty($e.SpeechServiceConnection_Key,e),n}static fromEndpoint(e,t){Tt.throwIfNull(e,"endpoint");const n=new pn;return n.setProperty($e.SpeechServiceConnection_Endpoint,e.href),void 0!==t&&n.setProperty($e.SpeechServiceConnection_Key,t),n}static fromHost(e,t){Tt.throwIfNull(e,"hostName");const n=new pn;return n.setProperty($e.SpeechServiceConnection_Host,e.protocol+"//"+e.hostname+(""===e.port?"":":"+e.port)),void 0!==t&&n.setProperty($e.SpeechServiceConnection_Key,t),n}static fromAuthorizationToken(e,t){Tt.throwIfNull(e,"authorizationToken"),Tt.throwIfNullOrWhitespace(t,"region");const n=new pn;return n.setProperty($e.SpeechServiceConnection_Region,t),n.setProperty($e.SpeechServiceConnection_IntentRegion,t),n.authorizationToken=e,n}close(){}}class pn extends hn{constructor(){super(),this.privProperties=new It,this.speechRecognitionLanguage="en-US",this.outputFormat=gt.Simple}get properties(){return this.privProperties}get endPoint(){return new URL(this.privProperties.getProperty($e.SpeechServiceConnection_Endpoint))}get subscriptionKey(){return this.privProperties.getProperty($e.SpeechServiceConnection_Key)}get region(){return this.privProperties.getProperty($e.SpeechServiceConnection_Region)}get authorizationToken(){return this.privProperties.getProperty($e.SpeechServiceAuthorization_Token)}set authorizationToken(e){this.privProperties.setProperty($e.SpeechServiceAuthorization_Token,e)}get speechRecognitionLanguage(){return this.privProperties.getProperty($e.SpeechServiceConnection_RecoLanguage)}set speechRecognitionLanguage(e){this.privProperties.setProperty($e.SpeechServiceConnection_RecoLanguage,e)}get autoDetectSourceLanguages(){return this.privProperties.getProperty($e.SpeechServiceConnection_AutoDetectSourceLanguages)}set autoDetectSourceLanguages(e){this.privProperties.setProperty($e.SpeechServiceConnection_AutoDetectSourceLanguages,e)}get outputFormat(){return gt[this.privProperties.getProperty(Yn,void 0)]}set outputFormat(e){this.privProperties.setProperty(Yn,gt[e])}get endpointId(){return this.privProperties.getProperty($e.SpeechServiceConnection_EndpointId)}set endpointId(e){this.privProperties.setProperty($e.SpeechServiceConnection_EndpointId,e)}setProperty(e,t){Tt.throwIfNull(t,"value"),this.privProperties.setProperty(e,t)}getProperty(e,t){return this.privProperties.getProperty(e,t)}setProxy(e,t,n,r){this.setProperty($e[$e.SpeechServiceConnection_ProxyHostName],e),this.setProperty($e[$e.SpeechServiceConnection_ProxyPort],t),this.setProperty($e[$e.SpeechServiceConnection_ProxyUserName],n),this.setProperty($e[$e.SpeechServiceConnection_ProxyPassword],r)}setServiceProperty(e,t,n){const r=JSON.parse(this.privProperties.getProperty(er,"{}"));r[e]=t,this.privProperties.setProperty(er,JSON.stringify(r))}setProfanity(e){this.privProperties.setProperty($e.SpeechServiceResponse_ProfanityOption,nn[e])}enableAudioLogging(){this.privProperties.setProperty($e.SpeechServiceConnection_EnableAudioLogging,"true")}requestWordLevelTimestamps(){this.privProperties.setProperty($e.SpeechServiceResponse_RequestWordLevelTimestamps,"true")}enableDictation(){this.privProperties.setProperty(tr,"true")}clone(){const e=new pn;return e.privProperties=this.privProperties.clone(),e}get speechSynthesisLanguage(){return this.privProperties.getProperty($e.SpeechServiceConnection_SynthLanguage)}set speechSynthesisLanguage(e){this.privProperties.setProperty($e.SpeechServiceConnection_SynthLanguage,e)}get speechSynthesisVoiceName(){return this.privProperties.getProperty($e.SpeechServiceConnection_SynthVoice)}set speechSynthesisVoiceName(e){this.privProperties.setProperty($e.SpeechServiceConnection_SynthVoice,e)}get speechSynthesisOutputFormat(){return Yt[this.privProperties.getProperty($e.SpeechServiceConnection_SynthOutputFormat,void 0)]}set speechSynthesisOutputFormat(e){this.privProperties.setProperty($e.SpeechServiceConnection_SynthOutputFormat,Yt[e])}}class mn{constructor(){}set applicationId(e){}}mn.DialogTypes=((on=class{}).BotFramework="bot_framework",on.CustomCommands="custom_commands",on);var gn={};e(gn,"AudioOutputStream",(()=>wn),(e=>wn=e)),e(gn,"PullAudioOutputStream",(()=>xn),(e=>xn=e)),e(gn,"PullAudioOutputStreamImpl",(()=>Sn),(e=>Sn=e)),e(gn,"PushAudioOutputStream",(()=>Mn),(e=>Mn=e)),e(gn,"PushAudioOutputStreamImpl",(()=>_n),(e=>_n=e));var vn,bn,yn=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class wn{constructor(){}static createPullStream(){return xn.create()}}class xn extends wn{static create(){return new Sn}}class Sn extends xn{constructor(){super(),this.privId=S(),this.privStream=new(0,pe.Stream)}set format(e){null==e&&(this.privFormat=fn.getDefaultOutputFormat()),this.privFormat=e}get format(){return this.privFormat}get isClosed(){return this.privStream.isClosed}id(){return this.privId}read(e){return yn(this,void 0,void 0,(function*(){const t=new Int8Array(e);let n=0;if(void 0!==this.privLastChunkView){if(this.privLastChunkView.length>e.byteLength)return t.set(this.privLastChunkView.slice(0,e.byteLength)),this.privLastChunkView=this.privLastChunkView.slice(e.byteLength),Promise.resolve(e.byteLength);t.set(this.privLastChunkView),n=this.privLastChunkView.length,this.privLastChunkView=void 0}for(;n<e.byteLength&&!this.privStream.isReadEnded;){const r=yield this.privStream.read();if(void 0===r||r.isEnd)yield this.privStream.readEnded();else{let o;r.buffer.byteLength>e.byteLength-n?(o=r.buffer.slice(0,e.byteLength-n),this.privLastChunkView=new Int8Array(r.buffer.slice(e.byteLength-n))):o=r.buffer,t.set(new Int8Array(o),n),n+=o.byteLength}}return n}))}write(e){Tt.throwIfNullOrUndefined(this.privStream,"must set format before writing"),this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}}class Mn extends wn{constructor(){super()}static create(e){return new _n(e)}}class _n extends Mn{constructor(e){super(),this.privId=S(),this.privCallback=e}set format(e){}write(e){this.privCallback.write&&this.privCallback.write(e)}close(){this.privCallback.close&&this.privCallback.close()}id(){return this.privId}}(bn=vn||(vn={}))[bn.None=0]="None",bn[bn.TextToSpeechAudio=1]="TextToSpeechAudio";var En,An;class Cn{toJsonString(){return JSON.stringify(this.iPrivConfig)}get(){return this.iPrivConfig}set(e){this.iPrivConfig=e}}(An=En||(En={})).WordBoundary="WordBoundary",An.Bookmark="Bookmark",An.Viseme="Viseme";class kn{constructor(e){this.privSynthesisAudioMetadata=JSON.parse(e)}static fromJSON(e){return new kn(e)}get Metadata(){return this.privSynthesisAudioMetadata.Metadata}}var Tn={};e(Tn,"SynthesisTurn",(()=>$n),(e=>$n=e));var In={};e(In,"SynthesisAdapterBase",(()=>jn),(e=>jn=e));class On{constructor(e){this.privResult=e}get result(){return this.privResult}}class Rn{constructor(e,t,n,r){this.privResultId=e,this.privReason=t,this.privErrorDetails=n,this.privProperties=r}get resultId(){return this.privResultId}get reason(){return this.privReason}get errorDetails(){return this.privErrorDetails}get properties(){return this.privProperties}}class Pn extends Rn{constructor(e,t,n,r,o){super(e,t,r,o),this.privAudioData=n}get audioData(){return this.privAudioData}}class Nn{constructor(e,t,n,r){this.privAudioOffset=e,this.privText=t,this.privWordLength=n,this.privTextOffset=r}get audioOffset(){return this.privAudioOffset}get text(){return this.privText}get wordLength(){return this.privWordLength}get textOffset(){return this.privTextOffset}}class Ln{constructor(e,t){this.privAudioOffset=e,this.privText=t}get audioOffset(){return this.privAudioOffset}get text(){return this.privText}}class Bn{constructor(e,t,n){this.privAudioOffset=e,this.privVisemeId=t,this.privAnimation=n}get audioOffset(){return this.privAudioOffset}get visemeId(){return this.privVisemeId}get animation(){return this.privAnimation}}var Dn=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class jn{constructor(e,t,n,r,o){if(this.speakOverride=void 0,this.receiveMessageOverride=void 0,this.connectImplOverride=void 0,this.configConnectionOverride=void 0,this.sendSynthesisContext=e=>{const t=this.synthesisContext.toJSON();if(t)return e.send(new Ze(E.Text,"synthesis.context",this.privSynthesisTurn.requestId,"application/json",t))},this.sendSpeechServiceConfig=(e,t)=>{if(t)return e.send(new Ze(E.Text,"speech.config",this.privSynthesisTurn.requestId,"application/json",t))},this.sendSsmlMessage=(e,t,n)=>e.send(new Ze(E.Text,"ssml",n,"application/ssml+xml",t)),!e)throw new Q("authentication");if(!t)throw new Q("connectionFactory");if(!n)throw new Q("synthesizerConfig");this.privAuthentication=e,this.privConnectionFactory=t,this.privSynthesizerConfig=n,this.privIsDisposed=!1,this.privSpeechSynthesizer=r,this.privSessionAudioDestination=o,this.privSynthesisTurn=new(0,Tn.SynthesisTurn),this.privConnectionEvents=new ne,this.privServiceEvents=new ne,this.privSynthesisContext=new Qn(this.privSpeechSynthesizer),this.privAgentConfig=new Cn,this.connectionEvents.attach((e=>{if("ConnectionClosedEvent"===e.name){const t=e;1e3!==t.statusCode&&this.cancelSynthesisLocal(We.Error,1007===t.statusCode?qe.BadRequestParameters:qe.ConnectionFailure,t.reason+" websocket error code: "+t.statusCode)}}))}get synthesisContext(){return this.privSynthesisContext}get agentConfig(){return this.privAgentConfig}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}set activityTemplate(e){this.privActivityTemplate=e}get activityTemplate(){return this.privActivityTemplate}set audioOutputFormat(e){this.privAudioOutputFormat=e,this.privSynthesisTurn.audioOutputFormat=e,void 0!==this.privSessionAudioDestination&&(this.privSessionAudioDestination.format=e),void 0!==this.synthesisContext&&(this.synthesisContext.audioOutputFormat=e)}static addHeader(e,t){if(!t.hasHeader)return e;t.updateHeader(e.byteLength);const n=new Uint8Array(e.byteLength+t.header.byteLength);return n.set(new Uint8Array(t.header),0),n.set(new Uint8Array(e),t.header.byteLength),n.buffer}isDisposed(){return this.privIsDisposed}dispose(e){return Dn(this,void 0,void 0,(function*(){if(this.privIsDisposed=!0,void 0!==this.privSessionAudioDestination&&this.privSessionAudioDestination.close(),this.privConnectionConfigurationPromise){const t=yield this.privConnectionConfigurationPromise;yield t.dispose(e)}}))}connect(){return Dn(this,void 0,void 0,(function*(){yield this.connectImpl()}))}sendNetworkMessage(e,t){return Dn(this,void 0,void 0,(function*(){const n="string"==typeof t?E.Text:E.Binary,r="string"==typeof t?"application/json":"";return(yield this.fetchConnection()).send(new Ze(n,e,this.privSynthesisTurn.requestId,r,t))}))}Speak(e,t,n,r,o,i){return Dn(this,void 0,void 0,(function*(){let a;if(a=t?e:this.privSpeechSynthesizer.buildSsml(e),void 0!==this.speakOverride)return this.speakOverride(a,n,r,o);this.privSuccessCallback=r,this.privErrorCallback=o,this.privSynthesisTurn.startNewSynthesis(n,e,t,i);try{yield this.connectImpl();const e=yield this.fetchConnection();yield this.sendSynthesisContext(e),yield this.sendSsmlMessage(e,a,n);const t=new On(new Pn(n,bt.SynthesizingAudioStarted));this.privSpeechSynthesizer.synthesisStarted&&this.privSpeechSynthesizer.synthesisStarted(this.privSpeechSynthesizer,t);this.receiveMessage()}catch(e){return this.cancelSynthesisLocal(We.Error,qe.ConnectionFailure,e),Promise.reject(e)}}))}cancelSynthesis(e,t,n,r){const o=new It;o.setProperty(Zn,qe[n]);const i=new Pn(e,bt.Canceled,void 0,r,o);if(this.privSpeechSynthesizer.SynthesisCanceled){const e=new On(i);try{this.privSpeechSynthesizer.SynthesisCanceled(this.privSpeechSynthesizer,e)}catch(e){}}if(this.privSuccessCallback)try{this.privSuccessCallback(i)}catch(e){}}cancelSynthesisLocal(e,t,n){this.privSynthesisTurn.isSynthesizing&&(this.privSynthesisTurn.onStopSynthesizing(),this.cancelSynthesis(this.privSynthesisTurn.requestId,e,t,n))}processTypeSpecificMessages(e,t,n){return!0}receiveMessage(){return Dn(this,void 0,void 0,(function*(){try{const e=yield this.fetchConnection(),t=yield e.read();if(void 0!==this.receiveMessageOverride)return this.receiveMessageOverride();if(this.privIsDisposed)return;if(!t)return this.privSynthesisTurn.isSynthesizing?this.receiveMessage():void 0;this.privServiceHasSentMessage=!0;const n=Ze.fromConnectionMessage(t);if(n.requestId.toLowerCase()===this.privSynthesisTurn.requestId.toLowerCase())switch(n.path.toLowerCase()){case"turn.start":this.privSynthesisTurn.onServiceTurnStartResponse();break;case"response":this.privSynthesisTurn.onServiceResponseMessage(n.textBody);break;case"audio":if(this.privSynthesisTurn.streamId.toLowerCase()===n.streamId.toLowerCase()&&n.binaryBody){if(this.privSynthesisTurn.onAudioChunkReceived(n.binaryBody),this.privSpeechSynthesizer.synthesizing)try{const e=jn.addHeader(n.binaryBody,this.privSynthesisTurn.audioOutputFormat),t=new On(new Pn(this.privSynthesisTurn.requestId,bt.SynthesizingAudio,e));this.privSpeechSynthesizer.synthesizing(this.privSpeechSynthesizer,t)}catch(e){}void 0!==this.privSessionAudioDestination&&this.privSessionAudioDestination.write(n.binaryBody)}break;case"audio.metadata":const e=kn.fromJSON(n.textBody).Metadata;for(const t of e)switch(t.Type){case En.WordBoundary:this.privSynthesisTurn.onWordBoundaryEvent(t.Data.text.Text);const e=new Nn(t.Data.Offset,t.Data.text.Text,t.Data.text.Length,this.privSynthesisTurn.currentTextOffset);if(this.privSpeechSynthesizer.wordBoundary)try{this.privSpeechSynthesizer.wordBoundary(this.privSpeechSynthesizer,e)}catch(e){}break;case En.Bookmark:const n=new Ln(t.Data.Offset,t.Data.Bookmark);if(this.privSpeechSynthesizer.bookmarkReached)try{this.privSpeechSynthesizer.bookmarkReached(this.privSpeechSynthesizer,n)}catch(e){}break;case En.Viseme:if(this.privSynthesisTurn.onVisemeMetadataReceived(t),t.Data.IsLastAnimation){const e=new Bn(t.Data.Offset,t.Data.VisemeId,this.privSynthesisTurn.getAndClearVisemeAnimation());if(this.privSpeechSynthesizer.visemeReceived)try{this.privSpeechSynthesizer.visemeReceived(this.privSpeechSynthesizer,e)}catch(e){}}}break;case"turn.end":let t;this.privSynthesisTurn.onServiceTurnEndResponse();try{const e=yield this.privSynthesisTurn.getAllReceivedAudioWithHeader();t=new Pn(this.privSynthesisTurn.requestId,bt.SynthesizingAudioCompleted,e),this.privSuccessCallback&&this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}if(this.privSpeechSynthesizer.synthesisCompleted)try{this.privSpeechSynthesizer.synthesisCompleted(this.privSpeechSynthesizer,new On(t))}catch(e){}break;default:this.processTypeSpecificMessages(n)||this.privServiceEvents&&this.serviceEvents.onEvent(new H(n.path.toLowerCase(),n.textBody))}return this.receiveMessage()}catch(e){}}))}connectImpl(e=!1){if(this.privConnectionPromise)return this.privConnectionPromise.then((e=>e.state()===C.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=null,this.privServiceHasSentMessage=!1,this.connectImpl()):this.privConnectionPromise),(e=>(this.privConnectionId=null,this.privConnectionPromise=null,this.privServiceHasSentMessage=!1,this.connectImpl())));this.privAuthFetchEventId=S(),this.privConnectionId=S(),this.privSynthesisTurn.onPreConnectionStart(this.privAuthFetchEventId,this.privConnectionId);const t=e?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId);return this.privConnectionPromise=t.then((t=>Dn(this,void 0,void 0,(function*(){yield this.privSynthesisTurn.onAuthCompleted(!1);const n=this.privConnectionFactory.create(this.privSynthesizerConfig,t,this.privConnectionId);n.events.attach((e=>{this.connectionEvents.onEvent(e)}));const r=yield n.open();return 200===r.statusCode?(yield this.privSynthesisTurn.onConnectionEstablishCompleted(r.statusCode),Promise.resolve(n)):403!==r.statusCode||e?(yield this.privSynthesisTurn.onConnectionEstablishCompleted(r.statusCode,r.reason),Promise.reject(`Unable to contact server. StatusCode: ${r.statusCode}, ${this.privSynthesizerConfig.parameters.getProperty($e.SpeechServiceConnection_Endpoint)} Reason: ${r.reason}`)):this.connectImpl(!0)}))),(e=>Dn(this,void 0,void 0,(function*(){throw yield this.privSynthesisTurn.onAuthCompleted(!0,e),new Error(e)})))),this.privConnectionPromise.catch((()=>{})),this.privConnectionPromise}fetchConnection(){return Dn(this,void 0,void 0,(function*(){return this.privConnectionConfigurationPromise?this.privConnectionConfigurationPromise.then((e=>e.state()===C.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=null,this.privServiceHasSentMessage=!1,this.fetchConnection()):this.privConnectionConfigurationPromise),(e=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=null,this.privServiceHasSentMessage=!1,this.fetchConnection()))):(this.privConnectionConfigurationPromise=this.configureConnection(),yield this.privConnectionConfigurationPromise)}))}configureConnection(){return Dn(this,void 0,void 0,(function*(){const e=yield this.connectImpl();return void 0!==this.configConnectionOverride?this.configConnectionOverride(e):(yield this.sendSpeechServiceConfig(e,this.privSynthesizerConfig.SpeechServiceConfig.serialize()),e)}))}}jn.telemetryDataEnabled=!0;class Fn extends O{constructor(e,t,n=M.Info){super(e,n),this.privRequestId=t}get requestId(){return this.privRequestId}}class zn extends Fn{constructor(e,t,n){super("SynthesisTriggeredEvent",e),this.privSessionAudioDestinationId=t,this.privTurnAudioDestinationId=n}get audioSessionDestinationId(){return this.privSessionAudioDestinationId}get audioTurnDestinationId(){return this.privTurnAudioDestinationId}}class Un extends Fn{constructor(e,t){super("ConnectingToSynthesisServiceEvent",e),this.privAuthFetchEventId=t}get authFetchEventId(){return this.privAuthFetchEventId}}class Hn extends Fn{constructor(e,t){super("SynthesisStartedEvent",e),this.privAuthFetchEventId=t}get authFetchEventId(){return this.privAuthFetchEventId}}var Gn,Wn,Vn,qn,Kn=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class $n{constructor(){this.privIsDisposed=!1,this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!1,this.privBytesReceived=0,this.privInTurn=!1,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.onPreConnectionStart=(e,t)=>{this.privAuthFetchEventId=e,this.onEvent(new Un(this.privRequestId,this.privAuthFetchEventId))},this.onAuthCompleted=(e,t)=>{e&&this.onComplete()},this.onConnectionEstablishCompleted=(e,t)=>{if(200===e)return this.onEvent(new Hn(this.requestId,this.privAuthFetchEventId)),void(this.privBytesReceived=0);403===e&&this.onComplete()},this.onServiceResponseMessage=e=>{const t=JSON.parse(e);this.streamId=t.audio.streamId},this.onServiceTurnEndResponse=()=>{this.privInTurn=!1,this.privTurnDeferral.resolve(),this.onComplete()},this.onServiceTurnStartResponse=()=>{this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch((()=>{}))),this.privInTurn=!0,this.privTurnDeferral=new oe},this.dispose=e=>{this.privIsDisposed||(this.privIsDisposed=!0)},this.onEvent=e=>{re.instance.onEvent(e)},this.onComplete=()=>{this.privIsSynthesizing&&(this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!0,this.privAudioOutputStream.close(),this.privInTurn=!1,void 0!==this.privTurnAudioDestination&&(this.privTurnAudioDestination.close(),this.privTurnAudioDestination=void 0))},this.privRequestId=S(),this.privTurnDeferral=new oe,this.privTurnDeferral.resolve()}get requestId(){return this.privRequestId}get streamId(){return this.privStreamId}set streamId(e){this.privStreamId=e}get audioOutputFormat(){return this.privAudioOutputFormat}set audioOutputFormat(e){this.privAudioOutputFormat=e}get turnCompletionPromise(){return this.privTurnDeferral.promise}get isSynthesisEnded(){return this.privIsSynthesisEnded}get isSynthesizing(){return this.privIsSynthesizing}get currentTextOffset(){return this.privTextOffset}get bytesReceived(){return this.privBytesReceived}getAllReceivedAudio(){return Kn(this,void 0,void 0,(function*(){return this.privReceivedAudio?Promise.resolve(this.privReceivedAudio):this.privIsSynthesisEnded?(yield this.readAllAudioFromStream(),Promise.resolve(this.privReceivedAudio)):null}))}getAllReceivedAudioWithHeader(){return Kn(this,void 0,void 0,(function*(){if(this.privReceivedAudioWithHeader)return this.privReceivedAudioWithHeader;if(!this.privIsSynthesisEnded)return null;if(this.audioOutputFormat.hasHeader){const e=yield this.getAllReceivedAudio();return this.privReceivedAudioWithHeader=In.SynthesisAdapterBase.addHeader(e,this.audioOutputFormat),this.privReceivedAudioWithHeader}return this.getAllReceivedAudio()}))}startNewSynthesis(e,t,n,r){this.privIsSynthesisEnded=!1,this.privIsSynthesizing=!0,this.privRequestId=e,this.privRawText=t,this.privIsSSML=n,this.privAudioOutputStream=new(0,gn.PullAudioOutputStreamImpl),this.privAudioOutputStream.format=this.privAudioOutputFormat,this.privReceivedAudio=null,this.privReceivedAudioWithHeader=null,this.privBytesReceived=0,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.privPartialVisemeAnimation="",void 0!==r&&(this.privTurnAudioDestination=r,this.privTurnAudioDestination.format=this.privAudioOutputFormat),this.onEvent(new zn(this.requestId,void 0,void 0===r?void 0:r.id()))}onAudioChunkReceived(e){this.isSynthesizing&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength,void 0!==this.privTurnAudioDestination&&this.privTurnAudioDestination.write(e))}onWordBoundaryEvent(e){this.updateTextOffset(e)}onVisemeMetadataReceived(e){void 0!==e.Data.AnimationChunk&&(this.privPartialVisemeAnimation+=e.Data.AnimationChunk)}onStopSynthesizing(){this.onComplete()}getAndClearVisemeAnimation(){const e=this.privPartialVisemeAnimation;return this.privPartialVisemeAnimation="",e}updateTextOffset(e){this.privTextOffset>=0&&(this.privTextOffset=this.privRawText.indexOf(e,this.privNextSearchTextIndex),this.privTextOffset>=0&&(this.privNextSearchTextIndex=this.privTextOffset+e.length),this.privIsSSML&&this.privRawText.indexOf("<",this.privTextOffset+1)>this.privRawText.indexOf(">",this.privTextOffset+1)&&this.updateTextOffset(e))}readAllAudioFromStream(){return Kn(this,void 0,void 0,(function*(){if(this.privIsSynthesisEnded){this.privReceivedAudio=new ArrayBuffer(this.bytesReceived);try{yield this.privAudioOutputStream.read(this.privReceivedAudio)}catch(e){this.privReceivedAudio=new ArrayBuffer(0)}}}))}}class Jn{constructor(e){let t=e.parameters.getProperty($e.SpeechServiceConnection_Endpoint,void 0);if(!t){const n=e.parameters.getProperty($e.SpeechServiceConnection_Region,"westus"),r=Et.getHostSuffix(n);t=e.parameters.getProperty($e.SpeechServiceConnection_Host,`https://${n}.tts.speech${r}`)}this.privUri=`${t}/cognitiveservices/voices/list`;const n=eo.requestOptions;n.headers[eo.configParams.subscriptionKey]=e.parameters.getProperty($e.SpeechServiceConnection_Key,void 0),this.privRestAdapter=new(0,Vr.RestMessageAdapter)(n)}getVoicesList(e){return this.privRestAdapter.setHeaders(Fe.ConnectionId,e),this.privRestAdapter.request(Vr.RestRequestType.Get,this.privUri)}}(Wn=Gn||(Gn={}))[Wn.Standard=0]="Standard",Wn[Wn.Custom=1]="Custom";class Xn{constructor(e,t){this.privSynthesisServiceType=Gn.Standard,this.privSpeechServiceConfig=e||new dt(new ft(null)),this.privParameters=t}get parameters(){return this.privParameters}get synthesisServiceType(){return this.privSynthesisServiceType}set synthesisServiceType(e){this.privSynthesisServiceType=e}get SpeechServiceConfig(){return this.privSpeechServiceConfig}}class Qn{constructor(e){this.privContext={},this.privSpeechSynthesizer=e}setSection(e,t){this.privContext[e]=t}set audioOutputFormat(e){this.privAudioOutputFormat=e}toJSON(){const e=this.buildSynthesisContext();return this.setSection("synthesis",e),JSON.stringify(this.privContext)}buildSynthesisContext(){return{audio:{metadataOptions:{bookmarkEnabled:!!this.privSpeechSynthesizer.bookmarkReached,sentenceBoundaryEnabled:!1,visemeEnabled:!!this.privSpeechSynthesizer.visemeReceived,wordBoundaryEnabled:!!this.privSpeechSynthesizer.wordBoundary},outputFormat:this.privAudioOutputFormat.requestAudioFormatString},language:{autoDetection:this.privSpeechSynthesizer.autoDetectSourceLanguage}}}}(qn=Vn||(Vn={}))[qn.TextIndependentIdentification=0]="TextIndependentIdentification",qn[qn.TextDependentVerification=1]="TextDependentVerification",qn[qn.TextIndependentVerification=2]="TextIndependentVerification";const Yn="OutputFormat",Zn="CancellationErrorCode",er="ServiceProperties",tr="ForceDictation";var nr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class rr{constructor(e,t,n,r){this.privRecorder=e,this.deviceId=t,this.privStreams={},this.turnOn=()=>{if(this.privInitializeDeferral)return this.privInitializeDeferral.promise;this.privInitializeDeferral=new oe;try{this.createAudioContext()}catch(e){if(e instanceof Error){const t=e;this.privInitializeDeferral.reject(t.name+": "+t.message)}else this.privInitializeDeferral.reject(e);return this.privInitializeDeferral.promise}const e=window.navigator;let t=e.getUserMedia||e.webkitGetUserMedia||e.mozGetUserMedia||e.msGetUserMedia;if(e.mediaDevices&&(t=(t,n,r)=>{e.mediaDevices.getUserMedia(t).then(n).catch(r)}),t){const e=()=>{this.onEvent(new P(this.privId)),this.privMediaStream&&this.privMediaStream.active?(this.onEvent(new N(this.privId)),this.privInitializeDeferral.resolve()):t({audio:!this.deviceId||{deviceId:this.deviceId},video:!1},(e=>{this.privMediaStream=e,this.onEvent(new N(this.privId)),this.privInitializeDeferral.resolve()}),(e=>{const t=`Error occurred during microphone initialization: ${e}`;this.privInitializeDeferral.reject(t),this.onEvent(new B(this.privId,t))}))};"suspended"===this.privContext.state?this.privContext.resume().then(e).catch((e=>{this.privInitializeDeferral.reject(`Failed to initialize audio context: ${e}`)})):e()}else{const e="Browser does not support getUserMedia.";this.privInitializeDeferral.reject(e),this.onEvent(new B(e,""))}return this.privInitializeDeferral.promise},this.id=()=>this.privId,this.attach=e=>(this.onEvent(new j(this.privId,e)),this.listen(e).then((t=>(this.onEvent(new F(this.privId,e)),{detach:()=>nr(this,void 0,void 0,(function*(){return t.readEnded(),delete this.privStreams[e],this.onEvent(new z(this.privId,e)),this.turnOff()})),id:()=>e,read:()=>t.read()})))),this.detach=e=>{e&&this.privStreams[e]&&(this.privStreams[e].close(),delete this.privStreams[e],this.onEvent(new z(this.privId,e)))},this.listen=e=>nr(this,void 0,void 0,(function*(){yield this.turnOn();const t=new ye(this.privOutputChunkSize,e);this.privStreams[e]=t;try{this.privRecorder.record(this.privContext,this.privMediaStream,t)}catch(t){throw this.onEvent(new U(this.privId,e,t)),t}return t})),this.onEvent=e=>{this.privEvents.onEvent(e),re.instance.onEvent(e)},this.createAudioContext=()=>{this.privContext||(this.privContext=dn.getAudioContext(rr.AUDIOFORMAT.samplesPerSec))},this.privOutputChunkSize=rr.AUDIOFORMAT.avgBytesPerSec/10,this.privId=n||S(),this.privEvents=new ne,this.privMediaStream=r||null,this.privIsClosing=!1}get format(){return Promise.resolve(rr.AUDIOFORMAT)}get blob(){return Promise.reject("Not implemented for Mic input")}turnOff(){return nr(this,void 0,void 0,(function*(){for(const e in this.privStreams)if(e){const t=this.privStreams[e];t&&t.close()}this.onEvent(new L(this.privId)),this.privInitializeDeferral&&(yield this.privInitializeDeferral,this.privInitializeDeferral=null),yield this.destroyAudioContext()}))}get events(){return this.privEvents}get deviceInfo(){return this.getMicrophoneLabel().then((e=>({bitspersample:rr.AUDIOFORMAT.bitsPerSample,channelcount:rr.AUDIOFORMAT.channels,connectivity:ot.Unknown,manufacturer:"Speech SDK",model:e,samplerate:rr.AUDIOFORMAT.samplesPerSec,type:at.Microphones})))}setProperty(e,t){if("MICROPHONE-WorkletSourceUrl"!==e)throw new Error("Property '"+e+"' is not supported on Microphone.");this.privRecorder.setWorkletUrl(t)}getMicrophoneLabel(){const e="microphone";if(void 0!==this.privMicrophoneLabel)return Promise.resolve(this.privMicrophoneLabel);if(void 0===this.privMediaStream||!this.privMediaStream.active)return Promise.resolve(e);this.privMicrophoneLabel=e;const t=this.privMediaStream.getTracks()[0].getSettings().deviceId;if(void 0===t)return Promise.resolve(this.privMicrophoneLabel);const n=new oe;return navigator.mediaDevices.enumerateDevices().then((e=>{for(const n of e)if(n.deviceId===t){this.privMicrophoneLabel=n.label;break}n.resolve(this.privMicrophoneLabel)}),(()=>n.resolve(this.privMicrophoneLabel))),n.promise}destroyAudioContext(){return nr(this,void 0,void 0,(function*(){if(!this.privContext)return;this.privRecorder.releaseMediaResources(this.privContext);let e=!1;"close"in this.privContext&&(e=!0),e?this.privIsClosing||(this.privIsClosing=!0,yield this.privContext.close(),this.privContext=null,this.privIsClosing=!1):null!==this.privContext&&"running"===this.privContext.state&&(yield this.privContext.suspend())}))}}rr.AUDIOFORMAT=un.getDefaultInputFormat();var or={};e(or,"FileAudioSource",(()=>ar),(e=>ar=e));var ir=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class ar{constructor(e,t,n){this.privStreams={},this.privHeaderEnd=44,this.turnOn=()=>{if(this.privFilename.lastIndexOf(".wav")!==this.privFilename.length-4){const e=this.privFilename+" is not supported. Only WAVE files are allowed at the moment.";return this.onEvent(new B(e,"")),Promise.reject(e)}this.onEvent(new P(this.privId)),this.onEvent(new N(this.privId))},this.id=()=>this.privId,this.attach=e=>ir(this,void 0,void 0,(function*(){this.onEvent(new j(this.privId,e));const t=yield this.upload(e);return this.onEvent(new F(this.privId,e)),Promise.resolve({detach:()=>ir(this,void 0,void 0,(function*(){t.readEnded(),delete this.privStreams[e],this.onEvent(new z(this.privId,e)),yield this.turnOff()})),id:()=>e,read:()=>t.read()})})),this.detach=e=>{e&&this.privStreams[e]&&(this.privStreams[e].close(),delete this.privStreams[e],this.onEvent(new z(this.privId,e)))},this.turnOff=()=>{for(const e in this.privStreams)if(e){const t=this.privStreams[e];t&&!t.isClosed&&t.close()}return this.onEvent(new L(this.privId)),Promise.resolve()},this.onEvent=e=>{this.privEvents.onEvent(e),re.instance.onEvent(e)},this.privId=n||S(),this.privEvents=new ne,this.privSource=e,"undefined"!=typeof window&&"undefined"!=typeof Blob&&this.privSource instanceof Blob?this.privFilename=e.name:this.privFilename=t||"unknown.wav",this.privAudioFormatPromise=this.readHeader()}get format(){return this.privAudioFormatPromise}get blob(){return Promise.resolve(this.privSource)}get events(){return this.privEvents}get deviceInfo(){return this.privAudioFormatPromise.then((e=>Promise.resolve({bitspersample:e.bitsPerSample,channelcount:e.channels,connectivity:ot.Unknown,manufacturer:"Speech SDK",model:"File",samplerate:e.samplesPerSec,type:at.File})))}readHeader(){const e=this.privSource.slice(0,512),t=new oe,n=e=>{const n=new DataView(e),r=e=>String.fromCharCode(n.getUint8(e),n.getUint8(e+1),n.getUint8(e+2),n.getUint8(e+3));if("RIFF"!==r(0))return void t.reject("Invalid WAV header in file, RIFF was not found");if("WAVE"!==r(8)||"fmt "!==r(12))return void t.reject("Invalid WAV header in file, WAVEfmt was not found");const o=n.getInt32(16,!0),i=n.getUint16(22,!0),a=n.getUint32(24,!0),s=n.getUint16(34,!0);let l=36+Math.max(o-16,0);for(;"data"!==r(l);l+=2)if(l>504)return void t.reject("Invalid WAV header in file, data block was not found");this.privHeaderEnd=l+8,t.resolve(un.getWaveFormatPCM(a,s,i))};if("undefined"!=typeof window&&"undefined"!=typeof Blob&&e instanceof Blob){const t=new FileReader;t.onload=e=>{const t=e.target.result;n(t)},t.readAsArrayBuffer(e)}else{const t=e;n(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength))}return t.promise}upload(e){return ir(this,void 0,void 0,(function*(){const t=t=>{const n=`Error occurred while processing '${this.privFilename}'. ${t}`;throw this.onEvent(new U(this.privId,e,n)),new Error(n)};try{yield this.turnOn();const n=yield this.privAudioFormatPromise,r=new ye(n.avgBytesPerSec/10,e);this.privStreams[e]=r;const o=this.privSource.slice(this.privHeaderEnd),i=e=>{r.isClosed||(r.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()}),r.close())};if("undefined"!=typeof window&&"undefined"!=typeof Blob&&o instanceof Blob){const e=new FileReader;e.onerror=e=>{t(e.toString())},e.onload=e=>{const t=e.target.result;i(t)},e.readAsArrayBuffer(o)}else{const e=o;i(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}return r}catch(e){t(e)}}))}}class sr{constructor(e){this.record=(e,t,n)=>{const r=new he(e.sampleRate,16e3);let o=!0;const i=e.createMediaStreamSource(t);if(!this.privSpeechProcessorScript){const e=new Blob(["class SP extends AudioWorkletProcessor {\n constructor(options) {\n super(options);\n }\n process(inputs, outputs) {\n const input = inputs[0];\n const output = [];\n for (let channel = 0; channel < input.length; channel += 1) {\n output[channel] = input[channel];\n }\n this.port.postMessage(output[0]);\n return true;\n }\n }\n registerProcessor('speech-processor', SP);"],{type:"application/javascript; charset=utf-8"});this.privSpeechProcessorScript=URL.createObjectURL(e)}const a=()=>{const a=(()=>{let t=0;try{return e.createScriptProcessor(t,1,1)}catch(n){t=2048;let r=e.sampleRate;for(;t<16384&&r>=32e3;)t<<=1,r>>=1;return e.createScriptProcessor(t,1,1)}})();a.onaudioprocess=e=>{const t=e.inputBuffer.getChannelData(0);if(n&&!n.isClosed){const e=r.encode(t);e&&(n.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()}),o=!1)}},i.connect(a),a.connect(e.destination),this.privMediaResources={scriptProcessorNode:a,source:i,stream:t}};if(this.privSpeechProcessorScript&&e.audioWorklet)e.audioWorklet.addModule(this.privSpeechProcessorScript).then((()=>{const a=new AudioWorkletNode(e,"speech-processor");a.port.onmessage=e=>{const t=e.data;if(n&&!n.isClosed){const e=r.encode(t);e&&(n.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()}),o=!1)}},i.connect(a),a.connect(e.destination),this.privMediaResources={scriptProcessorNode:a,source:i,stream:t}})).catch((()=>{a()}));else try{a()}catch(e){throw new Error(`Unable to start audio worklet node for PCMRecorder: ${e}`)}},this.releaseMediaResources=e=>{this.privMediaResources&&(this.privMediaResources.scriptProcessorNode&&(this.privMediaResources.scriptProcessorNode.disconnect(e.destination),this.privMediaResources.scriptProcessorNode=null),this.privMediaResources.source&&(this.privMediaResources.source.disconnect(),this.privStopInputOnRelease&&this.privMediaResources.stream.getTracks().forEach((e=>e.stop())),this.privMediaResources.source=null))},this.privStopInputOnRelease=e}setWorkletUrl(e){this.privSpeechProcessorScript=e}}var lr={};e(lr,"WebsocketConnection",(()=>Ur),(e=>Ur=e));var cr={};e(cr,"WebsocketMessageAdapter",(()=>Fr),(e=>Fr=e));var ur=a("1DJXa"),dr={};e(dr,"CertCheckAgent",(()=>Dr),(e=>Dr=e));var fr,hr;ur=a("1DJXa");hr=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e};var pr,mr,gr={};e(gr,"stringify",(()=>pr),(e=>pr=e)),e(gr,"parse",(()=>mr),(e=>mr=e));var vr=Object.prototype.hasOwnProperty;function br(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function yr(e){try{return encodeURIComponent(e)}catch(e){return null}}pr=function(e,t){t=t||"";var n,r,o=[];for(r in"string"!=typeof t&&(t="?"),e)if(vr.call(e,r)){if((n=e[r])||null!=n&&!isNaN(n)||(n=""),r=yr(r),n=yr(n),null===r||null===n)continue;o.push(r+"="+n)}return o.length?t+o.join("&"):""},mr=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var o=br(t[1]),i=br(t[2]);null===o||null===i||o in r||(r[o]=i)}return r};var wr=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,xr=/[\n\r\t]/g,Sr=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Mr=/:\d+$/,_r=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,Er=/^[a-zA-Z]:/;function Ar(e){return(e||"").toString().replace(wr,"")}var Cr=[["#","hash"],["?","query"],function(e,t){return Ir(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],kr={hash:1,query:1};function Tr(e){var n,r=("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{}).location||{},o={},i=typeof(e=e||r);if("blob:"===e.protocol)o=new Rr(unescape(e.pathname),{});else if("string"===i)for(n in o=new Rr(e,{}),kr)delete o[n];else if("object"===i){for(n in e)n in kr||(o[n]=e[n]);void 0===o.slashes&&(o.slashes=Sr.test(e.href))}return o}function Ir(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function Or(e,t){e=(e=Ar(e)).replace(xr,""),t=t||{};var n,r=_r.exec(e),o=r[1]?r[1].toLowerCase():"",i=!!r[2],a=!!r[3],s=0;return i?a?(n=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(n=r[2]+r[4],s=r[2].length):a?(n=r[3]+r[4],s=r[3].length):n=r[4],"file:"===o?s>=2&&(n=n.slice(2)):Ir(o)?n=r[4]:o?i&&(n=n.slice(2)):s>=2&&Ir(t.protocol)&&(n=r[4]),{protocol:o,slashes:i||Ir(o),slashesCount:s,rest:n}}function Rr(e,t,n){if(e=(e=Ar(e)).replace(xr,""),!(this instanceof Rr))return new Rr(e,t,n);var r,o,i,a,s,l,c=Cr.slice(),u=typeof t,d=this,f=0;for("object"!==u&&"string"!==u&&(n=t,t=null),n&&"function"!=typeof n&&(n=gr.parse),r=!(o=Or(e||"",t=Tr(t))).protocol&&!o.slashes,d.slashes=o.slashes||r&&t.slashes,d.protocol=o.protocol||t.protocol||"",e=o.rest,("file:"===o.protocol&&(2!==o.slashesCount||Er.test(e))||!o.slashes&&(o.protocol||o.slashesCount<2||!Ir(d.protocol)))&&(c[3]=[/(.*)/,"pathname"]);f<c.length;f++)"function"!=typeof(a=c[f])?(i=a[0],l=a[1],i!=i?d[l]=e:"string"==typeof i?~(s="@"===i?e.lastIndexOf(i):e.indexOf(i))&&("number"==typeof a[2]?(d[l]=e.slice(0,s),e=e.slice(s+a[2])):(d[l]=e.slice(s),e=e.slice(0,s))):(s=i.exec(e))&&(d[l]=s[1],e=e.slice(0,s.index)),d[l]=d[l]||r&&a[3]&&t[l]||"",a[4]&&(d[l]=d[l].toLowerCase())):e=a(e,d);n&&(d.query=n(d.query)),r&&t.slashes&&"/"!==d.pathname.charAt(0)&&(""!==d.pathname||""!==t.pathname)&&(d.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],i=!1,a=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),a++):a&&(0===r&&(i=!0),n.splice(r,1),a--);return i&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(d.pathname,t.pathname)),"/"!==d.pathname.charAt(0)&&Ir(d.protocol)&&(d.pathname="/"+d.pathname),hr(d.port,d.protocol)||(d.host=d.hostname,d.port=""),d.username=d.password="",d.auth&&(~(s=d.auth.indexOf(":"))?(d.username=d.auth.slice(0,s),d.username=encodeURIComponent(decodeURIComponent(d.username)),d.password=d.auth.slice(s+1),d.password=encodeURIComponent(decodeURIComponent(d.password))):d.username=encodeURIComponent(decodeURIComponent(d.auth)),d.auth=d.password?d.username+":"+d.password:d.username),d.origin="file:"!==d.protocol&&Ir(d.protocol)&&d.host?d.protocol+"//"+d.host:"null",d.href=d.toString()}Rr.prototype={set:function(e,t,n){var r=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||gr.parse)(t)),r[e]=t;break;case"port":r[e]=t,hr(t,r.protocol)?t&&(r.host=r.hostname+":"+t):(r.host=r.hostname,r[e]="");break;case"hostname":r[e]=t,r.port&&(t+=":"+r.port),r.host=t;break;case"host":r[e]=t,Mr.test(t)?(t=t.split(":"),r.port=t.pop(),r.hostname=t.join(":")):(r.hostname=t,r.port="");break;case"protocol":r.protocol=t.toLowerCase(),r.slashes=!n;break;case"pathname":case"hash":if(t){var o="pathname"===e?"/":"#";r[e]=t.charAt(0)!==o?o+t:t}else r[e]=t;break;case"username":case"password":r[e]=encodeURIComponent(t);break;case"auth":var i=t.indexOf(":");~i?(r.username=t.slice(0,i),r.username=encodeURIComponent(decodeURIComponent(r.username)),r.password=t.slice(i+1),r.password=encodeURIComponent(decodeURIComponent(r.password))):r.username=encodeURIComponent(decodeURIComponent(t))}for(var a=0;a<Cr.length;a++){var s=Cr[a];s[4]&&(r[s[1]]=r[s[1]].toLowerCase())}return r.auth=r.password?r.username+":"+r.password:r.username,r.origin="file:"!==r.protocol&&Ir(r.protocol)&&r.host?r.protocol+"//"+r.host:"null",r.href=r.toString(),r},toString:function(e){e&&"function"==typeof e||(e=gr.stringify);var t,n=this,r=n.host,o=n.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var i=o+(n.protocol&&n.slashes||Ir(n.protocol)?"//":"");return n.username?(i+=n.username,n.password&&(i+=":"+n.password),i+="@"):n.password?(i+=":"+n.password,i+="@"):"file:"!==n.protocol&&Ir(n.protocol)&&!r&&"/"!==n.pathname&&(i+="@"),(":"===r[r.length-1]||Mr.test(n.hostname)&&!n.port)&&(r+=":"),i+=r+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},Rr.extractProtocol=Or,Rr.location=Tr,Rr.trimLeft=Ar,Rr.qs=gr,fr=Rr;var Pr=a("5U18c"),Nr=(ur=a("1DJXa"),ur=a("1DJXa"),ur=a("1DJXa"),ur=a("1DJXa"),a("bqBrJ").Buffer),Lr=a("ePtPP"),Br=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class Dr{constructor(e){e&&(this.privProxyInfo=e),Dr.privDiskCache||(Dr.privDiskCache=new(r(ur))("microsoft-cognitiveservices-speech-sdk-cache",{supportBuffer:!0,location:void 0}))}static forceReinitDiskCache(){Dr.privDiskCache=void 0,Dr.privMemCache={}}GetAgent(e){const t=new(r(ur).Agent)(this.CreateConnection);if(void 0!==this.privProxyInfo&&void 0!==this.privProxyInfo.HostName&&this.privProxyInfo.Port>0){t["privProxyInfo"]=this.privProxyInfo}return t}static GetProxyAgent(e){const t={host:e.HostName,port:e.Port};e.UserName?t.headers={"Proxy-Authentication":"Basic "+new Nr(e.UserName+":"+(void 0===e.Password)?"":e.Password).toString("base64")}:t.headers={},t.headers.requestOCSP="true";return new(r(ur))(t)}static OCSPCheck(e,t){return Br(this,void 0,void 0,(function*(){let n,r,o=!1;const i=yield e;i.cork();const a=i;return new Promise(((e,s)=>{i.on("OCSPResponse",(e=>{e&&(this.onEvent(new Te),r=e)})),i.on("error",(e=>{o||(o=!0,i.destroy(),s(e))})),a.on("secure",(()=>Br(this,void 0,void 0,(function*(){const l=a.getPeerCertificate(!0);try{const a=yield this.GetIssuer(l);n=Pr.request.generate(l.raw,a.raw);const s=n.id.toString("hex");if(!r){const e=yield Dr.GetResponseFromCache(s,n,t);r=e}yield this.VerifyOCSPResponse(r,n,t),i.uncork(),o=!0,e(i)}catch(e){i.destroy(),o=!0,s(e)}}))))}))}))}static GetIssuer(e){return e.issuerCertificate?Promise.resolve(e.issuerCertificate):new Promise(((t,n)=>{new Pr.Agent({}).fetchIssuer(e,null,((e,r)=>{e?n(e):t(r)}))}))}static GetResponseFromCache(e,t,n){return Br(this,void 0,void 0,(function*(){let r=Dr.privMemCache[e];if(r&&this.onEvent(new Se(e)),!r)try{const t=yield Dr.privDiskCache.get(e);t.isCached&&(Dr.onEvent(new _e(e)),Dr.StoreMemoryCacheEntry(e,t.value),r=t.value)}catch(e){r=null}if(!r)return r;try{const o=Pr.utils.parseResponse(r).value.tbsResponseData;if(o.responses.length<1)return void this.onEvent(new Ne(e,"Not enough data in cached response"));const i=o.responses[0].thisUpdate,a=o.responses[0].nextUpdate;if(a<Date.now()+this.testTimeOffset-6e4)this.onEvent(new Ie(e,a)),r=null;else{const r=Math.min(864e5,(a-i)/2);a-(Date.now()+this.testTimeOffset)<r?(this.onEvent(new Oe(e,i,a)),this.UpdateCache(t,n).catch((t=>{this.onEvent(new Be(e,t.toString()))}))):this.onEvent(new Re(e,i,a))}}catch(t){this.onEvent(new Ne(e,t)),r=null}return r||this.onEvent(new Me(e)),r}))}static VerifyOCSPResponse(e,t,n){return Br(this,void 0,void 0,(function*(){let r=e;t.certID.toString("hex");return r||(r=yield Dr.GetOCSPResponse(t,n)),new Promise(((o,i)=>{Pr.verify({request:t,response:r},((a,s)=>{a?(Dr.onEvent(new Pe(t.id.toString("hex"),a)),e?this.VerifyOCSPResponse(null,t,n).then((()=>{o()}),(e=>{i(e)})):i(a)):(e||Dr.StoreCacheEntry(t.id.toString("hex"),r),o())}))}))}))}static UpdateCache(e,t){return Br(this,void 0,void 0,(function*(){const n=e.id.toString("hex");this.onEvent(new Ee(n));const r=yield this.GetOCSPResponse(e,t);this.StoreCacheEntry(n,r),this.onEvent(new ke(e.id.toString("hex")))}))}static StoreCacheEntry(e,t){this.StoreMemoryCacheEntry(e,t),this.StoreDiskCacheEntry(e,t)}static StoreMemoryCacheEntry(e,t){this.privMemCache[e]=t,this.onEvent(new Ae(e))}static StoreDiskCacheEntry(e,t){this.privDiskCache.set(e,t).then((()=>{this.onEvent(new Ce(e))}))}static GetOCSPResponse(e,t){let n={};if(t){const e=Dr.GetProxyAgent(t);n.agent=e}return new Promise(((t,o)=>{Pr.utils.getAuthorityInfo(e.cert,"1.3.6.1.5.5.7.48.1",((i,a)=>{if(i)return void o(i);const s=r(fr)(a);s.path=s.pathname,n=Object.assign(Object.assign({},n),s),Pr.utils.getResponse(n,e.data,((n,r)=>{n?o(n):(this.onEvent(new Le(e.certID.toString("hex"))),t(r))}))}))}))}CreateConnection(e,t){const n=void 0!==Lr&&t.secureEndpoint;let r;if(t=Object.assign(Object.assign({},t),{requestOCSP:!Dr.forceDisableOCSPStapling,servername:t.host}),this.privProxyInfo){const n=Dr.GetProxyAgent(this.privProxyInfo);r=new Promise(((r,o)=>{n.callback(e,t,((e,t)=>{e?o(e):r(t)}))}))}else r=(t.secureEndpoint,Promise.resolve(ur.connect(t)));return n?Dr.OCSPCheck(r,this.privProxyInfo):r}}Dr.testTimeOffset=0,Dr.forceDisableOCSPStapling=!1,Dr.privMemCache={},Dr.onEvent=e=>{re.instance.onEvent(e)};var jr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class Fr{constructor(e,t,n,o,i,a){if(this.open=()=>{if(this.privConnectionState===C.Disconnected)return Promise.reject(`Cannot open a connection that is in ${this.privConnectionState} state`);if(this.privConnectionEstablishDeferral)return this.privConnectionEstablishDeferral.promise;this.privConnectionEstablishDeferral=new oe,this.privCertificateValidatedDeferral=new oe,this.privConnectionState=C.Connecting;try{if("undefined"==typeof WebSocket||Fr.forceNpmWebSocket){const e={headers:this.privHeaders,perMessageDeflate:this.privEnableCompression};this.privCertificateValidatedDeferral.resolve();const t=new(0,dr.CertCheckAgent)(this.proxyInfo);e.agent=t.GetAgent();let n=new URL(this.privUri).protocol;"wss:"===(null==n?void 0:n.toLocaleLowerCase())?n="https:":"ws:"===(null==n?void 0:n.toLocaleLowerCase())&&(n="http:"),e.agent.protocol=n,this.privWebsocketClient=new(r(ur))(this.privUri,e)}else this.privCertificateValidatedDeferral.resolve(),this.privWebsocketClient=new WebSocket(this.privUri);this.privWebsocketClient.binaryType="arraybuffer",this.privReceivingMessageQueue=new(0,ae.Queue),this.privDisconnectDeferral=new oe,this.privSendMessageQueue=new(0,ae.Queue),this.processSendQueue().catch((e=>{re.instance.onEvent(new De(e))}))}catch(e){return this.privConnectionEstablishDeferral.resolve(new te(500,e)),this.privConnectionEstablishDeferral.promise}return this.onEvent(new W(this.privConnectionId,this.privUri)),this.privWebsocketClient.onopen=e=>{this.privCertificateValidatedDeferral.promise.then((()=>{this.privConnectionState=C.Connected,this.onEvent(new V(this.privConnectionId)),this.privConnectionEstablishDeferral.resolve(new te(200,""))}),(e=>{this.privConnectionEstablishDeferral.reject(e)}))},this.privWebsocketClient.onerror=e=>{this.onEvent(new K(this.privConnectionId,e.message,e.type)),this.privLastErrorReceived=e.message},this.privWebsocketClient.onclose=e=>{this.privConnectionState===C.Connecting?(this.privConnectionState=C.Disconnected,this.privConnectionEstablishDeferral.resolve(new te(e.code,e.reason+" "+this.privLastErrorReceived))):(this.privConnectionState=C.Disconnected,this.privWebsocketClient=null,this.onEvent(new q(this.privConnectionId,e.code,e.reason))),this.onClose(e.code,e.reason).catch((e=>{re.instance.onEvent(new De(e))}))},this.privWebsocketClient.onmessage=e=>{const t=(new Date).toISOString();if(this.privConnectionState===C.Connected){const n=new oe;if(this.privReceivingMessageQueue.enqueueFromPromise(n.promise),e.data instanceof ArrayBuffer){const r=new fe(E.Binary,e.data);this.privMessageFormatter.toConnectionMessage(r).then((e=>{this.onEvent(new J(this.privConnectionId,t,e)),n.resolve(e)}),(e=>{n.reject(`Invalid binary message format. Error: ${e}`)}))}else{const r=new fe(E.Text,e.data);this.privMessageFormatter.toConnectionMessage(r).then((e=>{this.onEvent(new J(this.privConnectionId,t,e)),n.resolve(e)}),(e=>{n.reject(`Invalid text message format. Error: ${e}`)}))}}},this.privConnectionEstablishDeferral.promise},this.send=e=>{if(this.privConnectionState!==C.Connected)return Promise.reject(`Cannot send on connection that is in ${C[this.privConnectionState]} state`);const t=new oe,n=new oe;return this.privSendMessageQueue.enqueueFromPromise(n.promise),this.privMessageFormatter.fromConnectionMessage(e).then((r=>{n.resolve({Message:e,RawWebsocketMessage:r,sendStatusDeferral:t})}),(e=>{n.reject(`Error formatting the message. ${e}`)})),t.promise},this.read=()=>this.privConnectionState!==C.Connected?Promise.reject(`Cannot read on connection that is in ${this.privConnectionState} state`):this.privReceivingMessageQueue.dequeue(),this.close=e=>this.privWebsocketClient?(this.privConnectionState!==C.Disconnected&&this.privWebsocketClient.close(1e3,e||"Normal closure by client"),this.privDisconnectDeferral.promise):Promise.resolve(),this.sendRawMessage=e=>{try{return e?(this.onEvent(new X(this.privConnectionId,(new Date).toISOString(),e.Message)),this.isWebsocketOpen?(this.privWebsocketClient.send(e.RawWebsocketMessage.payload),Promise.resolve()):Promise.reject("websocket send error: Websocket not ready "+this.privConnectionId+" "+e.Message.id+" "+(new Error).stack)):Promise.resolve()}catch(e){return Promise.reject(`websocket send error: ${e}`)}},this.onEvent=e=>{this.privConnectionEvents.onEvent(e),re.instance.onEvent(e)},!e)throw new Q("uri");if(!n)throw new Q("messageFormatter");this.proxyInfo=o,this.privConnectionEvents=new ne,this.privConnectionId=t,this.privMessageFormatter=n,this.privConnectionState=C.None,this.privUri=e,this.privHeaders=i,this.privEnableCompression=a,this.privHeaders[Fe.ConnectionId]=this.privConnectionId,this.privLastErrorReceived=""}get state(){return this.privConnectionState}get events(){return this.privConnectionEvents}onClose(e,t){return jr(this,void 0,void 0,(function*(){const n=`Connection closed. ${e}: ${t}`;this.privConnectionState=C.Disconnected,this.privDisconnectDeferral.resolve(),yield this.privReceivingMessageQueue.drainAndDispose((e=>{}),n),yield this.privSendMessageQueue.drainAndDispose((e=>{e.sendStatusDeferral.reject(n)}),n)}))}processSendQueue(){return jr(this,void 0,void 0,(function*(){for(;;){const e=this.privSendMessageQueue.dequeue(),t=yield e;if(!t)return;try{yield this.sendRawMessage(t),t.sendStatusDeferral.resolve()}catch(e){t.sendStatusDeferral.reject(e)}}}))}get isWebsocketOpen(){return this.privWebsocketClient&&this.privWebsocketClient.readyState===this.privWebsocketClient.OPEN}}Fr.forceNpmWebSocket=!1;var zr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class Ur{constructor(e,t,n,r,o,i=!1,a){if(this.privIsDisposed=!1,this.isDisposed=()=>this.privIsDisposed,this.state=()=>this.privConnectionMessageAdapter.state,this.open=()=>this.privConnectionMessageAdapter.open(),this.send=e=>this.privConnectionMessageAdapter.send(e),this.read=()=>this.privConnectionMessageAdapter.read(),!e)throw new Q("uri");if(!r)throw new Q("messageFormatter");this.privMessageFormatter=r;let s="",l=0;if(t)for(const n in t)if(n){s+=0===l&&-1===e.indexOf("?")?"?":"&";s+=`${n}=${encodeURIComponent(t[n])}`,l++}if(n)for(const t in n)if(t){s+=0===l&&-1===e.indexOf("?")?"?":"&";s+=`${t}=${encodeURIComponent(n[t])}`,l++}this.privUri=e+s,this.privId=a||S(),this.privConnectionMessageAdapter=new(0,cr.WebsocketMessageAdapter)(this.privUri,this.id,this.privMessageFormatter,o,n,i)}dispose(){return zr(this,void 0,void 0,(function*(){this.privIsDisposed=!0,this.privConnectionMessageAdapter&&(yield this.privConnectionMessageAdapter.close())}))}get id(){return this.privId}get events(){return this.privConnectionMessageAdapter.events}}class Hr{constructor(e,t){this.privBuffers=[],this.privReplayOffset=0,this.privLastShrinkOffset=0,this.privBufferStartOffset=0,this.privBufferSerial=0,this.privBufferedBytes=0,this.privReplay=!1,this.privLastChunkAcquiredTime=0,this.id=()=>this.privAudioNode.id(),this.privAudioNode=e,this.privBytesPerSecond=t}read(){if(this.privReplay&&0!==this.privBuffers.length){const e=this.privReplayOffset-this.privBufferStartOffset;let t=Math.round(e*this.privBytesPerSecond*1e-7);0!=t%2&&t++;let n=0;for(;n<this.privBuffers.length&&t>=this.privBuffers[n].chunk.buffer.byteLength;)t-=this.privBuffers[n++].chunk.buffer.byteLength;if(n<this.privBuffers.length){const e=this.privBuffers[n].chunk.buffer.slice(t);return this.privReplayOffset+=e.byteLength/this.privBytesPerSecond*1e7,n===this.privBuffers.length-1&&(this.privReplay=!1),Promise.resolve({buffer:e,isEnd:!1,timeReceived:this.privBuffers[n].chunk.timeReceived})}}return this.privAudioNode.read().then((e=>(e&&e.buffer&&(this.privBuffers.push(new Gr(e,this.privBufferSerial++,this.privBufferedBytes)),this.privBufferedBytes+=e.buffer.byteLength),e)))}detach(){return this.privBuffers=void 0,this.privAudioNode.detach()}replay(){this.privBuffers&&0!==this.privBuffers.length&&(this.privReplay=!0,this.privReplayOffset=this.privLastShrinkOffset)}shrinkBuffers(e){if(void 0===this.privBuffers||0===this.privBuffers.length)return;this.privLastShrinkOffset=e;const t=e-this.privBufferStartOffset;let n=Math.round(t*this.privBytesPerSecond*1e-7),r=0;for(;r<this.privBuffers.length&&n>=this.privBuffers[r].chunk.buffer.byteLength;)n-=this.privBuffers[r++].chunk.buffer.byteLength;this.privBufferStartOffset=Math.round(e-n/this.privBytesPerSecond*1e7),this.privBuffers=this.privBuffers.slice(r)}findTimeAtOffset(e){if(e<this.privBufferStartOffset||void 0===this.privBuffers)return 0;for(const t of this.privBuffers){const n=t.byteOffset/this.privBytesPerSecond*1e7,r=n+t.chunk.buffer.byteLength/this.privBytesPerSecond*1e7;if(e>=n&&e<=r)return t.chunk.timeReceived}return 0}}class Gr{constructor(e,t,n){this.chunk=e,this.serial=t,this.byteOffset=n}}class Wr{constructor(e,t,n,r){this.privProxyHostName=e,this.privProxyPort=t,this.privProxyUserName=n,this.privProxyPassword=r}static fromParameters(e){return new Wr(e.getProperty($e.SpeechServiceConnection_ProxyHostName),parseInt(e.getProperty($e.SpeechServiceConnection_ProxyPort),10),e.getProperty($e.SpeechServiceConnection_ProxyUserName),e.getProperty($e.SpeechServiceConnection_ProxyPassword))}static fromRecognizerConfig(e){return this.fromParameters(e.parameters)}get HostName(){return this.privProxyHostName}get Port(){return this.privProxyPort}get UserName(){return this.privProxyUserName}get Password(){return this.privProxyPassword}}var Vr={};e(Vr,"RestRequestType",(()=>Xr),(e=>Xr=e)),e(Vr,"RestMessageAdapter",(()=>Zr),(e=>Zr=e));var qr,Kr;const $r=new Set(["json","buffer","string"]);Kr=e=>(...t)=>{const n=new Set;let r,o,i,a="";return t.forEach((e=>{if("string"==typeof e)if(e.toUpperCase()===e){if(r){throw new Error(`Can't set method to ${e}, already set to ${r}.`)}r=e}else if(e.startsWith("http:")||e.startsWith("https:"))a=e;else{if(!$r.has(e))throw new Error(`Unknown encoding, ${e}`);o=e}else if("number"==typeof e)n.add(e);else{if("object"!=typeof e)throw new Error("Unknown type: "+typeof e);if(Array.isArray(e)||e instanceof Set)e.forEach((e=>n.add(e)));else{if(i)throw new Error("Cannot set headers twice.");i=e}}})),r||(r="GET"),0===n.size&&n.add(200),e(n,r,o,i,a)};class Jr extends Error{constructor(e,...t){let n;super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Jr),this.name="StatusError",this.message=e.statusMessage,this.statusCode=e.status,this.res=e,this.json=e.json.bind(e),this.text=e.text.bind(e),this.arrayBuffer=e.arrayBuffer.bind(e);Object.defineProperty(this,"responseBody",{get:()=>(n||(n=this.arrayBuffer()),n)}),this.headers={};for(const[t,n]of e.headers.entries())this.headers[t.toLowerCase()]=n}}qr=Kr(((e,t,n,r,o)=>async(i,a,s={})=>{i=o+(i||"");let l=new URL(i);if(r||(r={}),l.username&&(r.Authorization="Basic "+btoa(l.username+":"+l.password),l=new URL(l.protocol+"//"+l.host+l.pathname+l.search)),"https:"!==l.protocol&&"http:"!==l.protocol)throw new Error(`Unknown protocol, ${l.protocol}`);if(a)if(a instanceof ArrayBuffer||ArrayBuffer.isView(a)||"string"==typeof a);else{if("object"!=typeof a)throw new Error("Unknown body type.");a=JSON.stringify(a),r["Content-Type"]="application/json"}s=new Headers({...r||{},...s});const c=await fetch(l,{method:t,headers:s,body:a});if(c.statusCode=c.status,!e.has(c.status))throw new Jr(c);return"json"===n?c.json():"buffer"===n?c.arrayBuffer():"string"===n?c.text():c}));var Xr,Qr,Yr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};(Qr=Xr||(Xr={})).Get="GET",Qr.Post="POST",Qr.Delete="DELETE",Qr.File="file";class Zr{constructor(e){if(!e)throw new Q("configParams");this.privHeaders=e.headers,this.privIgnoreCache=e.ignoreCache}static extractHeaderValue(e,t){let n="";try{const r=t.trim().split(/[\r\n]+/),o={};r.forEach((e=>{const t=e.split(": "),n=t.shift().toLowerCase(),r=t.join(": ");o[n]=r})),n=o[e.toLowerCase()]}catch(e){}return n}set options(e){this.privHeaders=e.headers,this.privIgnoreCache=e.ignoreCache}setHeaders(e,t){this.privHeaders[e]=t}request(e,t,n={},o=null,i=null){const a=new oe,s=e===Xr.File?"POST":e,l=(e,t={})=>{const n=e;return{data:JSON.stringify(t),headers:JSON.stringify(e.headers),json:t,ok:e.statusCode>=200&&e.statusCode<300,status:e.statusCode,statusText:t.error?t.error.message:n.statusText?n.statusText:n.statusMessage}},c=o=>{r(qr)(t,s,this.privHeaders,200,201,202,204,400,401,402,403,404)(""===this.queryParams(n)?"":"?"+this.queryParams(n),o).then((t=>Yr(this,void 0,void 0,(function*(){if(e===Xr.Delete||204===t.statusCode)a.resolve(l(t));else try{const e=yield t.json();a.resolve(l(t,e))}catch(e){a.resolve(l(t))}})))).catch((e=>{a.reject(e)}))};if(this.privIgnoreCache&&(this.privHeaders["Cache-Control"]="no-cache"),e===Xr.File&&i){const e="multipart/form-data";this.privHeaders["content-type"]=e,this.privHeaders["Content-Type"]=e,"undefined"!=typeof Blob&&i instanceof Blob?(e=>{const t=new FileReader;return t.readAsArrayBuffer(e),new Promise((e=>{t.onloadend=()=>{e(t.result)}}))})(i).then((e=>{c(e)})).catch((e=>{a.reject(e)})):c(i)}else e===Xr.Post&&o&&(this.privHeaders["content-type"]="application/json",this.privHeaders["Content-Type"]="application/json"),c(o);return a.promise}withQuery(e,t={}){const n=this.queryParams(t);return n?e+(-1===e.indexOf("?")?"?":"&")+n:e}queryParams(e={}){return Object.keys(e).map((t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&")}}class eo{static get requestOptions(){return eo.privDefaultRequestOptions}static get configParams(){return eo.privDefaultParams}static get restErrors(){return eo.privRestErrors}}eo.privDefaultRequestOptions={headers:{Accept:"application/json"},ignoreCache:!1,timeout:1e4},eo.privRestErrors={authInvalidSubscriptionKey:"You must specify either an authentication token to use, or a Cognitive Speech subscription key.",authInvalidSubscriptionRegion:"You must specify the Cognitive Speech region to use.",invalidArgs:"Required input not found: {arg}.",invalidCreateJoinConversationResponse:"Creating/Joining conversation failed with HTTP {status}.",invalidParticipantRequest:"The requested participant was not found.",permissionDeniedConnect:"Required credentials not found.",permissionDeniedConversation:"Invalid operation: only the host can {command} the conversation.",permissionDeniedParticipant:"Invalid operation: only the host can {command} a participant.",permissionDeniedSend:"Invalid operation: the conversation is not in a connected state.",permissionDeniedStart:"Invalid operation: there is already an active conversation."},eo.privDefaultParams={apiVersion:"api-version",authorization:"Authorization",clientAppId:"X-ClientAppId",contentTypeKey:"Content-Type",correlationId:"X-CorrelationId",languageCode:"language",nickname:"nickname",profanity:"profanity",requestId:"X-RequestId",roomId:"roomid",sessionToken:"token",subscriptionKey:"Ocp-Apim-Subscription-Key",subscriptionRegion:"Ocp-Apim-Subscription-Region",token:"X-CapitoToken"};class to{}var no={};e(no,"AudioInputStream",(()=>io),(e=>io=e)),e(no,"PullAudioInputStreamImpl",(()=>co),(e=>co=e));var ro=a("bqBrJ").Buffer,oo=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class io{constructor(){}static createPushStream(e){return ao.create(e)}static createPullStream(e,t){return lo.create(e,t)}}class ao extends io{static create(e){return new so(e)}}class so extends ao{constructor(e){super(),this.onEvent=e=>{this.privEvents.onEvent(e),re.instance.onEvent(e)},this.privFormat=void 0===e?dn.getDefaultInputFormat():e,this.privEvents=new ne,this.privId=S(),this.privStream=new ye(this.privFormat.avgBytesPerSec/10)}get format(){return Promise.resolve(this.privFormat)}write(e){this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}id(){return this.privId}get blob(){return this.attach("id").then((e=>{const t=[];let n=ro.from("");const r=()=>e.read().then((e=>!e||e.isEnd?"undefined"!=typeof XMLHttpRequest&&"undefined"!=typeof Blob?Promise.resolve(new Blob(t)):Promise.resolve(ro.from(n)):("undefined"!=typeof Blob?t.push(e.buffer):n=ro.concat([n,this.toBuffer(e.buffer)]),r())));return r()}))}turnOn(){this.onEvent(new P(this.privId)),this.onEvent(new N(this.privId))}attach(e){return oo(this,void 0,void 0,(function*(){this.onEvent(new j(this.privId,e)),yield this.turnOn();const t=this.privStream;return this.onEvent(new F(this.privId,e)),{detach:()=>oo(this,void 0,void 0,(function*(){return this.onEvent(new z(this.privId,e)),this.turnOff()})),id:()=>e,read:()=>t.read()}}))}detach(e){this.onEvent(new z(this.privId,e))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:ot.Unknown,manufacturer:"Speech SDK",model:"PushStream",samplerate:this.privFormat.samplesPerSec,type:at.Stream})}toBuffer(e){const t=ro.alloc(e.byteLength),n=new Uint8Array(e);for(let e=0;e<t.length;++e)t[e]=n[e];return t}}class lo extends io{constructor(){super()}static create(e,t){return new co(e,t)}}class co extends lo{constructor(e,t){super(),this.onEvent=e=>{this.privEvents.onEvent(e),re.instance.onEvent(e)},this.privFormat=void 0===t?un.getDefaultInputFormat():t,this.privEvents=new ne,this.privId=S(),this.privCallback=e,this.privIsClosed=!1,this.privBufferSize=this.privFormat.avgBytesPerSec/10}get format(){return Promise.resolve(this.privFormat)}close(){this.privIsClosed=!0,this.privCallback.close()}id(){return this.privId}get blob(){return Promise.reject("Not implemented")}turnOn(){this.onEvent(new P(this.privId)),this.onEvent(new N(this.privId))}attach(e){return oo(this,void 0,void 0,(function*(){return this.onEvent(new j(this.privId,e)),yield this.turnOn(),this.onEvent(new F(this.privId,e)),{detach:()=>(this.privCallback.close(),this.onEvent(new z(this.privId,e)),this.turnOff()),id:()=>e,read:()=>{let e,t=0;for(;t<this.privBufferSize;){const n=new ArrayBuffer(this.privBufferSize-t),r=this.privCallback.read(n);if(void 0===e)e=n;else{new Int8Array(e).set(new Int8Array(n),t)}if(0===r)break;t+=r}return Promise.resolve({buffer:e.slice(0,t),isEnd:this.privIsClosed||0===t,timeReceived:Date.now()})}}}))}detach(e){this.onEvent(new z(this.privId,e))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:ot.Unknown,manufacturer:"Speech SDK",model:"PullStream",samplerate:this.privFormat.samplesPerSec,type:at.Stream})}}var uo={};e(uo,"SpeakerAudioDestination",(()=>po),(e=>po=e));var fo=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const ho={[en.PCM]:"audio/wav",[en.MuLaw]:"audio/x-wav",[en.MP3]:"audio/mpeg",[en.OGG_OPUS]:"audio/ogg",[en.WEBM_OPUS]:"audio/webm; codecs=opus",[en.ALaw]:"audio/x-wav",[en.FLAC]:"audio/flac"};class po{constructor(e){this.privPlaybackStarted=!1,this.privAppendingToBuffer=!1,this.privMediaSourceOpened=!1,this.privBytesReceived=0,this.privId=e||S(),this.privIsPaused=!1,this.privIsClosed=!1}id(){return this.privId}write(e,t,n){void 0!==this.privAudioBuffer?(this.privAudioBuffer.push(e),this.updateSourceBuffer().then((()=>{t&&t()}),(e=>{n&&n(e)}))):void 0!==this.privAudioOutputStream&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength)}close(e,t){if(this.privIsClosed=!0,void 0!==this.privSourceBuffer)this.handleSourceBufferUpdateEnd().then((()=>{e&&e()}),(e=>{t&&t(e)}));else if(void 0!==this.privAudioOutputStream)if(this.privFormat.formatTag!==en.PCM&&this.privFormat.formatTag!==en.MuLaw&&this.privFormat.formatTag!==en.ALaw||!1!==this.privFormat.hasHeader){let n=new ArrayBuffer(this.privBytesReceived);this.privAudioOutputStream.read(n).then((r=>{n=In.SynthesisAdapterBase.addHeader(n,this.privFormat);const o=new Blob([n],{type:ho[this.privFormat.formatTag]});this.privAudio.src=window.URL.createObjectURL(o),this.notifyPlayback().then((()=>{e&&e()}),(e=>{t&&t(e)}))}),(e=>{t&&t(e)}))}else console.warn("Play back is not supported for raw PCM, mulaw or alaw format without header."),this.onAudioEnd&&this.onAudioEnd(this);else this.onAudioEnd&&this.onAudioEnd(this)}set format(e){if("undefined"!=typeof AudioContext||void 0!==window.webkitAudioContext){this.privFormat=e;const t=ho[this.privFormat.formatTag];void 0===t?console.warn(`Unknown mimeType for format ${en[this.privFormat.formatTag]}; playback is not supported.`):"undefined"!=typeof MediaSource&&MediaSource.isTypeSupported(t)?(this.privAudio=new Audio,this.privAudioBuffer=[],this.privMediaSource=new MediaSource,this.privAudio.src=URL.createObjectURL(this.privMediaSource),this.privAudio.load(),this.privMediaSource.onsourceopen=e=>{this.privMediaSourceOpened=!0,this.privMediaSource.duration=1800,this.privSourceBuffer=this.privMediaSource.addSourceBuffer(t),this.privSourceBuffer.onupdate=e=>{this.updateSourceBuffer().catch((e=>{re.instance.onEvent(new De(e))}))},this.privSourceBuffer.onupdateend=e=>{this.handleSourceBufferUpdateEnd().catch((e=>{re.instance.onEvent(new De(e))}))},this.privSourceBuffer.onupdatestart=e=>{this.privAppendingToBuffer=!1}},this.updateSourceBuffer().catch((e=>{re.instance.onEvent(new De(e))}))):(console.warn(`Format ${en[this.privFormat.formatTag]} could not be played by MSE, streaming playback is not enabled.`),this.privAudioOutputStream=new(0,gn.PullAudioOutputStreamImpl),this.privAudioOutputStream.format=this.privFormat,this.privAudio=new Audio)}}get volume(){return this.privAudio.volume}set volume(e){this.privAudio.volume=e}mute(){this.privAudio.muted=!0}unmute(){this.privAudio.muted=!1}get isClosed(){return this.privIsClosed}get currentTime(){return void 0!==this.privAudio?this.privAudio.currentTime:-1}pause(){this.privIsPaused||void 0===this.privAudio||(this.privAudio.pause(),this.privIsPaused=!0)}resume(e,t){this.privIsPaused&&void 0!==this.privAudio&&(this.privAudio.play().then((()=>{e&&e()}),(e=>{t&&t(e)})),this.privIsPaused=!1)}get internalAudio(){return this.privAudio}updateSourceBuffer(){return fo(this,void 0,void 0,(function*(){if(void 0!==this.privAudioBuffer&&this.privAudioBuffer.length>0&&this.sourceBufferAvailable()){this.privAppendingToBuffer=!0;const e=this.privAudioBuffer.shift();try{this.privSourceBuffer.appendBuffer(e)}catch(t){return this.privAudioBuffer.unshift(e),void console.log("buffer filled, pausing addition of binaries until space is made")}yield this.notifyPlayback()}else this.canEndStream()&&(yield this.handleSourceBufferUpdateEnd())}))}handleSourceBufferUpdateEnd(){return fo(this,void 0,void 0,(function*(){this.canEndStream()&&this.sourceBufferAvailable()&&(this.privMediaSource.endOfStream(),yield this.notifyPlayback())}))}notifyPlayback(){return fo(this,void 0,void 0,(function*(){this.privPlaybackStarted||void 0===this.privAudio||(this.privPlaybackStarted=!0,this.onAudioStart&&this.onAudioStart(this),this.privAudio.onended=()=>{this.onAudioEnd&&this.onAudioEnd(this)},this.privIsPaused||(yield this.privAudio.play()))}))}canEndStream(){return this.isClosed&&void 0!==this.privSourceBuffer&&0===this.privAudioBuffer.length&&this.privMediaSourceOpened&&!this.privAppendingToBuffer&&"open"===this.privMediaSource.readyState}sourceBufferAvailable(){return void 0!==this.privSourceBuffer&&!this.privSourceBuffer.updating}}class mo{}ur=a("1DJXa");class go{constructor(e){this.id=()=>this.privId,Tt.throwIfNullOrUndefined(ur.openSync,"\nFile System access not available, please use Push or PullAudioOutputStream"),this.privFd=ur.openSync(e,"w")}set format(e){Tt.throwIfNotUndefined(this.privAudioFormat,"format is already set"),this.privAudioFormat=e;let t=0;this.privAudioFormat.hasHeader&&(t=this.privAudioFormat.header.byteLength),void 0!==this.privFd&&(this.privWriteStream=ur.createWriteStream("",{fd:this.privFd,start:t,autoClose:!1}))}write(e){Tt.throwIfNullOrUndefined(this.privAudioFormat,"must set format before writing."),void 0!==this.privWriteStream&&this.privWriteStream.write(new Uint8Array(e.slice(0)))}close(){void 0!==this.privFd&&(this.privWriteStream.on("finish",(()=>{this.privAudioFormat.hasHeader&&(this.privAudioFormat.updateHeader(this.privWriteStream.bytesWritten),ur.writeSync(this.privFd,new Int8Array(this.privAudioFormat.header),0,this.privAudioFormat.header.byteLength,0)),ur.closeSync(this.privFd),this.privFd=void 0})),this.privWriteStream.end())}}class vo{static fromDefaultMicrophoneInput(){const e=new sr(!0);return new bo(new(0,je.MicAudioSource)(e))}static fromMicrophoneInput(e){const t=new sr(!0);return new bo(new(0,je.MicAudioSource)(t,e))}static fromWavFileInput(e,t="unnamedBuffer.wav"){return new bo(new(0,or.FileAudioSource)(e,t))}static fromStreamInput(e){if(e instanceof to)return new bo(new(0,no.PullAudioInputStreamImpl)(e));if(e instanceof no.AudioInputStream)return new bo(e);if("undefined"!=typeof MediaStream&&e instanceof MediaStream){const t=new sr(!1);return new bo(new(0,je.MicAudioSource)(t,null,null,e))}throw new Error("Not Supported Type")}static fromDefaultSpeakerOutput(){return new yo(new(0,uo.SpeakerAudioDestination))}static fromSpeakerOutput(e){if(void 0===e)return vo.fromDefaultSpeakerOutput();if(e instanceof uo.SpeakerAudioDestination)return new yo(e);throw new Error("Not Supported Type")}static fromAudioFileOutput(e){return new yo(new go(e))}static fromStreamOutput(e){if(e instanceof mo)return new yo(new(0,gn.PushAudioOutputStreamImpl)(e));if(e instanceof gn.PushAudioOutputStream)return new yo(e);if(e instanceof gn.PullAudioOutputStream)return new yo(e);throw new Error("Not Supported Type")}}class bo extends vo{constructor(e){super(),this.privSource=e}get format(){return this.privSource.format}close(e,t){this.privSource.turnOff().then((()=>{e&&e()}),(e=>{t&&t(e)}))}id(){return this.privSource.id()}get blob(){return this.privSource.blob}turnOn(){return this.privSource.turnOn()}attach(e){return this.privSource.attach(e)}detach(e){return this.privSource.detach(e)}turnOff(){return this.privSource.turnOff()}get events(){return this.privSource.events}setProperty(e,t){if(Tt.throwIfNull(t,"value"),void 0===this.privSource.setProperty)throw new Error("This AudioConfig instance does not support setting properties.");this.privSource.setProperty(e,t)}getProperty(e,t){if(void 0!==this.privSource.getProperty)return this.privSource.getProperty(e,t);throw new Error("This AudioConfig instance does not support getting properties.")}get deviceInfo(){return this.privSource.deviceInfo}}class yo extends vo{constructor(e){super(),this.privDestination=e}set format(e){this.privDestination.format=e}write(e){this.privDestination.write(e)}close(){this.privDestination.close()}id(){return this.privDestination.id()}setProperty(e,t){throw new Error("This AudioConfig instance does not support setting properties.")}getProperty(e,t){throw new Error("This AudioConfig instance does not support getting properties.")}}var wo={};e(wo,"SpeechRecognizer",(()=>Eo),(e=>Eo=e));var xo={};e(xo,"Recognizer",(()=>Mo),(e=>Mo=e));var So=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class Mo{constructor(e,t,n){this.audioConfig=void 0!==e?e:vo.fromDefaultMicrophoneInput(),this.privDisposed=!1,this.privProperties=t.clone(),this.privConnectionFactory=n,this.implCommonRecognizerSetup()}close(e,t){Tt.throwIfDisposed(this.privDisposed),ie(this.dispose(!0),e,t)}get internalData(){return this.privReco}dispose(e){return So(this,void 0,void 0,(function*(){this.privDisposed||(this.privDisposed=!0,e&&this.privReco&&(yield this.privReco.audioSource.turnOff(),yield this.privReco.dispose()))}))}static get telemetryEnabled(){return Xe.ServiceRecognizerBase.telemetryDataEnabled}static enableTelemetry(e){Xe.ServiceRecognizerBase.telemetryDataEnabled=e}implCommonRecognizerSetup(){let e="undefined"!=typeof window?"Browser":"Node",t="unknown",n="unknown";"undefined"!=typeof navigator&&(e=e+"/"+navigator.platform,t=navigator.userAgent,n=navigator.appVersion);const r=this.createRecognizerConfig(new dt(new ft(new pt(e,t,n))));this.privReco=this.createServiceRecognizer(Mo.getAuthFromProperties(this.privProperties),this.privConnectionFactory,this.audioConfig,r)}recognizeOnceAsyncImpl(e){return So(this,void 0,void 0,(function*(){Tt.throwIfDisposed(this.privDisposed);const t=new oe;yield this.implRecognizerStop(),yield this.privReco.recognize(e,t.resolve,t.reject);const n=yield t.promise;return yield this.implRecognizerStop(),n}))}startContinuousRecognitionAsyncImpl(e){return So(this,void 0,void 0,(function*(){Tt.throwIfDisposed(this.privDisposed),yield this.implRecognizerStop(),yield this.privReco.recognize(e,void 0,void 0)}))}stopContinuousRecognitionAsyncImpl(){return So(this,void 0,void 0,(function*(){Tt.throwIfDisposed(this.privDisposed),yield this.implRecognizerStop()}))}implRecognizerStop(){return So(this,void 0,void 0,(function*(){this.privReco&&(yield this.privReco.stopRecognizing())}))}static getAuthFromProperties(e){const t=e.getProperty($e.SpeechServiceConnection_Key,void 0);return t&&""!==t?new Ue(t):new Ge((t=>{const n=e.getProperty($e.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(n)}),(t=>{const n=e.getProperty($e.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(n)}))}}var _o=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class Eo extends xo.Recognizer{constructor(e,t){const n=e;Tt.throwIfNull(n,"speechConfig"),Tt.throwIfNullOrWhitespace(n.properties.getProperty($e.SpeechServiceConnection_RecoLanguage),$e[$e.SpeechServiceConnection_RecoLanguage]),super(t,n.properties,new At),this.privDisposedRecognizer=!1}static FromConfig(e,t,n){const r=e;t.properties.mergeTo(r.properties);return new Eo(e,n)}get endpointId(){return Tt.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty($e.SpeechServiceConnection_EndpointId,"00000000-0000-0000-0000-000000000000")}get authorizationToken(){return this.properties.getProperty($e.SpeechServiceAuthorization_Token)}set authorizationToken(e){Tt.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty($e.SpeechServiceAuthorization_Token,e)}get speechRecognitionLanguage(){return Tt.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty($e.SpeechServiceConnection_RecoLanguage)}get outputFormat(){return Tt.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(Yn,gt[gt.Simple])===gt[gt.Simple]?gt.Simple:gt.Detailed}get properties(){return this.privProperties}recognizeOnceAsync(e,t){ie(this.recognizeOnceAsyncImpl(et.Interactive),e,t)}startContinuousRecognitionAsync(e,t){ie(this.startContinuousRecognitionAsyncImpl(et.Conversation),e,t)}stopContinuousRecognitionAsync(e,t){ie(this.stopContinuousRecognitionAsyncImpl(),e,t)}startKeywordRecognitionAsync(e,t,n){Tt.throwIfNull(e,"model"),n&&n("Not yet implemented.")}stopKeywordRecognitionAsync(e,t){e&&e()}close(e,t){Tt.throwIfDisposed(this.privDisposedRecognizer),ie(this.dispose(!0),e,t)}dispose(e){const t=Object.create(null,{dispose:{get:()=>super.dispose}});return _o(this,void 0,void 0,(function*(){this.privDisposedRecognizer||(e&&(this.privDisposedRecognizer=!0,yield this.implRecognizerStop()),yield t.dispose.call(this,e))}))}createRecognizerConfig(e){return new ut(e,this.properties)}createServiceRecognizer(e,t,n,r){return new(0,Lt.SpeechServiceRecognizer)(e,t,n,r,this)}}var Ao,Co,ko,To,Io={};e(Io,"SpeechSynthesizer",(()=>No),(e=>No=e)),(Co=Ao||(Ao={}))[Co.Unknown=0]="Unknown",Co[Co.Female=1]="Female",Co[Co.Male=2]="Male",(To=ko||(ko={}))[To.OnlineNeural=1]="OnlineNeural",To[To.OnlineStandard=2]="OnlineStandard",To[To.OfflineNeural=3]="OfflineNeural",To[To.OfflineStandard=4]="OfflineStandard";class Oo{constructor(e){if(this.privStyleList=[],this.privVoicePath="",e&&(this.privName=e.Name,this.privLocale=e.Locale,this.privShortName=e.ShortName,this.privLocalName=e.LocalName,this.privVoiceType=e.VoiceType.endsWith("Standard")?ko.OnlineStandard:ko.OnlineNeural,this.privGender="Male"===e.Gender?Ao.Male:"Female"===e.Gender?Ao.Female:Ao.Unknown,e.StyleList&&Array.isArray(e.StyleList)))for(const t of e.StyleList)this.privStyleList.push(t)}get name(){return this.privName}get locale(){return this.privLocale}get shortName(){return this.privShortName}get localName(){return this.privLocalName}get gender(){return this.privGender}get voiceType(){return this.privVoiceType}get styleList(){return this.privStyleList}get voicePath(){return this.privVoicePath}}class Ro extends Rn{constructor(e,t){if(Array.isArray(t)){super(e,bt.VoicesListRetrieved,void 0,new It),this.privVoices=[];for(const e of t)this.privVoices.push(new Oo(e))}else super(e,bt.Canceled,t.errorDetails?t.errorDetails:"Error information unavailable",new It)}get voices(){return this.privVoices}}var Po=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class No{constructor(e,t){const n=e;Tt.throwIfNull(n,"speechConfig"),null!==t&&(this.audioConfig=void 0===t?"undefined"==typeof window?void 0:vo.fromDefaultSpeakerOutput():t),this.privProperties=n.properties.clone(),this.privDisposed=!1,this.privSynthesizing=!1,this.privConnectionFactory=new Ct,this.synthesisRequestQueue=new(0,ae.Queue),this.implCommonSynthesizeSetup()}get authorizationToken(){return this.properties.getProperty($e.SpeechServiceAuthorization_Token)}set authorizationToken(e){Tt.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty($e.SpeechServiceAuthorization_Token,e)}get properties(){return this.privProperties}get autoDetectSourceLanguage(){return"OpenRange"===this.properties.getProperty($e.SpeechServiceConnection_AutoDetectSourceLanguages)}static FromConfig(e,t,n){const r=e;return t.properties.mergeTo(r.properties),new No(e,n)}buildSsml(e){const t={"af-ZA":"af-ZA-AdriNeural","am-ET":"am-ET-AmehaNeural","ar-AE":"ar-AE-FatimaNeural","ar-BH":"ar-BH-AliNeural","ar-DZ":"ar-DZ-AminaNeural","ar-EG":"ar-EG-SalmaNeural","ar-IQ":"ar-IQ-BasselNeural","ar-JO":"ar-JO-SanaNeural","ar-KW":"ar-KW-FahedNeural","ar-LY":"ar-LY-ImanNeural","ar-MA":"ar-MA-JamalNeural","ar-QA":"ar-QA-AmalNeural","ar-SA":"ar-SA-HamedNeural","ar-SY":"ar-SY-AmanyNeural","ar-TN":"ar-TN-HediNeural","ar-YE":"ar-YE-MaryamNeural","bg-BG":"bg-BG-BorislavNeural","bn-BD":"bn-BD-NabanitaNeural","ca-ES":"ca-ES-JoanaNeural","cs-CZ":"cs-CZ-AntoninNeural","cy-GB":"cy-GB-AledNeural","da-DK":"da-DK-ChristelNeural","de-AT":"de-AT-IngridNeural","de-CH":"de-CH-JanNeural","de-DE":"de-DE-KatjaNeural","el-GR":"el-GR-AthinaNeural","en-AU":"en-AU-NatashaNeural","en-CA":"en-CA-ClaraNeural","en-GB":"en-GB-LibbyNeural","en-HK":"en-HK-SamNeural","en-IE":"en-IE-ConnorNeural","en-IN":"en-IN-NeerjaNeural","en-KE":"en-KE-AsiliaNeural","en-NG":"en-NG-AbeoNeural","en-NZ":"en-NZ-MitchellNeural","en-PH":"en-PH-JamesNeural","en-SG":"en-SG-LunaNeural","en-TZ":"en-TZ-ElimuNeural","en-US":"en-US-JennyNeural","en-ZA":"en-ZA-LeahNeural","es-AR":"es-AR-ElenaNeural","es-BO":"es-BO-MarceloNeural","es-CL":"es-CL-CatalinaNeural","es-CO":"es-CO-GonzaloNeural","es-CR":"es-CR-JuanNeural","es-CU":"es-CU-BelkysNeural","es-DO":"es-DO-EmilioNeural","es-EC":"es-EC-AndreaNeural","es-ES":"es-ES-AlvaroNeural","es-GQ":"es-GQ-JavierNeural","es-GT":"es-GT-AndresNeural","es-HN":"es-HN-CarlosNeural","es-MX":"es-MX-DaliaNeural","es-NI":"es-NI-FedericoNeural","es-PA":"es-PA-MargaritaNeural","es-PE":"es-PE-AlexNeural","es-PR":"es-PR-KarinaNeural","es-PY":"es-PY-MarioNeural","es-SV":"es-SV-LorenaNeural","es-US":"es-US-AlonsoNeural","es-UY":"es-UY-MateoNeural","es-VE":"es-VE-PaolaNeural","et-EE":"et-EE-AnuNeural","fa-IR":"fa-IR-DilaraNeural","fi-FI":"fi-FI-SelmaNeural","fil-PH":"fil-PH-AngeloNeural","fr-BE":"fr-BE-CharlineNeural","fr-CA":"fr-CA-SylvieNeural","fr-CH":"fr-CH-ArianeNeural","fr-FR":"fr-FR-DeniseNeural","ga-IE":"ga-IE-ColmNeural","gl-ES":"gl-ES-RoiNeural","gu-IN":"gu-IN-DhwaniNeural","he-IL":"he-IL-AvriNeural","hi-IN":"hi-IN-MadhurNeural","hr-HR":"hr-HR-GabrijelaNeural","hu-HU":"hu-HU-NoemiNeural","id-ID":"id-ID-ArdiNeural","it-IT":"it-IT-IsabellaNeural","ja-JP":"ja-JP-NanamiNeural","jv-ID":"jv-ID-DimasNeural","km-KH":"km-KH-PisethNeural","ko-KR":"ko-KR-SunHiNeural","lt-LT":"lt-LT-LeonasNeural","lv-LV":"lv-LV-EveritaNeural","mr-IN":"mr-IN-AarohiNeural","ms-MY":"ms-MY-OsmanNeural","mt-MT":"mt-MT-GraceNeural","my-MM":"my-MM-NilarNeural","nb-NO":"nb-NO-PernilleNeural","nl-BE":"nl-BE-ArnaudNeural","nl-NL":"nl-NL-ColetteNeural","pl-PL":"pl-PL-AgnieszkaNeural","pt-BR":"pt-BR-FranciscaNeural","pt-PT":"pt-PT-DuarteNeural","ro-RO":"ro-RO-AlinaNeural","ru-RU":"ru-RU-SvetlanaNeural","sk-SK":"sk-SK-LukasNeural","sl-SI":"sl-SI-PetraNeural","so-SO":"so-SO-MuuseNeural","su-ID":"su-ID-JajangNeural","sv-SE":"sv-SE-SofieNeural","sw-KE":"sw-KE-RafikiNeural","sw-TZ":"sw-TZ-DaudiNeural","ta-IN":"ta-IN-PallaviNeural","ta-LK":"ta-LK-KumarNeural","ta-SG":"ta-SG-AnbuNeural","te-IN":"te-IN-MohanNeural","th-TH":"th-TH-PremwadeeNeural","tr-TR":"tr-TR-AhmetNeural","uk-UA":"uk-UA-OstapNeural","ur-IN":"ur-IN-GulNeural","ur-PK":"ur-PK-AsadNeural","uz-UZ":"uz-UZ-MadinaNeural","vi-VN":"vi-VN-HoaiMyNeural","zh-CN":"zh-CN-XiaoxiaoNeural","zh-HK":"zh-HK-HiuMaanNeural","zh-TW":"zh-TW-HsiaoChenNeural","zu-ZA":"zu-ZA-ThandoNeural"};let n=this.properties.getProperty($e.SpeechServiceConnection_SynthLanguage,"en-US"),r=this.properties.getProperty($e.SpeechServiceConnection_SynthVoice,""),o=No.XMLEncode(e);return this.autoDetectSourceLanguage?n="en-US":r=r||t[n],r&&(o=`<voice name='${r}'>${o}</voice>`),o=`<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xmlns:emo='http://www.w3.org/2009/10/emotionml' xml:lang='${n}'>${o}</speak>`,o}speakTextAsync(e,t,n,r){this.speakImpl(e,!1,t,n,r)}speakSsmlAsync(e,t,n,r){this.speakImpl(e,!0,t,n,r)}getVoicesAsync(e=""){return Po(this,void 0,void 0,(function*(){return this.getVoices(e)}))}close(e,t){Tt.throwIfDisposed(this.privDisposed),ie(this.dispose(!0),e,t)}get internalData(){return this.privAdapter}dispose(e){return Po(this,void 0,void 0,(function*(){this.privDisposed||(e&&this.privAdapter&&(yield this.privAdapter.dispose()),this.privDisposed=!0)}))}createSynthesizerConfig(e){return new Xn(e,this.privProperties)}createSynthesisAdapter(e,t,n,r){return new(0,In.SynthesisAdapterBase)(e,t,r,this,this.audioConfig)}implCommonSynthesizeSetup(){let e="undefined"!=typeof window?"Browser":"Node",t="unknown",n="unknown";"undefined"!=typeof navigator&&(e=e+"/"+navigator.platform,t=navigator.userAgent,n=navigator.appVersion);const r=this.createSynthesizerConfig(new dt(new ft(new pt(e,t,n)))),o=this.privProperties.getProperty($e.SpeechServiceConnection_Key,void 0),i=o&&""!==o?new Ue(o):new Ge((e=>{const t=this.privProperties.getProperty($e.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(t)}),(e=>{const t=this.privProperties.getProperty($e.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(t)}));this.privAdapter=this.createSynthesisAdapter(i,this.privConnectionFactory,this.audioConfig,r),this.privAdapter.audioOutputFormat=fn.fromSpeechSynthesisOutputFormat(Yt[this.properties.getProperty($e.SpeechServiceConnection_SynthOutputFormat,void 0)]),this.privRestAdapter=new Jn(r)}speakImpl(e,t,n,r,o){try{Tt.throwIfDisposed(this.privDisposed);const i=S();let a;a=o instanceof mo?new(0,gn.PushAudioOutputStreamImpl)(o):o instanceof gn.PullAudioOutputStream?o:void 0!==o?new go(o):void 0,this.synthesisRequestQueue.enqueue(new Lo(i,e,t,(e=>{if(this.privSynthesizing=!1,n)try{n(e)}catch(e){r&&r(e)}n=void 0,this.adapterSpeak().catch((()=>{}))}),(e=>{r&&r(e)}),a)),this.adapterSpeak().catch((()=>{}))}catch(e){if(r)if(e instanceof Error){const t=e;r(t.name+": "+t.message)}else r(e);this.dispose(!0).catch((()=>{}))}}getVoices(e){return Po(this,void 0,void 0,(function*(){const t=S(),n=yield this.privRestAdapter.getVoicesList(t);if(n.ok&&Array.isArray(n.json)){let r=n.json;return e&&e.length>0&&(r=r.filter((t=>!!t.Locale&&t.Locale.toLowerCase()===e.toLowerCase()))),new Ro(t,r)}return new Ro(t,{errorDetails:`Error: ${n.status}: ${n.statusText}`})}))}adapterSpeak(){return Po(this,void 0,void 0,(function*(){if(!this.privDisposed&&!this.privSynthesizing){this.privSynthesizing=!0;const e=yield this.synthesisRequestQueue.dequeue();return this.privAdapter.Speak(e.text,e.isSSML,e.requestId,e.cb,e.err,e.dataStream)}}))}static XMLEncode(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}}class Lo{constructor(e,t,n,r,o,i){this.requestId=e,this.text=t,this.isSSML=n,this.cb=r,this.err=o,this.dataStream=i}}function Bo(){
90
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Bo=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof d?t:d,i=Object.create(o.prototype),a=new M(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return E()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function d(){}function f(){}function h(){}var p={};s(p,o,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(_([])));g&&g!==t&&n.call(g,o)&&(p=g);var v=h.prototype=d.prototype=Object.create(p);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function r(o,i,a,s){var l=c(e[o],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function _(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:E}}function E(){return{value:void 0,done:!0}}return f.prototype=h,s(v,"constructor",h),s(h,"constructor",f),f.displayName=s(h,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(y.prototype),s(y.prototype,i,(function(){return this})),e.AsyncIterator=y,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new y(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(v),s(v,a,"Generator"),s(v,o,(function(){return this})),s(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=_,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:_(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Do(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function jo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Do(i,r,o,a,s,"next",e)}function s(e){Do(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Fo(){return Fo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fo.apply(this,arguments)}var zo=function(e,t){return r(f)(""+t.apiUrl+e,Fo({},t,{body:null!=t&&t.body?JSON.stringify(t.body):void 0,mode:"cors",credentials:"include",headers:Fo({"Content-Type":"application/json"},null==t?void 0:t.headers)})).then((function(e){return null!=t&&t.text?e.text():e.json()}))},Uo=function(e){return{getTenantPublicMemoriList:function(t){return zo("/TenantPublicMemori/"+encodeURI(t),{apiUrl:e})},getTenantMetaverseMemoriList:function(t){return zo("/TenantMetaverseMemori/"+encodeURI(t),{apiUrl:e})},getPublicMemoriList:function(t){return zo("/PublicMemori/"+t,{apiUrl:e})},getAllMemori:function(t){return zo("/AllMemori/"+t,{apiUrl:e})},getUserMemoriList:function(t){return zo("/Memori/"+t,{apiUrl:e})},getSharedMemoriList:function(t){return zo("/SharedMemori/"+t,{apiUrl:e})},getTenantCategories:function(t){return zo("/TenantMemoriCategories/"+encodeURI(t),{apiUrl:e})},getMemoriConfigs:function(t){return zo("/MemoriConfigs/"+t,{apiUrl:e})},createMemori:function(t,n){return zo("/Memori/"+t,{apiUrl:e,body:n,method:"POST"})},updateMemori:function(t,n){return zo("/Memori/"+t+"/"+n.memoriID,{apiUrl:e,body:n,method:"PATCH"})},deleteMemori:function(t,n){return zo("/Memori/"+t,{apiUrl:e,body:n,method:"DELETE"})},getMemoriById:function(t,n){return zo("/Memori/"+t+"/"+n,{apiUrl:e})},getMemoriByUserAndId:function(t,n,r,o){return zo("/MemoriById/"+t+"/"+n+"/"+r+(o?"/"+o:""),{apiUrl:e})},getMemori:function(t,n,r,o){return zo("/Memori/"+encodeURI(t)+"/"+encodeURI(n)+"/"+encodeURI(r)+"/"+(null!=o?o:""),{apiUrl:e})},getMemoriSessions:function(t,n,r,o){return zo("/MemoriSessions/"+t+"/"+n+(r?"/"+r:"")+(r&&o?"/"+o:""),{apiUrl:e})},transferMemori:function(t,n){return zo("/TransferMemori/"+t,{apiUrl:e,body:n,method:"POST"})},memoriContentUpdated:function(t,n){return zo("/MemoriContentUpdated/"+t+"/"+n,{apiUrl:e,method:"POST"})}}},Ho=function(e){return{userSignIn:function(t){return zo("/User",{apiUrl:e,body:t,method:"POST"})},userConfirmSignIn:function(t){return zo("/UserConfirm",{apiUrl:e,body:t,method:"POST"})},userLogin:function(t){return zo("/Login",{apiUrl:e,body:t,method:"POST"})},userLogout:function(t){return zo("/Logout/"+t,{apiUrl:e,method:"POST"})},getUser:function(t,n){return zo("/User/"+t+"/"+n,{apiUrl:e})},getUsersList:function(t){return zo("/Users/"+t,{apiUrl:e})},deleteUser:function(t,n){return zo("/User/"+t+"/"+n,{apiUrl:e,method:"DELETE"})},updateUser:function(t,n,r){return zo("/User/"+t+"/"+n,{apiUrl:e,method:"PATCH",body:r})},resetPassword:function(t){return zo("/ResetPassword",{apiUrl:e,body:t,method:"POST"})},resetConfirm:function(t){return zo("/ResetConfirm",{apiUrl:e,body:t,method:"POST"})},recoverUsername:function(t){return zo("/RecoverUsername",{apiUrl:e,body:t,method:"POST"})},getTenantConfig:function(t){return zo("/Tenant/"+t,{apiUrl:e})},resendVerificationCode:function(t){return zo("/ResendVerificationCode",{apiUrl:e,body:t,method:"POST"})},createUser:function(t,n){return zo("/User/"+t,{apiUrl:e,body:n,method:"POST"})}}},Go=function(e){return{getMemoriIntegrationsList:function(t,n){return zo("/Integrations/"+t+"/"+n,{apiUrl:e})},getAllIntegrationsList:function(t){return zo("/AllIntegrations/"+t,{apiUrl:e})},getIntegration:function(t,n){return zo("/Integration/"+t+"/"+n,{apiUrl:e})},deleteIntegration:function(t,n){return zo("/Integration/"+t+"/"+n,{apiUrl:e,method:"DELETE"})},createIntegration:function(t,n){return zo("/Integration/"+t,{apiUrl:e,method:"POST",body:n})},updateIntegration:function(t,n,r){return zo("/Integration/"+t+"/"+n,{apiUrl:e,method:"PATCH",body:r})}}},Wo=function(e){return{getUploadAssetURL:function(t,n,r){return e+"/Asset/"+t+"/"+n+(r?"/"+r:"")},uploadAsset:(t=jo(Bo().mark((function t(n,r,o,i,a){var s,l,c,u;return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=new FormData,t.next=3,fetch(r);case 3:return l=t.sent,t.next=6,l.blob();case 6:return c=t.sent,s.append(n,c,n),t.next=10,fetch(e+"/Asset/"+o+"/"+i+(a?"/"+a:""),{method:"POST",body:s});case 10:return u=t.sent,t.next=13,u.json();case 13:return t.abrupt("return",t.sent);case 14:case"end":return t.stop()}}),t)}))),function(e,n,r,o,i){return t.apply(this,arguments)}),getAsset:function(t,n){return zo("/Asset/"+t+"/"+n,{apiUrl:e,method:"GET"})},updateAsset:function(t,n,r){return zo("/Asset/"+t+"/"+n.split("/").reverse()[0],{apiUrl:e,method:"PATCH",body:r})},deleteAsset:function(t,n){return zo("/Asset/"+t+"/"+n.split("/").reverse()[0],{apiUrl:e,method:"DELETE"})}};var t},Vo=function(e){return{getSentInvitations:function(t){return zo("/SentInvitations/"+t,{apiUrl:e})},getMemoriInvitations:function(t,n){return zo("/MemoriInvitations/"+t+"/"+n,{apiUrl:e})},getReceivedInvitations:function(t){return zo("/ReceivedInvitations/"+t,{apiUrl:e})},getAllInvitations:function(t){return zo("/AllInvitations/"+t,{apiUrl:e})},getInvitation:function(t,n){return zo("/Invitation/"+t+"/"+n,{apiUrl:e})},updateInvitation:function(t,n){return zo("/Invitation/"+t+"/"+n.invitationID,{apiUrl:e,method:"PATCH",body:n})},deleteInvitation:function(t,n){return zo("/Invitation/"+t+"/"+n,{apiUrl:e,method:"DELETE"})},acceptInvitation:function(t,n){return zo("/AcceptInvitation/"+t+"/"+n,{apiUrl:e,method:"POST"})},rejectInvitation:function(t,n){return zo("/RejectInvitation/"+t+"/"+n,{apiUrl:e,method:"POST"})},sendInvitation:function(t,n){return zo("/SendInvitation/"+t,{apiUrl:e,method:"POST",body:n})}}},qo=function(e){return{getTenantConsumptionLogs:function(t,n,r,o,i){return zo("/TenantConsumptionLogs/"+t+"/"+n+"/"+r+(o?"/"+o:"")+(o&&i?"/"+i:""),{apiUrl:e})},getUserConsumptionLogs:function(t,n,r,o,i){return zo("/UserConsumptionLogs/"+t+"/"+n+"/"+r+(o?"/"+o:"")+(o&&i?"/"+i:""),{apiUrl:e})},getMemoriConsumptionLogs:function(t,n,r,o,i){return zo("/MemoriConsumptionLogs/"+t+"/"+n+"/"+r+(o?"/"+o:"")+(o&&i?"/"+i:""),{apiUrl:e})}}},Ko=function(e){return{getTenantNotifications:function(t){return zo("/TenantNotifications/"+t,{apiUrl:e})},getUserNotifications:function(t){return zo("/UserNotifications/"+t,{apiUrl:e})}}},$o=function(e){return Fo({asset:Wo(e),memori:Uo(e),user:Ho(e),integration:Go(e),invitation:Vo(e),consumptionLogs:qo(e),notifications:Ko(e)},Wo(e),Uo(e),Ho(e),Go(e),Vo(e),qo(e),Ko(e))},Jo=function(e){return{getCorrelationPairs:(n=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CorrelationPairs/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),deleteCorrelationPair:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CorrelationPair/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n},Xo=function(e){return{postTextEnteredEvent:(c=jo(Bo().mark((function t(n){var r,o;return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.sessionId,o=n.text,t.abrupt("return",zo("/TextEnteredEvent/"+r,{method:"POST",apiUrl:e,body:{text:o}}));case 2:case"end":return t.stop()}}),t)}))),function(e){return c.apply(this,arguments)}),postPlaceChangedEvent:(l=jo(Bo().mark((function t(n){var r,o,i,a,s;return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.sessionId,o=n.placeName,i=n.latitude,a=n.longitude,s=n.uncertaintyKm,t.abrupt("return",zo("/PlaceChangedEvent/"+r,{method:"POST",apiUrl:e,body:{placeName:o,latitude:i,longitude:a,uncertaintyKm:s}}));case 2:case"end":return t.stop()}}),t)}))),function(e){return l.apply(this,arguments)}),postDateChangedEvent:(s=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/DateChangedEvent/"+n,{method:"POST",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return s.apply(this,arguments)}),postTagChangedEvent:(a=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/TagChangedEvent/"+n,{method:"POST",apiUrl:e,body:{tag:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return a.apply(this,arguments)}),postTimeoutEvent:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/TimeoutEvent/"+n,{method:"POST",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),postMediumSelectedEvent:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/MediumSelectedEvent/"+n,{method:"POST",apiUrl:e,body:{medium:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),postDateSelectedEvent:(r=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/DateSelectedEvent/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),postPlaceSelectedEvent:(n=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/PlaceSelectedEvent/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),postTagSelectedEvent:(t=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/TagSelectedEvent/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r,o,i,a,s,l,c},Qo=function(e){return{importCSV:(n=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ImportExport/ImportCSV/"+n,{method:"POST",apiUrl:e,body:Fo({csvRows:r},o)}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),exportCSV:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ImportExport/ExportCSV/"+n,{method:"POST",apiUrl:e,body:r,text:!0}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n},Yo=function(e){return{getIntents:(u=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Intents/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return u.apply(this,arguments)}),getIntent:(c=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Intent/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return c.apply(this,arguments)}),patchIntent:(l=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Intent/"+n+"/"+r.intentID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return l.apply(this,arguments)}),deleteIntent:(s=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Intent/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return s.apply(this,arguments)}),createIntent:(a=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Intent/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return a.apply(this,arguments)}),getIntentSlots:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/IntentSlots/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getIntentSlot:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/IntentSlot/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),patchIntentSlot:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/IntentSlot/"+n+"/"+r.intentSlotID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),deleteIntentSlot:(n=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/IntentSlot/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),createIntentSlot:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/IntentSlot/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i,a,s,l,c,u},Zo=function(e){return{getLocalizationKeys:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/LocalizationKeys/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getLocalizationKey:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/LocalizationKey/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),deleteLocalizationKey:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/LocalizationKey/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postLocalizationKey:(n=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/LocalizationKey/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),patchLocalizationKey:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/LocalizationKey/"+n,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i},ei=function(e){return{getMedia:(i=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Media/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),deleteMedia:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Media/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),getMedium:(r=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Medium/"+n+"/"+r+"/"+o,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)}),patchMedium:(n=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Medium/"+n+"/"+r+"/"+o,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),deleteMedium:function(t,n,r){return zo("/Medium/"+t+"/"+n+"/"+r,{method:"GET",apiUrl:e})},postMedium:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Medium/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i},ti=function(e){return{getMemories:(s=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Memories/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return s.apply(this,arguments)}),getMemoriesPaginated:(a=jo(Bo().mark((function t(n,r,o,i){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Memories/"+n+"/"+r+"/"+o+(i?"/"+i:""),{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n,r){return a.apply(this,arguments)}),getMemory:(i=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Memory/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),patchMemory:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Memory/"+n+"/"+r.memoryID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),deleteMemory:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Memory/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postMemory:(n=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Memory/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),getMemoryAccess:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/MemoryAccess/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i,a,s},ni=function(e){return{getWordVector:(i=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/WordVector/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),getSimilarWords:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/SimilarWords/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),guessLanguage:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/GuessLanguage/"+n,{method:"POST",apiUrl:e,body:{text:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),computeSimilarity:(n=jo(Bo().mark((function t(n,r,o,i,a){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ComputeSimilarity/"+n,{method:"POST",apiUrl:e,body:{referenceText:r,referenceTextType:o,comparisonText:i,comparisonTextType:a}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r,o,i){return n.apply(this,arguments)}),checkWords:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CheckWords/"+n,{method:"POST",apiUrl:e,body:{text:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i},ri=function(e){return{getPeople:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/People/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getPerson:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Person/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),patchPerson:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Person/"+n+"/"+r.personID,{method:"PATCH",body:r,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),deletePerson:(n=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Person/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),postPerson:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Person/"+n,{method:"POST",body:r,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i},oi=function(e){return{getPromptedQuestions:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/PromptedQuestions/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getPromptedQuestion:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/PromptedQuestion/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),patchPromptedQuestion:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/PromptedQuestion/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),deletePromptedQuestion:(n=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/PromptedQuestion/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),postPromptedQuestion:(t=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/PromptedQuestion/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r,o,i},ii=function(e){return{searchMemory:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Search/"+n,{method:"POST",body:r,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postRandom:(n=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Random/"+n,{method:"POST",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),postHints:(t=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Hints/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r},ai=function(e){return{initSession:(r=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Session",{method:"POST",body:n,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),getSession:(n=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Session/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),deleteSession:(t=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Session/"+n,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r},si=function(e){return{getStatistics:(a=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Statistics/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return a.apply(this,arguments)}),getContentQualityIndexes:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ContentQualityIndexes/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getTextQualityIndexes:(o=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/TextQualityIndexes/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getEventLogs:(r=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/EventLogs/"+n+"/"+r+"/"+o,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)}),getMemoryEventLogs:(n=jo(Bo().mark((function t(n,r,o,i){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/EventLogs/"+n+"/"+r+"/"+o+"/"+i,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r,o){return n.apply(this,arguments)}),getIntentEventLogs:(t=jo(Bo().mark((function t(n,r,o,i){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/EventLogs/"+n+"/"+r+"/"+o+"/"+i,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n,r,o){return t.apply(this,arguments)})};var t,n,r,o,i,a},li=function(e){return{getUnansweredQuestions:(r=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/UnansweredQuestions/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),getUnansweredQuestionsPaginated:(n=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/UnansweredQuestions/"+n+"/"+r+"/"+o,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),deleteUnansweredQuestion:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/UnansweredQuestion/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r},ci=function(e){return{getContextVars:(r=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ContextVars/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),getContextVarNames:(n=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ContextVarNames/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),getContextVarValues:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ContextVarValues/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r},ui=function(e){return{getCustomWords:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CustomWords/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getCustomWord:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CustomWord/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),deleteCustomWord:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CustomWord/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postCustomWord:(n=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CustomWord/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),patchCustomWord:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CustomWord/"+n+"/"+r.customWordID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i},di=function(e){return{getChatLogs:(r=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ChatLogs/"+n+(r?"/"+r:"")+(r&&o?"/"+o:""),{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)}),deleteChatLogs:(n=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ChatLogs/"+n+(r?"/"+r:"")+(r&&o?"/"+o:""),{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),deleteChatLog:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ChatLog/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r},fi={__proto__:null,allowedMediaTypes:["image/jpeg","image/png","image/jpg","image/gif","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/pdf","video/mp4","video/avi","audio/mpeg3","audio/wav","audio/mpeg","video/mpeg","model/gltf-binary"],anonTag:"👤"},hi=function(e,t){return void 0===t&&(t=!1),function(n,r){var o,i,a=hn.fromSubscription(e,"eastus");i=new(0,uo.SpeakerAudioDestination);var s=vo.fromSpeakerOutput(i);a.speechSynthesisVoiceName=function(e,t){var n="";switch(e.toUpperCase()){case"IT":n="MALE"===t?"it-IT-DiegoNeural":"it-IT-ElsaNeural";break;case"DE":n="MALE"===t?"de-DE-ConradNeural":"de-DE-KatjaNeural";break;case"EN":n="MALE"===t?"en-GB-RyanNeural":"en-GB-SoniaNeural";break;case"ES":n="MALE"===t?"es-ES-AlvaroNeural":"es-ES-ElviraNeural";break;case"FR":n="MALE"===t?"fr-FR-HenriNeural":"fr-FR-DeniseNeural";break;case"PT":n="MALE"===t?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural";break;default:n="MALE"===t?"it-IT-DiegoNeural":"it-IT-IsabellaNeural"}return n}(n,r);var l=function(e){var t="";switch(e.toUpperCase()){case"IT":default:t="it-IT";break;case"DE":t="de-DE";break;case"EN":t="en-US";break;case"ES":t="es-ES";break;case"FR":t="fr-FR";break;case"PT":t="pt-PT"}return t}(n);a.speechSynthesisLanguage=l,a.speechRecognitionLanguage=l;var c,u=function(){i&&i.pause(),o&&(o.close(),o=null)},d=vo.fromDefaultMicrophoneInput(),f=function(e){c&&(c.stopContinuousRecognitionAsync(),c.close(),c=null,e&&e())};return{speak:function(e,n){u(),o=new(0,Io.SpeechSynthesizer)(a,s),n&&(i.onAudioEnd=n),o.speakTextAsync(e,(function(n){if(n)try{t&&console.log("speak result",n),o&&(o.close(),o=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e))}else t&&console.log("speak no result",n)}),(function(t){console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e))}))},isSpeaking:function(){return!!o},stopSpeaking:u,recognize:function(e){(c=new(0,wo.SpeechRecognizer)(a,d)).recognizing=function(e,n){t&&console.log("RECOGNIZING: Text="+n.result.text)},c.recognized=function(n,r){var o;r.result.reason===bt.RecognizedSpeech?(t&&console.log("RECOGNIZED: Text="+r.result.text),e(null!=(o=r.result.text)?o:"")):r.result.reason===bt.NoMatch&&t&&console.log("NOMATCH: Speech could not be recognized.")},c.canceled=function(e,n){t&&console.log("CANCELED: Reason="+n.reason),n.reason===We.Error&&t&&(console.log('"CANCELED: ErrorCode='+n.errorCode),console.log('"CANCELED: ErrorDetails='+n.errorDetails),console.log("CANCELED: Did you set the speech resource key and region values?")),f()},c.sessionStopped=function(e,n){t&&console.log("\n Session stopped event."),c&&c.stopContinuousRecognitionAsync()},c.startContinuousRecognitionAsync()},isRecognizing:function(){return!!c},stopRecognizing:f}}},pi=function(e){return{getResourceUrl:function(t){var n=t.type,r=t.resourceURI,o=t.sessionID,i=t.baseURL,a=void 0===i?"https://app.twincreator.com":i,s="cover"===n?a+"/images/memoriCover.png":a+"/images/memoriAvatar.png";return r&&0!==r.length?r.includes("memoriai/memory")?r+"?memori-ai-session-id="+o:r.startsWith("https://")||r.startsWith("http://")?r+(o?"/"+o:""):r.startsWith("cloud://")?e.replace(/v2/,"v1")+"/CloudAsset/"+r.replace("cloud://",""):r.startsWith("guid://")?e.replace(/v2/,"v1")+"/GuidAsset/"+r.replace("guid://",""):s:s}}},mi=function(e){var t=function(e){return e?new URL(e.startsWith("http")?e:"https://"+e).origin.replace("http://","https://"):"https://backend.memori.ai"}(e);return Fo({backend:$o(t+"/api/v2")},function(e){return Fo({correlationPairs:Jo(e)},Jo(e),{dialog:Xo(e)},Xo(e),{importExport:Qo(e)},Qo(e),{intents:Yo(e)},Yo(e),{localizationKeys:Zo(e)},Zo(e),{media:ei(e)},ei(e),{memories:ti(e)},ti(e),{nlp:ni(e)},ni(e),{people:ri(e)},ri(e),{promptedQuestions:oi(e)},oi(e),{search:ii(e)},ii(e),{session:ai(e)},ai(e),{stats:si(e)},si(e),{unansweredQuestions:li(e)},li(e),{contextVars:ci(e)},ci(e),{customDictionary:ui(e)},ui(e),{chatLogs:di(e)},di(e))}(t+"/memori/v2"),{speech:hi,constants:fi,asset:pi(t+"/api/v2")})},gi=(u=a("85Hg2"),{}),vi={};(vi=function(e){if(Array.isArray(e))return e}).__esModule=!0,vi.default=vi;var bi={};(bi=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}).__esModule=!0,bi.default=bi;var yi={},wi={};(wi=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}).__esModule=!0,wi.default=wi,yi=function(e,t){if(e){if("string"==typeof e)return wi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wi(e,t):void 0}},yi.__esModule=!0,yi.default=yi;var xi={};(xi=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,xi.default=xi,(gi=function(e,t){return vi(e)||bi(e,t)||yi(e,t)||xi()}).__esModule=!0,gi.default=gi;var Si={},Mi={},_i={};function Ei(e){return _i=Ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_i.__esModule=!0,_i.default=_i,Ei(e)}(_i=Ei).__esModule=!0,_i.default=_i;var Ai=_i.default,Ci={},ki=_i.default;(Ci=function(e,t){if("object"!==ki(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ki(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}).__esModule=!0,Ci.default=Ci,(Mi=function(e){var t=Ci(e,"string");return"symbol"===Ai(t)?t:String(t)}).__esModule=!0,Mi.default=Mi,(Si=function(e,t,n){return(t=Mi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}).__esModule=!0,Si.default=Si;u=a("85Hg2");var Ti={};(Ti=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}).__esModule=!0,Ti.default=Ti;var Ii={};function Oi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mi(r.key),r)}}(Ii=function(e,t,n){return t&&Oi(e.prototype,t),n&&Oi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}).__esModule=!0,Ii.default=Ii;u=a("85Hg2");var Ri=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Pi={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Ni=function(e){return Pi[e]};function Li(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Li(Object(n),!0).forEach((function(t){r(Si)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Li(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Di,ji={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(Ri,Ni)}},Fi=(0,u.createContext)();function zi(){return ji}var Ui=function(){function e(){r(Ti)(this,e),this.usedNamespaces={}}return r(Ii)(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function Hi(){return Di}var Gi={type:"3rdParty",init:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ji=Bi(Bi({},ji),e)}(e.options.react),function(e){Di=e}(e)}};function Wi(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]="react-i18next:: ".concat(n[0])),(e=console).warn.apply(e,n)}}var Vi={};function qi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"==typeof t[0]&&Vi[t[0]]||("string"==typeof t[0]&&(Vi[t[0]]=new Date),Wi.apply(void 0,t))}function Ki(e,t,n){e.loadNamespaces(t,(function(){if(e.isInitialized)n();else{e.on("initialized",(function t(){setTimeout((function(){e.off("initialized",t)}),0),n()}))}}))}function $i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],o=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(r,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e))))}function Ji(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return qi("i18n.languages were undefined or empty",t.languages),!0;var r=void 0!==t.options.ignoreJSONStructure;return r?t.hasLoadedNamespace(e,{precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):$i(e,t,n)}function Xi(e){return e.displayName||e.name||("string"==typeof e&&e.length>0?e:"Unknown")}function Qi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qi(Object(n),!0).forEach((function(t){r(Si)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zi=function(e,t){var n=(0,u.useRef)();return(0,u.useEffect)((function(){n.current=t?n.current:e}),[e,t]),n.current};function ea(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,o=(0,u.useContext)(Fi)||{},i=o.i18n,a=o.defaultNS,s=n||i||Hi();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new Ui),!s){qi("You will need to pass in an i18next instance by using initReactI18next");var l=function(e){return Array.isArray(e)?e[e.length-1]:e},c=[l,{},!1];return c.t=l,c.i18n={},c.ready=!1,c}s.options.react&&void 0!==s.options.react.wait&&qi("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var d=Yi(Yi(Yi({},zi()),s.options.react),t),f=d.useSuspense,h=d.keyPrefix,p=e||a||s.options&&s.options.defaultNS;p="string"==typeof p?[p]:p||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(p);var m=(s.isInitialized||s.initializedStoreOnce)&&p.every((function(e){return Ji(e,s,d)}));function g(){return s.getFixedT(null,"fallback"===d.nsMode?p:p[0],h)}var v=(0,u.useState)(g),b=r(gi)(v,2),y=b[0],w=b[1],x=p.join(),S=Zi(x),M=(0,u.useRef)(!0);(0,u.useEffect)((function(){var e=d.bindI18n,t=d.bindI18nStore;function n(){M.current&&w(g)}return M.current=!0,m||f||Ki(s,p,(function(){M.current&&w(g)})),m&&S&&S!==x&&M.current&&w(g),e&&s&&s.on(e,n),t&&s&&s.store.on(t,n),function(){M.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,n)})),t&&s&&t.split(" ").forEach((function(e){return s.store.off(e,n)}))}}),[s,x]);var _=(0,u.useRef)(!0);(0,u.useEffect)((function(){M.current&&!_.current&&w(g),_.current=!1}),[s,h]);var E=[y,s,m];if(E.t=y,E.i18n=s,E.ready=m,m)return E;if(!m&&!f)return E;throw new Promise((function(e){Ki(s,p,(function(){e()}))}))}var ta={};!function(e,t,n,r){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(t),a=o(n),s=o(r),l=function(e,t,n){return{endTime:t,insertTime:n,type:"exponentialRampToValue",value:e}},c=function(e,t,n){return{endTime:t,insertTime:n,type:"linearRampToValue",value:e}},u=function(e,t){return{startTime:t,type:"setValue",value:e}},d=function(e,t,n){return{duration:n,startTime:t,type:"setValueCurve",values:e}},f=function(e,t,n){var r=n.startTime,o=n.target,i=n.timeConstant;return o+(t-o)*Math.exp((r-e)/i)},h=function(e){return"exponentialRampToValue"===e.type},p=function(e){return"linearRampToValue"===e.type},m=function(e){return h(e)||p(e)},g=function(e){return"setValue"===e.type},v=function(e){return"setValueCurve"===e.type},b=function e(t,n,r,o){var i=t[n];return void 0===i?o:m(i)||g(i)?i.value:v(i)?i.values[i.values.length-1]:f(r,e(t,n-1,i.startTime,o),i)},y=function(e,t,n,r,o){return void 0===n?[r.insertTime,o]:m(n)?[n.endTime,n.value]:g(n)?[n.startTime,n.value]:v(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,b(e,t-1,n.startTime,o)]},w=function(e){return"cancelAndHold"===e.type},x=function(e){return"cancelScheduledValues"===e.type},S=function(e){return w(e)||x(e)?e.cancelTime:h(e)||p(e)?e.endTime:e.startTime},M=function(e,t,n,r){var o=r.endTime,i=r.value;return n===i?i:0<n&&0<i||n<0&&i<0?n*Math.pow(i/n,(e-t)/(o-t)):0},_=function(e,t,n,r){return n+(e-t)/(r.endTime-t)*(r.value-n)},E=function(e,t){var n=Math.floor(t),r=Math.ceil(t);return n===r?e[n]:(1-(t-n))*e[n]+(1-(r-t))*e[r]},A=function(e,t){var n=t.duration,r=t.startTime,o=t.values,i=(e-r)/n*(o.length-1);return E(o,i)},C=function(e){return"setTarget"===e.type},k=function(e){function t(e){a.default(this,t),this._automationEvents=[],this._currenTime=0,this._defaultValue=e}return s.default(t,[{key:e,value:function(){return this._automationEvents[Symbol.iterator]()}},{key:"add",value:function(e){var t=S(e);if(w(e)||x(e)){var n=this._automationEvents.findIndex((function(n){return x(e)&&v(n)?n.startTime+n.duration>=t:S(n)>=t})),r=this._automationEvents[n];if(-1!==n&&(this._automationEvents=this._automationEvents.slice(0,n)),w(e)){var o=this._automationEvents[this._automationEvents.length-1];if(void 0!==r&&m(r)){if(C(o))throw new Error("The internal list is malformed.");var i=v(o)?o.startTime+o.duration:S(o),a=v(o)?o.values[o.values.length-1]:o.value,s=h(r)?M(t,i,a,r):_(t,i,a,r),f=h(r)?l(s,t,this._currenTime):c(s,t,this._currenTime);this._automationEvents.push(f)}void 0!==o&&C(o)&&this._automationEvents.push(u(this.getValue(t),t)),void 0!==o&&v(o)&&o.startTime+o.duration>t&&(this._automationEvents[this._automationEvents.length-1]=d(new Float32Array([6,7]),o.startTime,t-o.startTime))}}else{var g=this._automationEvents.findIndex((function(e){return S(e)>t})),b=-1===g?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[g-1];if(void 0!==b&&v(b)&&S(b)+b.duration>t)return!1;var y=h(e)?l(e.value,e.endTime,this._currenTime):p(e)?c(e.value,t,this._currenTime):e;if(-1===g)this._automationEvents.push(y);else{if(v(e)&&t+e.duration>S(this._automationEvents[g]))return!1;this._automationEvents.splice(g,0,y)}}return!0}},{key:"flush",value:function(e){var t=this._automationEvents.findIndex((function(t){return S(t)>e}));if(t>1){var n=this._automationEvents.slice(t-1),r=n[0];C(r)&&n.unshift(u(b(this._automationEvents,t-2,r.startTime,this._defaultValue),r.startTime)),this._automationEvents=n}}},{key:"getValue",value:function(e){if(0===this._automationEvents.length)return this._defaultValue;var t=this._automationEvents.findIndex((function(t){return S(t)>e})),n=this._automationEvents[t],r=(-1===t?this._automationEvents.length:t)-1,o=this._automationEvents[r];if(void 0!==o&&C(o)&&(void 0===n||!m(n)||n.insertTime>e))return f(e,b(this._automationEvents,r-1,o.startTime,this._defaultValue),o);if(void 0!==o&&g(o)&&(void 0===n||!m(n)))return o.value;if(void 0!==o&&v(o)&&(void 0===n||!m(n)||o.startTime+o.duration>e))return e<o.startTime+o.duration?A(e,o):o.values[o.values.length-1];if(void 0!==o&&m(o)&&(void 0===n||!m(n)))return o.value;if(void 0!==n&&h(n)){var a=y(this._automationEvents,r,o,n,this._defaultValue),s=i.default(a,2),l=s[0],c=s[1];return M(e,l,c,n)}if(void 0!==n&&p(n)){var u=y(this._automationEvents,r,o,n,this._defaultValue),d=i.default(u,2),w=d[0],x=d[1];return _(e,w,x,n)}return this._defaultValue}}]),t}(Symbol.iterator),T=function(e){return{cancelTime:e,type:"cancelAndHold"}},I=function(e){return{cancelTime:e,type:"cancelScheduledValues"}},O=function(e,t){return{endTime:t,type:"exponentialRampToValue",value:e}},R=function(e,t){return{endTime:t,type:"linearRampToValue",value:e}},P=function(e,t,n){return{startTime:t,target:e,timeConstant:n,type:"setTarget"}};e.AutomationEventList=k,e.createCancelAndHoldAutomationEvent=T,e.createCancelScheduledValuesAutomationEvent=I,e.createExponentialRampToValueAutomationEvent=O,e.createLinearRampToValueAutomationEvent=R,e.createSetTargetAutomationEvent=P,e.createSetValueAutomationEvent=u,e.createSetValueCurveAutomationEvent=d,Object.defineProperty(e,"__esModule",{value:!0})}(ta,a("kagof"),a("4qTFT"),a("9uC66"));const na=new WeakSet,ra=new WeakMap,oa=new WeakMap,ia=new WeakMap,aa=new WeakMap,sa=new WeakMap,la=new WeakMap,ca=new WeakMap,ua=new WeakMap,da=new WeakMap,fa={construct:()=>fa},ha=e=>{try{new new Proxy(e,fa)}catch{return!1}return!0},pa=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,ma=(e,t)=>{const n=[];let r=e.replace(/^[\s]+/,""),o=r.match(pa);for(;null!==o;){const e=o[1].slice(1,-1),i=o[0].replace(/([\s]+)?;?$/,"").replace(e,new URL(e,t).toString());n.push(i),r=r.slice(o[0].length).replace(/^[\s]+/,""),o=r.match(pa)}return[n.join(";"),r]},ga=e=>{if(void 0!==e&&!Array.isArray(e))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},va=e=>{if(!ha(e))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===e.prototype||"object"!=typeof e.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},ba=(e,t)=>{const n=e.get(t);if(void 0===n)throw new Error("A value with the given key could not be found.");return n},ya=(e,t)=>{const n=Array.from(e).filter(t);if(n.length>1)throw Error("More than one element was found.");if(0===n.length)throw Error("No element was found.");const[r]=n;return e.delete(r),r},wa=(e,t,n,r)=>{const o=ba(e,t),i=ya(o,(e=>e[0]===n&&e[1]===r));return 0===o.size&&e.delete(t),i},xa=e=>ba(la,e),Sa=e=>{if(na.has(e))throw new Error("The AudioNode is already stored.");na.add(e),xa(e).forEach((e=>e(!0)))},Ma=e=>"port"in e,_a=e=>{if(!na.has(e))throw new Error("The AudioNode is not stored.");na.delete(e),xa(e).forEach((e=>e(!1)))},Ea=(e,t)=>{!Ma(e)&&t.every((e=>0===e.size))&&_a(e)},Aa={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},Ca=(e,t)=>e.context===t,ka=e=>{try{e.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},Ta=()=>new DOMException("","IndexSizeError"),Ia=e=>{var t;e.getChannelData=(t=e.getChannelData,n=>{try{return t.call(e,n)}catch(e){if(12===e.code)throw Ta();throw e}})},Oa={numberOfChannels:1},Ra=-34028234663852886e22,Pa=34028234663852886e22,Na=e=>na.has(e),La={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},Ba=e=>"playbackRate"in e,Da=e=>"frequency"in e&&"gain"in e,ja=e=>"offset"in e,Fa=e=>!("frequency"in e)&&"gain"in e,za=e=>"detune"in e&&"frequency"in e,Ua=e=>"pan"in e,Ha=e=>ba(ra,e),Ga=e=>ba(ia,e),Wa=(e,t)=>{const{activeInputs:n}=Ha(e);n.forEach((n=>n.forEach((([n])=>{t.includes(e)||Wa(n,[...t,e])}))));const r=Ba(e)?[e.playbackRate]:Ma(e)?Array.from(e.parameters.values()):Da(e)?[e.Q,e.detune,e.frequency,e.gain]:ja(e)?[e.offset]:Fa(e)?[e.gain]:za(e)?[e.detune,e.frequency]:Ua(e)?[e.pan]:[];for(const e of r){const n=Ga(e);void 0!==n&&n.activeInputs.forEach((([e])=>Wa(e,t)))}Na(e)&&_a(e)},Va=e=>{Wa(e.destination,[])},qa=e=>void 0===e||"number"==typeof e||"string"==typeof e&&("balanced"===e||"interactive"===e||"playback"===e),Ka=e=>"context"in e,$a=e=>Ka(e[0]),Ja=(e,t,n,r)=>{for(const t of e)if(n(t)){if(r)return!1;throw Error("The set contains at least one similar element.")}return e.add(t),!0},Xa=(e,t,[n,r],o)=>{Ja(e,[t,n,r],(e=>e[0]===t&&e[1]===n),o)},Qa=(e,[t,n,r],o)=>{const i=e.get(t);void 0===i?e.set(t,new Set([[n,r]])):Ja(i,[n,r],(e=>e[0]===n),o)},Ya=e=>"inputs"in e,Za=(e,t,n,r)=>{if(Ya(t)){const o=t.inputs[r];return e.connect(o,n,0),[o,n,0]}return e.connect(t,n,r),[t,n,r]},es=(e,t,n)=>{for(const r of e)if(r[0]===t&&r[1]===n)return e.delete(r),r;return null},ts=(e,t,n)=>ya(e,(e=>e[0]===t&&e[1]===n)),ns=(e,t)=>{if(!xa(e).delete(t))throw new Error("Missing the expected event listener.")},rs=(e,t,n)=>{const r=ba(e,t),o=ya(r,(e=>e[0]===n));return 0===r.size&&e.delete(t),o},os=(e,t,n,r)=>{Ya(t)?e.disconnect(t.inputs[r],n,0):e.disconnect(t,n,r)},is=e=>ba(oa,e),as=e=>ba(aa,e),ss=e=>ca.has(e),ls=e=>!na.has(e),cs=(e,t)=>new Promise((n=>{if(null!==t)n(!0);else{const t=e.createScriptProcessor(256,1,1),r=e.createGain(),o=e.createBuffer(1,2,44100),i=o.getChannelData(0);i[0]=1,i[1]=1;const a=e.createBufferSource();a.buffer=o,a.loop=!0,a.connect(t).connect(e.destination),a.connect(r),a.disconnect(r),t.onaudioprocess=r=>{const o=r.inputBuffer.getChannelData(0);Array.prototype.some.call(o,(e=>1===e))?n(!0):n(!1),a.stop(),t.onaudioprocess=null,a.disconnect(t),t.disconnect(e.destination)},a.start()}})),us=(e,t)=>{const n=new Map;for(const t of e)for(const e of t){const t=n.get(e);n.set(e,void 0===t?1:t+1)}n.forEach(((e,n)=>t(n,e)))},ds=e=>"context"in e,fs=e=>{const t=new Map;var n,r;e.connect=(n=e.connect.bind(e),(e,r=0,o=0)=>{const i=ds(e)?n(e,r,o):n(e,r),a=t.get(e);return void 0===a?t.set(e,[{input:o,output:r}]):a.every((e=>e.input!==o||e.output!==r))&&a.push({input:o,output:r}),i}),e.disconnect=(r=e.disconnect,(n,o,i)=>{if(r.apply(e),void 0===n)t.clear();else if("number"==typeof n)for(const[e,r]of t){const o=r.filter((e=>e.output!==n));0===o.length?t.delete(e):t.set(e,o)}else if(t.has(n))if(void 0===o)t.delete(n);else{const e=t.get(n);if(void 0!==e){const r=e.filter((e=>e.output!==o&&(e.input!==i||void 0===i)));0===r.length?t.delete(n):t.set(n,r)}}for(const[n,r]of t)r.forEach((t=>{ds(n)?e.connect(n,t.output,t.input):e.connect(n,t.output)}))})},hs=(e,t,n,r)=>{const{activeInputs:o,passiveInputs:i}=Ga(t),{outputs:a}=Ha(e),s=xa(e),l=a=>{const s=is(e),l=as(t);if(a){const t=rs(i,e,n);Xa(o,e,t,!1),r||ss(e)||s.connect(l,n)}else{const t=ts(o,e,n);Qa(i,t,!1),r||ss(e)||s.disconnect(l,n)}};return!!Ja(a,[t,n],(e=>e[0]===t&&e[1]===n),!0)&&(s.add(l),Na(e)?Xa(o,e,[n,l],!0):Qa(i,[e,n,l],!0),!0)},ps=(e,t,n,r,o)=>{const[i,a]=((e,t,n,r)=>{const{activeInputs:o,passiveInputs:i}=Ha(t),a=es(o[r],e,n);if(null===a)return[wa(i,e,n,r)[2],!1];return[a[2],!0]})(e,n,r,o);if(null!==i&&(ns(e,i),!a||t||ss(e)||os(is(e),is(n),r,o)),Na(n)){const{activeInputs:e}=Ha(n);Ea(n,e)}},ms=(e,t,n,r)=>{const[o,i]=((e,t,n)=>{const{activeInputs:r,passiveInputs:o}=Ga(t),i=es(r,e,n);if(null===i)return[rs(o,e,n)[1],!1];return[i[2],!0]})(e,n,r);null!==o&&(ns(e,o),!i||t||ss(e)||is(e).disconnect(as(n),r))};class gs{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach(((n,r)=>e.call(t,n,r,this)))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}}const vs={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}};function bs(e,t,n,r,o){if("function"==typeof e.copyFromChannel)0===t[n].byteLength&&(t[n]=new Float32Array(128)),e.copyFromChannel(t[n],r,o);else{const i=e.getChannelData(r);if(0===t[n].byteLength)t[n]=i.slice(o,o+128);else{const e=new Float32Array(i.buffer,o*Float32Array.BYTES_PER_ELEMENT,128);t[n].set(e)}}}const ys=(e,t,n,r,o)=>{"function"==typeof e.copyToChannel?0!==t[n].byteLength&&e.copyToChannel(t[n],r,o):0!==t[n].byteLength&&e.getChannelData(r).set(t[n],o)},ws=(e,t)=>{const n=[];for(let r=0;r<e;r+=1){const e=[],o="number"==typeof t?t:t[r];for(let t=0;t<o;t+=1)e.push(new Float32Array(128));n.push(e)}return n},xs=(e,t)=>{const n=ba(da,e),r=is(t);return ba(n,r)},Ss=async(e,t,n,r,o,i,a)=>{const s=null===t?128*Math.ceil(e.context.length/128):t.length,l=r.channelCount*r.numberOfInputs,c=o.reduce(((e,t)=>e+t),0),u=0===c?null:n.createBuffer(c,s,n.sampleRate);if(void 0===i)throw new Error("Missing the processor constructor.");const d=Ha(e),f=await xs(n,e),h=ws(r.numberOfInputs,r.channelCount),p=ws(r.numberOfOutputs,o),m=Array.from(e.parameters.keys()).reduce(((e,t)=>({...e,[t]:new Float32Array(128)})),{});for(let c=0;c<s;c+=128){if(r.numberOfInputs>0&&null!==t)for(let e=0;e<r.numberOfInputs;e+=1)for(let n=0;n<r.channelCount;n+=1)bs(t,h[e],n,n,c);void 0!==i.parameterDescriptors&&null!==t&&i.parameterDescriptors.forEach((({name:e},n)=>{bs(t,m,e,l+n,c)}));for(let e=0;e<r.numberOfInputs;e+=1)for(let t=0;t<o[e];t+=1)0===p[e][t].byteLength&&(p[e][t]=new Float32Array(128));try{const e=h.map(((e,t)=>0===d.activeInputs[t].size?[]:e)),t=a(c/n.sampleRate,n.sampleRate,(()=>f.process(e,p,m)));if(null!==u)for(let e=0,t=0;e<r.numberOfOutputs;e+=1){for(let n=0;n<o[e];n+=1)ys(u,p[e],n,t+n,c);t+=o[e]}if(!t)break}catch(t){e.dispatchEvent(new ErrorEvent("processorerror",{colno:t.colno,filename:t.filename,lineno:t.lineno,message:t.message}));break}}return u},Ms={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},_s={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},Es={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},As={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},Cs={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},ks=e=>{const{port1:t,port2:n}=new MessageChannel;return new Promise((r=>{const o=()=>{n.onmessage=null,t.close(),n.close(),r()};n.onmessage=()=>o();try{t.postMessage(e,[e])}finally{o()}}))},Ts={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},Is=e=>"delayTime"in e,Os=(e,t,n)=>{const r=t[n];if(void 0===r)throw e();return r},Rs={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},Ps={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},Ns=()=>new DOMException("","InvalidStateError"),Ls=()=>new DOMException("","InvalidAccessError"),Bs=e=>{var t;e.getFrequencyResponse=(t=e.getFrequencyResponse,(n,r,o)=>{if(n.length!==r.length||r.length!==o.length)throw Ls();return t.call(e,n,r,o)})},Ds={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},js=(e,t,n,r,o,i,a,s,l,c,u)=>{const d=c.length;let f=s;for(let s=0;s<d;s+=1){let d=n[0]*c[s];for(let t=1;t<o;t+=1){const r=f-t&l-1;d+=n[t]*i[r],d-=e[t]*a[r]}for(let e=o;e<r;e+=1)d+=n[e]*i[f-e&l-1];for(let n=o;n<t;n+=1)d-=e[n]*a[f-n&l-1];i[f]=c[s],a[f]=d,f=f+1&l-1,u[s]=d}return f},Fs={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},zs=e=>{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const n=e.decodeAudioData(t.buffer,(()=>{}));return void 0!==n&&(n.catch((()=>{})),!0)}catch{}return!1},Us={numberOfChannels:1},Hs=(e,t,n)=>{const r=t[n];void 0!==r&&r!==e[n]&&(e[n]=r)},Gs=(e,t)=>{Hs(e,t,"channelCount"),Hs(e,t,"channelCountMode"),Hs(e,t,"channelInterpretation")},Ws=e=>"function"==typeof e.getFloatTimeDomainData,Vs=(e,t,n)=>{const r=t[n];void 0!==r&&r!==e[n].value&&(e[n].value=r)},qs=e=>{e.start=(t=>{let n=!1;return(r=0,o=0,i)=>{if(n)throw Ns();t.call(e,r,o,i),n=!0}})(e.start)},Ks=e=>{var t;e.start=(t=e.start,(n=0,r=0,o)=>{if("number"==typeof o&&o<0||r<0||n<0)throw new RangeError("The parameters can't be negative.");t.call(e,n,r,o)})},$s=e=>{var t;e.stop=(t=e.stop,(n=0)=>{if(n<0)throw new RangeError("The parameter can't be negative.");t.call(e,n)})},Js=e=>{const{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}},Xs=(e,t)=>null===e?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(e*t))))),Qs=e=>new Promise(((t,n)=>{const{port1:r,port2:o}=new MessageChannel;r.onmessage=({data:e})=>{r.close(),o.close(),t(e)},r.onmessageerror=({data:e})=>{r.close(),o.close(),n(e)},o.postMessage(e)})),Ys=async(e,t)=>new e(await Qs(t)),Zs=(e,t,n,r)=>{let o=da.get(e);void 0===o&&(o=new WeakMap,da.set(e,o));const i=Ys(n,r);return o.set(t,i),i},el=(e,t)=>{const n=e.createBiquadFilter();return Gs(n,t),Vs(n,t,"Q"),Vs(n,t,"detune"),Vs(n,t,"frequency"),Vs(n,t,"gain"),Hs(n,t,"type"),n},tl=e=>{const t=e.numberOfOutputs;Object.defineProperty(e,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw Ns()}}),Object.defineProperty(e,"channelCountMode",{get:()=>"explicit",set:e=>{if("explicit"!==e)throw Ns()}}),Object.defineProperty(e,"channelInterpretation",{get:()=>"discrete",set:e=>{if("discrete"!==e)throw Ns()}})},nl=(e,t)=>{const n=e.createChannelSplitter(t.numberOfOutputs);return Gs(n,t),tl(n),n},rl=(e,t)=>(e.connect=t.connect.bind(t),e.disconnect=t.disconnect.bind(t),e),ol=(e,t)=>{const n=e.createDelay(t.maxDelayTime);return Gs(n,t),Vs(n,t,"delayTime"),n},il=(e,t)=>{const n=e.createGain();return Gs(n,t),Vs(n,t,"gain"),n};function al(e,t){const n=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/n,(e[1]*t[0]-e[0]*t[1])/n]}function sl(e,t){let n=[0,0];for(let i=e.length-1;i>=0;i-=1)o=t,n=[(r=n)[0]*o[0]-r[1]*o[1],r[0]*o[1]+r[1]*o[0]],n[0]+=e[i];var r,o;return n}const ll=(e,t,n,r)=>e.createScriptProcessor(t,n,r),cl=()=>new DOMException("","NotSupportedError"),ul={numberOfChannels:1},dl={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},fl={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},hl={disableNormalization:!1},pl={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},ml=()=>new DOMException("","UnknownError"),gl={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},vl=(e,t,n)=>void 0===e.copyFromChannel?e.getChannelData(n)[0]:(e.copyFromChannel(t,n),t[0]),bl=e=>{if(null===e)return!1;const t=e.length;return t%2!=0?0!==e[Math.floor(t/2)]:e[t/2-1]+e[t/2]!==0},yl=(e,t,n,r)=>{let o=e;for(;!o.hasOwnProperty(t);)o=Object.getPrototypeOf(o);const{get:i,set:a}=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,{get:n(i),set:r(a)})},wl=(e,t,n)=>{try{e.setValueAtTime(t,n)}catch(r){if(9!==r.code)throw r;wl(e,t,n+1e-7)}},xl=e=>{const t=e.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},Sl=e=>{const t=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=t,n.start(),n.stop();try{return n.stop(),!0}catch{return!1}},Ml=e=>{const t=e.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},_l=(e,t)=>{const n=t.createGain();e.connect(n);const r=(o=e.disconnect,()=>{o.call(e,n),e.removeEventListener("ended",r)});var o;e.addEventListener("ended",r),rl(e,n),e.stop=(t=>{let r=!1;return(o=0)=>{if(r)try{t.call(e,o)}catch{n.gain.setValueAtTime(0,o)}else t.call(e,o),r=!0}})(e.stop)},El=(e,t)=>n=>{const r={value:e};return Object.defineProperties(n,{currentTarget:r,target:r}),"function"==typeof t?t.call(e,n):t.handleEvent.call(e,n)},Al=(Cl=Ja,(e,t,[n,r,o],i)=>{Cl(e[r],[t,n,o],(e=>e[0]===t&&e[1]===n),i)});var Cl;const kl=(e=>(t,n,[r,o,i],a)=>{const s=t.get(r);void 0===s?t.set(r,new Set([[o,n,i]])):e(s,[o,n,i],(e=>e[0]===o&&e[1]===n),a)})(Ja),Tl=(Il=ya,(e,t,n,r)=>Il(e[r],(e=>e[0]===t&&e[1]===n)));var Il;const Ol=new WeakMap,Rl=(Pl=Ol,e=>{var t;return null!==(t=Pl.get(e))&&void 0!==t?t:0});var Pl;const Nl=(Ll=new Map,Bl=new WeakMap,(e,t)=>{const n=Bl.get(e);if(void 0!==n)return n;const r=Ll.get(e);if(void 0!==r)return r;try{const n=t();return n instanceof Promise?(Ll.set(e,n),n.catch((()=>!1)).then((t=>(Ll.delete(e),Bl.set(e,t),t)))):(Bl.set(e,n),n)}catch{return Bl.set(e,!1),!1}});var Ll,Bl;const Dl="undefined"==typeof window?null:window,jl=(Fl=Nl,zl=Ta,(e,t)=>{const n=e.createAnalyser();if(Gs(n,t),!(t.maxDecibels>t.minDecibels))throw zl();return Hs(n,t,"fftSize"),Hs(n,t,"maxDecibels"),Hs(n,t,"minDecibels"),Hs(n,t,"smoothingTimeConstant"),Fl(Ws,(()=>Ws(n)))||(e=>{e.getFloatTimeDomainData=t=>{const n=new Uint8Array(t.length);e.getByteTimeDomainData(n);const r=Math.max(n.length,e.fftSize);for(let e=0;e<r;e+=1)t[e]=.0078125*(n[e]-128);return t}})(n),n});var Fl,zl;const Ul=(Hl=Ha,e=>{const t=Hl(e);if(null===t.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return t.renderer});var Hl;const Gl=((e,t,n)=>async(r,o,i)=>{const a=e(r);await Promise.all(a.activeInputs.map(((e,a)=>Array.from(e).map((async([e,s])=>{const l=t(e),c=await l.render(e,o),u=r.context.destination;n(e)||r===u&&n(r)||c.connect(i,s,a)})))).reduce(((e,t)=>[...e,...t]),[]))})(Ha,Ul,ss),Wl=(Vl=jl,ql=is,Kl=Gl,()=>{const e=new WeakMap;return{render(t,n){const r=e.get(n);return void 0!==r?Promise.resolve(r):(async(t,n)=>{let r=ql(t);if(!Ca(r,n)){const e={channelCount:r.channelCount,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,fftSize:r.fftSize,maxDecibels:r.maxDecibels,minDecibels:r.minDecibels,smoothingTimeConstant:r.smoothingTimeConstant};r=Vl(n,e)}return e.set(n,r),await Kl(t,n,r),r})(t,n)}}});var Vl,ql,Kl;const $l=(Jl=sa,e=>{const t=Jl.get(e);if(void 0===t)throw Ns();return t});var Jl;const Xl=(e=>null===e?null:e.hasOwnProperty("OfflineAudioContext")?e.OfflineAudioContext:e.hasOwnProperty("webkitOfflineAudioContext")?e.webkitOfflineAudioContext:null)(Dl),Ql=(Yl=Xl,e=>null!==Yl&&e instanceof Yl);var Yl;const Zl=new WeakMap,ec=(tc=El,class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(e,t,n){if(null!==t){let r=this._listeners.get(t);void 0===r&&(r=tc(this,t),"function"==typeof t&&this._listeners.set(t,r)),this._nativeEventTarget.addEventListener(e,r,n)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,t,n){const r=null===t?void 0:this._listeners.get(t);this._nativeEventTarget.removeEventListener(e,void 0===r?null:r,n)}});var tc;const nc=(e=>null===e?null:e.hasOwnProperty("AudioContext")?e.AudioContext:e.hasOwnProperty("webkitAudioContext")?e.webkitAudioContext:null)(Dl),rc=(oc=nc,e=>null!==oc&&e instanceof oc);var oc;const ic=(e=>t=>null!==e&&"function"==typeof e.AudioNode&&t instanceof e.AudioNode)(Dl),ac=(e=>t=>null!==e&&"function"==typeof e.AudioParam&&t instanceof e.AudioParam)(Dl),sc=(e=>null===e?null:e.hasOwnProperty("AudioWorkletNode")?e.AudioWorkletNode:null)(Dl),lc=((e,t,n,r,o,i,a,s,l,c,u,d,f,h,p,m)=>class extends c{constructor(t,r,o,i){super(o),this._context=t,this._nativeAudioNode=o;const a=u(t);d(a)&&!0!==n(cs,(()=>cs(a,m)))&&fs(o),oa.set(this,o),la.set(this,new Set),"closed"!==t.state&&r&&Sa(this),e(this,i,o)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(e){this._nativeAudioNode.channelCount=e}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(e){this._nativeAudioNode.channelCountMode=e}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(e){this._nativeAudioNode.channelInterpretation=e}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(e,n=0,s=0){if(n<0||n>=this._nativeAudioNode.numberOfOutputs)throw o();const c=u(this._context),d=p(c);if(f(e)||h(e))throw i();if(Ka(e)){const o=is(e);try{const t=Za(this._nativeAudioNode,o,n,s),r=ls(this);(d||r)&&this._nativeAudioNode.disconnect(...t),"closed"!==this.context.state&&!r&&ls(e)&&Sa(e)}catch(e){if(12===e.code)throw i();throw e}if(t(this,e,n,s,d)){const t=l([this],e);us(t,r(d))}return e}const m=as(e);if("playbackRate"===m.name&&1024===m.maxValue)throw a();try{this._nativeAudioNode.connect(m,n),(d||ls(this))&&this._nativeAudioNode.disconnect(m,n)}catch(e){if(12===e.code)throw i();throw e}if(hs(this,e,n,d)){const t=l([this],e);us(t,r(d))}}disconnect(e,t,n){let r;const a=u(this._context),c=p(a);if(void 0===e)r=((e,t)=>{const n=Ha(e),r=[];for(const o of n.outputs)$a(o)?ps(e,t,...o):ms(e,t,...o),r.push(o[0]);return n.outputs.clear(),r})(this,c);else if("number"==typeof e){if(e<0||e>=this.numberOfOutputs)throw o();r=((e,t,n)=>{const r=Ha(e),o=[];for(const i of r.outputs)i[1]===n&&($a(i)?ps(e,t,...i):ms(e,t,...i),o.push(i[0]),r.outputs.delete(i));return o})(this,c,e)}else{if(void 0!==t&&(t<0||t>=this.numberOfOutputs))throw o();if(Ka(e)&&void 0!==n&&(n<0||n>=e.numberOfInputs))throw o();if(r=((e,t,n,r,o)=>{const i=Ha(e);return Array.from(i.outputs).filter((e=>!(e[0]!==n||void 0!==r&&e[1]!==r||void 0!==o&&e[2]!==o))).map((n=>($a(n)?ps(e,t,...n):ms(e,t,...n),i.outputs.delete(n),n[0])))})(this,c,e,t,n),0===r.length)throw i()}for(const e of r){const t=l([this],e);us(t,s)}}})((cc=ra,(e,t,n)=>{const r=[];for(let e=0;e<n.numberOfInputs;e+=1)r.push(new Set);cc.set(e,{activeInputs:r,outputs:new Set,passiveInputs:new WeakMap,renderer:t})}),((e,t,n,r,o,i,a,s,l,c,u,d,f)=>{const h=new WeakMap;return(p,m,g,v,b)=>{const{activeInputs:y,passiveInputs:w}=i(m),{outputs:x}=i(p),S=s(p),M=i=>{const s=l(m),c=l(p);if(i){const t=wa(w,p,g,v);e(y,p,t,!1),b||d(p)||n(c,s,g,v),f(m)&&Sa(m)}else{const e=r(y,p,g,v);t(w,v,e,!1),b||d(p)||o(c,s,g,v);const n=a(m);if(0===n)u(m)&&Ea(m,y);else{const e=h.get(m);void 0!==e&&clearTimeout(e),h.set(m,setTimeout((()=>{u(m)&&Ea(m,y)}),1e3*n))}}};return!!c(x,[m,g,v],(e=>e[0]===m&&e[1]===g&&e[2]===v),!0)&&(S.add(M),u(p)?e(y,p,[g,v,M],!0):t(w,v,[p,g,M],!0),!0)}})(Al,kl,Za,Tl,os,Ha,Rl,xa,is,Ja,Na,ss,ls),Nl,((e,t,n,r,o,i)=>a=>(s,l)=>{const c=e.get(s);if(void 0===c){if(!a&&i(s)){const e=r(s),{outputs:i}=n(s);for(const n of i)if($a(n)){const o=r(n[0]);t(e,o,n[1],n[2])}else{const t=o(n[0]);e.disconnect(t,n[1])}}e.set(s,l)}else e.set(s,c+l)})(ca,os,Ha,is,as,Na),Ta,Ls,cl,((e,t,n,r,o,i,a,s)=>(l,c)=>{const u=t.get(l);if(void 0===u)throw new Error("Missing the expected cycle count.");const d=i(l.context),f=s(d);if(u===c){if(t.delete(l),!f&&a(l)){const t=r(l),{outputs:i}=n(l);for(const n of i)if($a(n)){const o=r(n[0]);e(t,o,n[1],n[2])}else{const e=o(n[0]);t.connect(e,n[1])}}}else t.set(l,u-c)})(Za,ca,Ha,is,as,$l,Na,Ql),((e,t,n)=>function r(o,i){const a=Ka(i)?i:n(e,i);if(Is(a))return[];if(o[0]===a)return[o];if(o.includes(a))return[];const{outputs:s}=t(a);return Array.from(s).map((e=>r([...o,a],e[0]))).reduce(((e,t)=>e.concat(t)),[])})(Zl,Ha,ba),ec,$l,rc,ic,ac,Ql,sc);var cc;const uc=((e,t,n,r,o,i)=>class extends e{constructor(e,n){const a=o(e),s={...Aa,...n},l=r(a,s);super(e,!1,l,i(a)?t():null),this._nativeAnalyserNode=l}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(e){this._nativeAnalyserNode.fftSize=e}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(e){const t=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=e,!(e>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=t,n()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(e){const t=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=e,!(this._nativeAnalyserNode.maxDecibels>e))throw this._nativeAnalyserNode.minDecibels=t,n()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(e){this._nativeAnalyserNode.smoothingTimeConstant=e}getByteFrequencyData(e){this._nativeAnalyserNode.getByteFrequencyData(e)}getByteTimeDomainData(e){this._nativeAnalyserNode.getByteTimeDomainData(e)}getFloatFrequencyData(e){this._nativeAnalyserNode.getFloatFrequencyData(e)}getFloatTimeDomainData(e){this._nativeAnalyserNode.getFloatTimeDomainData(e)}})(lc,Wl,Ta,jl,$l,Ql),dc=new WeakSet,fc=(e=>null===e?null:e.hasOwnProperty("AudioBuffer")?e.AudioBuffer:null)(Dl),hc=(pc=new Uint32Array(1),e=>(pc[0]=e,pc[0]));var pc;const mc=((e,t)=>n=>{n.copyFromChannel=(r,o,i=0)=>{const a=e(i),s=e(o);if(s>=n.numberOfChannels)throw t();const l=n.length,c=n.getChannelData(s),u=r.length;for(let e=a<0?-a:0;e+a<l&&e<u;e+=1)r[e]=c[e+a]},n.copyToChannel=(r,o,i=0)=>{const a=e(i),s=e(o);if(s>=n.numberOfChannels)throw t();const l=n.length,c=n.getChannelData(s),u=r.length;for(let e=a<0?-a:0;e+a<l&&e<u;e+=1)c[e+a]=r[e]}})(hc,Ta),gc=(vc=hc,e=>{var t,n;e.copyFromChannel=(t=e.copyFromChannel,(n,r,o=0)=>{const i=vc(o),a=vc(r);if(i<e.length)return t.call(e,n,a,i)}),e.copyToChannel=(n=e.copyToChannel,(t,r,o=0)=>{const i=vc(o),a=vc(r);if(i<e.length)return n.call(e,t,a,i)})});var vc;const bc=((e,t,n,r,o,i,a,s)=>{let l=null;return class c{constructor(c){if(null===o)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:u,numberOfChannels:d,sampleRate:f}={...Oa,...c};null===l&&(l=new o(1,1,44100));const h=null!==r&&t(i,i)?new r({length:u,numberOfChannels:d,sampleRate:f}):l.createBuffer(d,u,f);if(0===h.numberOfChannels)throw n();return"function"!=typeof h.copyFromChannel?(a(h),Ia(h)):t(ka,(()=>ka(h)))||s(h),e.add(h),h}static[Symbol.hasInstance](t){return null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===c.prototype||e.has(t)}}})(dc,Nl,cl,fc,Xl,(yc=fc,()=>{if(null===yc)return!1;try{new yc({length:1,sampleRate:44100})}catch{return!1}return!0}),mc,gc);var yc;const wc=(xc=il,(e,t)=>{const n=xc(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(n).connect(e.destination);const r=()=>{t.removeEventListener("ended",r),t.disconnect(n),n.disconnect()};t.addEventListener("ended",r)});var xc;const Sc=(Mc=Ul,_c=Ga,Ec=ss,async(e,t,n)=>{const r=_c(e);await Promise.all(Array.from(r.activeInputs).map((async([e,r])=>{const o=Mc(e),i=await o.render(e,t);Ec(e)||i.connect(n,r)})))});var Mc,_c,Ec;const Ac=(Cc=Sc,(e,t,n)=>Cc(t,e,n));var Cc;const kc=((e,t,n,r,o,i,a,s,l,c,u)=>(d,f)=>{const h=d.createBufferSource();return Gs(h,f),Vs(h,f,"playbackRate"),Hs(h,f,"buffer"),Hs(h,f,"loop"),Hs(h,f,"loopEnd"),Hs(h,f,"loopStart"),t(n,(()=>n(d)))||qs(h),t(r,(()=>r(d)))||l(h),t(o,(()=>o(d)))||c(h,d),t(i,(()=>i(d)))||Ks(h),t(a,(()=>a(d)))||u(h,d),t(s,(()=>s(d)))||$s(h),e(d,h),h})(wc,Nl,(e=>{const t=e.createBufferSource();t.start();try{t.start()}catch{return!0}return!1}),(e=>{const t=e.createBufferSource(),n=e.createBuffer(1,1,44100);t.buffer=n;try{t.start(0,1)}catch{return!1}return!0}),(e=>{const t=e.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0}),xl,Sl,Ml,(e=>{var t;e.start=(t=e.start,(n=0,r=0,o)=>{const i=e.buffer,a=null===i?r:Math.min(i.duration,r);null!==i&&a>i.duration-.5/e.context.sampleRate?t.call(e,n,0,0):t.call(e,n,a,o)})}),(Tc=yl,(e,t)=>{const n=t.createBuffer(1,1,44100);null===e.buffer&&(e.buffer=n),Tc(e,"buffer",(t=>()=>{const r=t.call(e);return r===n?null:r}),(t=>r=>t.call(e,null===r?n:r)))}),_l);var Tc;const Ic=((e,t)=>(n,r,o)=>(e(r).replay(o),t(r,n,o)))((e=>t=>{const n=e(t);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer})(Ga),Sc),Oc=((e,t,n,r,o)=>()=>{const i=new WeakMap;let a=null,s=null;return{set start(e){a=e},set stop(e){s=e},render(l,c){const u=i.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=n(l);const d=Ca(u,c);if(!d){const e={buffer:u.buffer,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,loop:u.loop,loopEnd:u.loopEnd,loopStart:u.loopStart,playbackRate:u.playbackRate.value};u=t(c,e),null!==a&&u.start(...a),null!==s&&u.stop(s)}return i.set(c,u),d?await e(c,l.playbackRate,u.playbackRate):await r(c,l.playbackRate,u.playbackRate),await o(l,c,u),u})(l,c)}}})(Ac,kc,is,Ic,Gl),Rc=((e,t,n,r,o,i,a,s,l,c,u,d,f)=>(h,p,m,g=null,v=null)=>{const b=new(0,ta.AutomationEventList)(m.defaultValue),y=p?r(b):null,w={get defaultValue(){return m.defaultValue},get maxValue(){return null===g?m.maxValue:g},get minValue(){return null===v?m.minValue:v},get value(){return m.value},set value(e){m.value=e,w.setValueAtTime(e,h.context.currentTime)},cancelAndHoldAtTime(e){if("function"==typeof m.cancelAndHoldAtTime)null===y&&b.flush(h.context.currentTime),b.add(o(e)),m.cancelAndHoldAtTime(e);else{const t=Array.from(b).pop();null===y&&b.flush(h.context.currentTime),b.add(o(e));const n=Array.from(b).pop();m.cancelScheduledValues(e),t!==n&&void 0!==n&&("exponentialRampToValue"===n.type?m.exponentialRampToValueAtTime(n.value,n.endTime):"linearRampToValue"===n.type?m.linearRampToValueAtTime(n.value,n.endTime):"setValue"===n.type?m.setValueAtTime(n.value,n.startTime):"setValueCurve"===n.type&&m.setValueCurveAtTime(n.values,n.startTime,n.duration))}return w},cancelScheduledValues:e=>(null===y&&b.flush(h.context.currentTime),b.add(i(e)),m.cancelScheduledValues(e),w),exponentialRampToValueAtTime(e,t){if(0===e)throw new RangeError;if(!Number.isFinite(t)||t<0)throw new RangeError;return null===y&&b.flush(h.context.currentTime),b.add(a(e,t)),m.exponentialRampToValueAtTime(e,t),w},linearRampToValueAtTime:(e,t)=>(null===y&&b.flush(h.context.currentTime),b.add(s(e,t)),m.linearRampToValueAtTime(e,t),w),setTargetAtTime:(e,t,n)=>(null===y&&b.flush(h.context.currentTime),b.add(l(e,t,n)),m.setTargetAtTime(e,t,n),w),setValueAtTime:(e,t)=>(null===y&&b.flush(h.context.currentTime),b.add(c(e,t)),m.setValueAtTime(e,t),w),setValueCurveAtTime(e,t,n){const r=e instanceof Float32Array?e:new Float32Array(e);if(null!==d&&"webkitAudioContext"===d.name){const e=t+n,o=h.context.sampleRate,i=Math.ceil(t*o),a=Math.floor(e*o),s=a-i,l=new Float32Array(s);for(let e=0;e<s;e+=1){const a=(r.length-1)/n*((i+e)/o-t),s=Math.floor(a),c=Math.ceil(a);l[e]=s===c?r[s]:(1-(a-s))*r[s]+(1-(c-a))*r[c]}null===y&&b.flush(h.context.currentTime),b.add(u(l,t,n)),m.setValueCurveAtTime(l,t,n);const c=a/o;c<e&&f(w,l[l.length-1],c),f(w,r[r.length-1],e)}else null===y&&b.flush(h.context.currentTime),b.add(u(r,t,n)),m.setValueCurveAtTime(r,t,n);return w}};return n.set(w,m),t.set(w,h),e(w,y),w})((Pc=ia,(e,t)=>{Pc.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:t})}),Zl,aa,(e=>({replay(t){for(const n of e)if("exponentialRampToValue"===n.type){const{endTime:e,value:r}=n;t.exponentialRampToValueAtTime(r,e)}else if("linearRampToValue"===n.type){const{endTime:e,value:r}=n;t.linearRampToValueAtTime(r,e)}else if("setTarget"===n.type){const{startTime:e,target:r,timeConstant:o}=n;t.setTargetAtTime(r,e,o)}else if("setValue"===n.type){const{startTime:e,value:r}=n;t.setValueAtTime(r,e)}else{if("setValueCurve"!==n.type)throw new Error("Can't apply an unknown automation.");{const{duration:e,startTime:r,values:o}=n;t.setValueCurveAtTime(o,r,e)}}}})),ta.createCancelAndHoldAutomationEvent,ta.createCancelScheduledValuesAutomationEvent,ta.createExponentialRampToValueAutomationEvent,ta.createLinearRampToValueAutomationEvent,ta.createSetTargetAutomationEvent,ta.createSetValueAutomationEvent,ta.createSetValueCurveAutomationEvent,nc,wl);var Pc;const Nc=((e,t,n,r,o,i,a,s)=>class extends e{constructor(e,r){const s=i(e),l={...La,...r},c=o(s,l),u=a(s),d=u?t():null;super(e,!1,c,d),this._audioBufferSourceNodeRenderer=d,this._isBufferNullified=!1,this._isBufferSet=null!==l.buffer,this._nativeAudioBufferSourceNode=c,this._onended=null,this._playbackRate=n(this,u,c.playbackRate,Pa,Ra)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(e){if(this._nativeAudioBufferSourceNode.buffer=e,null!==e){if(this._isBufferSet)throw r();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(e){this._nativeAudioBufferSourceNode.loop=e}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(e){this._nativeAudioBufferSourceNode.loopEnd=e}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(e){this._nativeAudioBufferSourceNode.loopStart=e}get onended(){return this._onended}set onended(e){const t="function"==typeof e?s(this,e):null;this._nativeAudioBufferSourceNode.onended=t;const n=this._nativeAudioBufferSourceNode.onended;this._onended=null!==n&&n===t?e:n}get playbackRate(){return this._playbackRate}start(e=0,t=0,n){if(this._nativeAudioBufferSourceNode.start(e,t,n),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.start=void 0===n?[e,t]:[e,t,n]),"closed"!==this.context.state){Sa(this);const e=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",e),Na(this)&&_a(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeAudioBufferSourceNode.stop(e),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=e)}})(lc,Oc,Rc,Ns,kc,$l,Ql,El),Lc=((e,t,n,r,o,i,a,s)=>class extends e{constructor(e,n){const r=i(e),l=a(r),c=o(r,n,l);super(e,!1,c,l?t(s):null),this._isNodeOfNativeOfflineAudioContext=l,this._nativeAudioDestinationNode=c}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(e){if(this._isNodeOfNativeOfflineAudioContext)throw r();if(e>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=e}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(e){if(this._isNodeOfNativeOfflineAudioContext)throw r();this._nativeAudioDestinationNode.channelCountMode=e}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}})(lc,(e=>{const t=new WeakMap;return{render(n,r){const o=t.get(r);return void 0!==o?Promise.resolve(o):(async(n,r)=>{const o=r.destination;return t.set(r,o),await e(n,r,o),o})(n,r)}}}),Ta,Ns,((e,t)=>(n,r,o)=>{const i=n.destination;if(i.channelCount!==r)try{i.channelCount=r}catch{}o&&"explicit"!==i.channelCountMode&&(i.channelCountMode="explicit"),0===i.maxChannelCount&&Object.defineProperty(i,"maxChannelCount",{value:r});const a=e(n,{channelCount:r,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,gain:1});return t(a,"channelCount",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t);try{i.channelCount=t}catch(e){if(t>i.maxChannelCount)throw e}})),t(a,"channelCountMode",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),i.channelCountMode=t})),t(a,"channelInterpretation",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),i.channelInterpretation=t})),Object.defineProperty(a,"maxChannelCount",{get:()=>i.maxChannelCount}),a.connect(i),a})(il,yl),$l,Ql,Gl),Bc=((e,t,n,r,o)=>()=>{const i=new WeakMap;return{render(a,s){const l=i.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=Ca(l,s);if(!c){const e={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=t(s,e)}return i.set(s,l),c?(await e(s,a.Q,l.Q),await e(s,a.detune,l.detune),await e(s,a.frequency,l.frequency),await e(s,a.gain,l.gain)):(await r(s,a.Q,l.Q),await r(s,a.detune,l.detune),await r(s,a.frequency,l.frequency),await r(s,a.gain,l.gain)),await o(a,s,l),l})(a,s)}}})(Ac,el,is,Ic,Gl),Dc=(e=>(t,n)=>e.set(t,n))(Ol),jc=(Fc=lc,zc=Rc,Uc=Bc,Hc=Ls,Gc=el,Wc=$l,Vc=Ql,qc=Dc,class extends Fc{constructor(e,t){const n=Wc(e),r={...Ms,...t},o=Gc(n,r),i=Vc(n);super(e,!1,o,i?Uc():null),this._Q=zc(this,i,o.Q,Pa,Ra),this._detune=zc(this,i,o.detune,1200*Math.log2(Pa),-1200*Math.log2(Pa)),this._frequency=zc(this,i,o.frequency,e.sampleRate/2,0),this._gain=zc(this,i,o.gain,40*Math.log10(Pa),Ra),this._nativeBiquadFilterNode=o,qc(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(e){this._nativeBiquadFilterNode.type=e}getFrequencyResponse(e,t,n){try{this._nativeBiquadFilterNode.getFrequencyResponse(e,t,n)}catch(e){if(11===e.code)throw Hc();throw e}if(e.length!==t.length||t.length!==n.length)throw Hc()}});var Fc,zc,Uc,Hc,Gc,Wc,Vc,qc;const Kc=((e,t)=>(n,r,o)=>{const i=new Set;var a,s;return n.connect=(a=n.connect,(o,s=0,l=0)=>{const c=0===i.size;if(t(o))return a.call(n,o,s,l),e(i,[o,s,l],(e=>e[0]===o&&e[1]===s&&e[2]===l),!0),c&&r(),o;a.call(n,o,s),e(i,[o,s],(e=>e[0]===o&&e[1]===s),!0),c&&r()}),n.disconnect=(s=n.disconnect,(e,r,a)=>{const l=i.size>0;if(void 0===e)s.apply(n),i.clear();else if("number"==typeof e){s.call(n,e);for(const t of i)t[1]===e&&i.delete(t)}else{t(e)?s.call(n,e,r,a):s.call(n,e,r);for(const t of i)t[0]!==e||void 0!==r&&t[1]!==r||void 0!==a&&t[2]!==a||i.delete(t)}const c=0===i.size;l&&c&&o()}),n})(Ja,ic),$c=(Jc=Ns,Xc=Kc,(e,t)=>{t.channelCount=1,t.channelCountMode="explicit",Object.defineProperty(t,"channelCount",{get:()=>1,set:()=>{throw Jc()}}),Object.defineProperty(t,"channelCountMode",{get:()=>"explicit",set:()=>{throw Jc()}});const n=e.createBufferSource();Xc(t,(()=>{const e=t.numberOfInputs;for(let r=0;r<e;r+=1)n.connect(t,0,r)}),(()=>n.disconnect(t)))});var Jc,Xc;const Qc=((e,t)=>(n,r)=>{const o=n.createChannelMerger(r.numberOfInputs);return null!==e&&"webkitAudioContext"===e.name&&t(n,o),Gs(o,r),o})(nc,$c),Yc=((e,t,n)=>()=>{const r=new WeakMap;return{render(o,i){const a=r.get(i);return void 0!==a?Promise.resolve(a):(async(o,i)=>{let a=t(o);if(!Ca(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=e(i,t)}return r.set(i,a),await n(o,i,a),a})(o,i)}}})(Qc,is,Gl),Zc=((e,t,n,r,o)=>class extends e{constructor(e,i){const a=r(e),s={..._s,...i};super(e,!1,n(a,s),o(a)?t():null)}})(lc,Yc,Qc,$l,Ql),eu=((e,t,n)=>()=>{const r=new WeakMap;return{render(o,i){const a=r.get(i);return void 0!==a?Promise.resolve(a):(async(o,i)=>{let a=t(o);if(!Ca(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=e(i,t)}return r.set(i,a),await n(o,i,a),a})(o,i)}}})(nl,is,Gl),tu=((e,t,n,r,o,i)=>class extends e{constructor(e,a){const s=r(e),l=i({...Es,...a});super(e,!1,n(s,l),o(s)?t():null)}})(lc,eu,nl,$l,Ql,(e=>({...e,channelCount:e.numberOfOutputs}))),nu=((e,t,n,r)=>(o,{offset:i,...a})=>{const s=o.createBuffer(1,2,44100),l=t(o,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),c=n(o,{...a,gain:i}),u=s.getChannelData(0);u[0]=1,u[1]=1,l.buffer=s,l.loop=!0;const d={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){c.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){c.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){c.channelInterpretation=e},get context(){return c.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get offset(){return c.gain},get onended(){return l.onended},set onended(e){l.onended=e},addEventListener:(...e)=>l.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>l.dispatchEvent(e[0]),removeEventListener:(...e)=>l.removeEventListener(e[0],e[1],e[2]),start(e=0){l.start.call(l,e)},stop(e=0){l.stop.call(l,e)}};return e(o,l),r(rl(d,c),(()=>l.connect(c)),(()=>l.disconnect(c)))})(wc,kc,il,Kc),ru=((e,t,n,r,o)=>(i,a)=>{if(void 0===i.createConstantSource)return n(i,a);const s=i.createConstantSource();return Gs(s,a),Vs(s,a,"offset"),t(r,(()=>r(i)))||Ks(s),t(o,(()=>o(i)))||$s(s),e(i,s),s})(wc,Nl,nu,xl,Ml),ou=((e,t,n,r,o)=>()=>{const i=new WeakMap;let a=null,s=null;return{set start(e){a=e},set stop(e){s=e},render(l,c){const u=i.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=n(l);const d=Ca(u,c);if(!d){const e={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,offset:u.offset.value};u=t(c,e),null!==a&&u.start(a),null!==s&&u.stop(s)}return i.set(c,u),d?await e(c,l.offset,u.offset):await r(c,l.offset,u.offset),await o(l,c,u),u})(l,c)}}})(Ac,ru,is,Ic,Gl),iu=((e,t,n,r,o,i,a)=>class extends e{constructor(e,a){const s=o(e),l={...As,...a},c=r(s,l),u=i(s),d=u?n():null;super(e,!1,c,d),this._constantSourceNodeRenderer=d,this._nativeConstantSourceNode=c,this._offset=t(this,u,c.offset,Pa,Ra),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(this,e):null;this._nativeConstantSourceNode.onended=t;const n=this._nativeConstantSourceNode.onended;this._onended=null!==n&&n===t?e:n}start(e=0){if(this._nativeConstantSourceNode.start(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=e),"closed"!==this.context.state){Sa(this);const e=()=>{this._nativeConstantSourceNode.removeEventListener("ended",e),Na(this)&&_a(this)};this._nativeConstantSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeConstantSourceNode.stop(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=e)}})(lc,Rc,ou,ru,$l,Ql,El),au=((e,t)=>(n,r)=>{const o=n.createConvolver();if(Gs(o,r),r.disableNormalization===o.normalize&&(o.normalize=!r.disableNormalization),Hs(o,r,"buffer"),r.channelCount>2)throw e();if(t(o,"channelCount",(e=>()=>e.call(o)),(t=>n=>{if(n>2)throw e();return t.call(o,n)})),"max"===r.channelCountMode)throw e();return t(o,"channelCountMode",(e=>()=>e.call(o)),(t=>n=>{if("max"===n)throw e();return t.call(o,n)})),o})(cl,yl),su=((e,t,n)=>()=>{const r=new WeakMap;return{render(o,i){const a=r.get(i);return void 0!==a?Promise.resolve(a):(async(o,i)=>{let a=t(o);if(!Ca(a,i)){const t={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=e(i,t)}return r.set(i,a),Ya(a)?await n(o,i,a.inputs[0]):await n(o,i,a),a})(o,i)}}})(au,is,Gl),lu=((e,t,n,r,o,i)=>class extends e{constructor(e,a){const s=r(e),l={...Cs,...a},c=n(s,l);super(e,!1,c,o(s)?t():null),this._isBufferNullified=!1,this._nativeConvolverNode=c,null!==l.buffer&&i(this,l.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(e){if(this._nativeConvolverNode.buffer=e,null===e&&null!==this._nativeConvolverNode.buffer){const e=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=e.createBuffer(1,1,e.sampleRate),this._isBufferNullified=!0,i(this,0)}else this._isBufferNullified=!1,i(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(e){this._nativeConvolverNode.normalize=e}})(lc,su,au,$l,Ql,Dc),cu=((e,t,n,r,o)=>i=>{const a=new WeakMap;return{render(s,l){const c=a.get(l);return void 0!==c?Promise.resolve(c):(async(s,l)=>{let c=n(s);const u=Ca(c,l);if(!u){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,delayTime:c.delayTime.value,maxDelayTime:i};c=t(l,e)}return a.set(l,c),u?await e(l,s.delayTime,c.delayTime):await r(l,s.delayTime,c.delayTime),await o(s,l,c),c})(s,l)}}})(Ac,ol,is,Ic,Gl),uu=((e,t,n,r,o,i,a)=>class extends e{constructor(e,s){const l=o(e),c={...Ts,...s},u=r(l,c),d=i(l);super(e,!1,u,d?n(c.maxDelayTime):null),this._delayTime=t(this,d,u.delayTime),a(this,c.maxDelayTime)}get delayTime(){return this._delayTime}})(lc,Rc,cu,ol,$l,Ql,Dc),du=(fu=cl,(e,t)=>{const n=e.createDynamicsCompressor();if(Gs(n,t),t.channelCount>2)throw fu();if("max"===t.channelCountMode)throw fu();return Vs(n,t,"attack"),Vs(n,t,"knee"),Vs(n,t,"ratio"),Vs(n,t,"release"),Vs(n,t,"threshold"),n});var fu;const hu=((e,t,n,r,o)=>()=>{const i=new WeakMap;return{render(a,s){const l=i.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=Ca(l,s);if(!c){const e={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=t(s,e)}return i.set(s,l),c?(await e(s,a.attack,l.attack),await e(s,a.knee,l.knee),await e(s,a.ratio,l.ratio),await e(s,a.release,l.release),await e(s,a.threshold,l.threshold)):(await r(s,a.attack,l.attack),await r(s,a.knee,l.knee),await r(s,a.ratio,l.ratio),await r(s,a.release,l.release),await r(s,a.threshold,l.threshold)),await o(a,s,l),l})(a,s)}}})(Ac,du,is,Ic,Gl),pu=((e,t,n,r,o,i,a,s)=>class extends e{constructor(e,o){const l=i(e),c={...Rs,...o},u=r(l,c),d=a(l);super(e,!1,u,d?n():null),this._attack=t(this,d,u.attack),this._knee=t(this,d,u.knee),this._nativeDynamicsCompressorNode=u,this._ratio=t(this,d,u.ratio),this._release=t(this,d,u.release),this._threshold=t(this,d,u.threshold),s(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(e){const t=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=e,e>2)throw this._nativeDynamicsCompressorNode.channelCount=t,o()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(e){const t=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=e,"max"===e)throw this._nativeDynamicsCompressorNode.channelCountMode=t,o()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"==typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}})(lc,Rc,hu,du,cl,$l,Ql,Dc),mu=((e,t,n,r,o)=>()=>{const i=new WeakMap;return{render(a,s){const l=i.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=Ca(l,s);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(s,e)}return i.set(s,l),c?await e(s,a.gain,l.gain):await r(s,a.gain,l.gain),await o(a,s,l),l})(a,s)}}})(Ac,il,is,Ic,Gl),gu=((e,t,n,r,o,i)=>class extends e{constructor(e,a){const s=o(e),l={...Ps,...a},c=r(s,l),u=i(s);super(e,!1,c,u?n():null),this._gain=t(this,u,c.gain,Pa,Ra)}get gain(){return this._gain}})(lc,Rc,mu,il,$l,Ql),vu=((e,t,n,r)=>(o,i,{channelCount:a,channelCountMode:s,channelInterpretation:l,feedback:c,feedforward:u})=>{const d=Xs(i,o.sampleRate),f=c instanceof Float64Array?c:new Float64Array(c),h=u instanceof Float64Array?u:new Float64Array(u),p=f.length,m=h.length,g=Math.min(p,m);if(0===p||p>20)throw r();if(0===f[0])throw t();if(0===m||m>20)throw r();if(0===h[0])throw t();if(1!==f[0]){for(let e=0;e<m;e+=1)h[e]/=f[0];for(let e=1;e<p;e+=1)f[e]/=f[0]}const v=n(o,d,a,a);v.channelCount=a,v.channelCountMode=s,v.channelInterpretation=l;const b=[],y=[],w=[];for(let e=0;e<a;e+=1){b.push(0);const e=new Float32Array(32),t=new Float32Array(32);e.fill(0),t.fill(0),y.push(e),w.push(t)}v.onaudioprocess=e=>{const t=e.inputBuffer,n=e.outputBuffer,r=t.numberOfChannels;for(let e=0;e<r;e+=1){const r=t.getChannelData(e),o=n.getChannelData(e);b[e]=js(f,p,h,m,g,y[e],w[e],b[e],32,r,o)}};const x=o.sampleRate/2;return rl({get bufferSize(){return d},get channelCount(){return v.channelCount},set channelCount(e){v.channelCount=e},get channelCountMode(){return v.channelCountMode},set channelCountMode(e){v.channelCountMode=e},get channelInterpretation(){return v.channelInterpretation},set channelInterpretation(e){v.channelInterpretation=e},get context(){return v.context},get inputs(){return[v]},get numberOfInputs(){return v.numberOfInputs},get numberOfOutputs(){return v.numberOfOutputs},addEventListener:(...e)=>v.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>v.dispatchEvent(e[0]),getFrequencyResponse(t,n,r){if(t.length!==n.length||n.length!==r.length)throw e();const o=t.length;for(let e=0;e<o;e+=1){const o=-Math.PI*(t[e]/x),i=[Math.cos(o),Math.sin(o)],a=al(sl(h,i),sl(f,i));n[e]=Math.sqrt(a[0]*a[0]+a[1]*a[1]),r[e]=Math.atan2(a[1],a[0])}},removeEventListener:(...e)=>v.removeEventListener(e[0],e[1],e[2])},v)})(Ls,Ns,ll,cl),bu=((e,t,n,r)=>o=>e(zs,(()=>zs(o)))?Promise.resolve(e(r,r)).then((e=>{if(!e){const e=n(o,512,0,1);o.oncomplete=()=>{e.onaudioprocess=null,e.disconnect()},e.onaudioprocess=()=>o.currentTime,e.connect(o.destination)}return o.startRendering()})):new Promise((e=>{const n=t(o,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});o.oncomplete=t=>{n.disconnect(),e(t.renderedBuffer)},n.connect(o.destination),o.startRendering()})))(Nl,il,ll,((e,t)=>()=>{if(null===t)return Promise.resolve(!1);const n=new t(1,1,44100),r=e(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise((e=>{n.oncomplete=()=>{r.disconnect(),e(0!==n.currentTime)},n.startRendering()}))})(il,Xl)),yu=((e,t,n,r,o)=>(i,a)=>{const s=new WeakMap;let l=null;const c=async(c,u)=>{let d=null,f=t(c);const h=Ca(f,u);if(void 0===u.createIIRFilter?d=e(u,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):h||(f=u.createIIRFilter(a,i)),s.set(u,null===d?f:d),null!==d){if(null===l){if(null===n)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new n(c.context.destination.channelCount,c.context.length,u.sampleRate);l=(async()=>{await r(c,e,e.destination);return((e,t,n,r)=>{const o=n instanceof Float64Array?n:new Float64Array(n),i=r instanceof Float64Array?r:new Float64Array(r),a=o.length,s=i.length,l=Math.min(a,s);if(1!==o[0]){for(let e=0;e<a;e+=1)i[e]/=o[0];for(let e=1;e<s;e+=1)o[e]/=o[0]}const c=new Float32Array(32),u=new Float32Array(32),d=t.createBuffer(e.numberOfChannels,e.length,e.sampleRate),f=e.numberOfChannels;for(let t=0;t<f;t+=1){const n=e.getChannelData(t),r=d.getChannelData(t);c.fill(0),u.fill(0),js(o,a,i,s,l,c,u,0,32,n,r)}return d})(await o(e),u,i,a)})()}const e=await l;return d.buffer=e,d.start(0),d}return await r(c,u,f),f};return{render(e,t){const n=s.get(t);return void 0!==n?Promise.resolve(n):c(e,t)}}})(kc,is,Xl,Gl,bu),wu=(xu=vu,(e,t,n)=>{if(void 0===e.createIIRFilter)return xu(e,t,n);const r=e.createIIRFilter(n.feedforward,n.feedback);return Gs(r,n),r});var xu;const Su=((e,t,n,r,o,i)=>class extends e{constructor(e,a){const s=r(e),l=o(s),c={...Ds,...a},u=t(s,l?null:e.baseLatency,c);super(e,!1,u,l?n(c.feedback,c.feedforward):null),Bs(u),this._nativeIIRFilterNode=u,i(this,1)}getFrequencyResponse(e,t,n){return this._nativeIIRFilterNode.getFrequencyResponse(e,t,n)}})(lc,wu,yu,$l,Ql,Dc),Mu=((e,t,n,r,o,i,a,s)=>(l,c)=>{const u=c.listener,{forwardX:d,forwardY:f,forwardZ:h,positionX:p,positionY:m,positionZ:g,upX:v,upY:b,upZ:y}=void 0===u.forwardX?(()=>{const d=new Float32Array(1),f=t(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),h=a(c);let p=!1,m=[0,0,-1,0,1,0],g=[0,0,0];const v=()=>{if(p)return;p=!0;const e=r(c,256,9,0);e.onaudioprocess=({inputBuffer:e})=>{const t=[i(e,d,0),i(e,d,1),i(e,d,2),i(e,d,3),i(e,d,4),i(e,d,5)];t.some(((e,t)=>e!==m[t]))&&(u.setOrientation(...t),m=t);const n=[i(e,d,6),i(e,d,7),i(e,d,8)];n.some(((e,t)=>e!==g[t]))&&(u.setPosition(...n),g=n)},f.connect(e)},b=e=>t=>{t!==m[e]&&(m[e]=t,u.setOrientation(...m))},y=e=>t=>{t!==g[e]&&(g[e]=t,u.setPosition(...g))},w=(t,r,i)=>{const a=n(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:r});a.connect(f,0,t),a.start(),Object.defineProperty(a.offset,"defaultValue",{get:()=>r});const u=e({context:l},h,a.offset,Pa,Ra);var d,p,m,g,b,y,w;return s(u,"value",(e=>()=>e.call(u)),(e=>t=>{try{e.call(u,t)}catch(e){if(9!==e.code)throw e}v(),h&&i(t)})),u.cancelAndHoldAtTime=(d=u.cancelAndHoldAtTime,h?()=>{throw o()}:(...e)=>{const t=d.apply(u,e);return v(),t}),u.cancelScheduledValues=(p=u.cancelScheduledValues,h?()=>{throw o()}:(...e)=>{const t=p.apply(u,e);return v(),t}),u.exponentialRampToValueAtTime=(m=u.exponentialRampToValueAtTime,h?()=>{throw o()}:(...e)=>{const t=m.apply(u,e);return v(),t}),u.linearRampToValueAtTime=(g=u.linearRampToValueAtTime,h?()=>{throw o()}:(...e)=>{const t=g.apply(u,e);return v(),t}),u.setTargetAtTime=(b=u.setTargetAtTime,h?()=>{throw o()}:(...e)=>{const t=b.apply(u,e);return v(),t}),u.setValueAtTime=(y=u.setValueAtTime,h?()=>{throw o()}:(...e)=>{const t=y.apply(u,e);return v(),t}),u.setValueCurveAtTime=(w=u.setValueCurveAtTime,h?()=>{throw o()}:(...e)=>{const t=w.apply(u,e);return v(),t}),u};return{forwardX:w(0,0,b(0)),forwardY:w(1,0,b(1)),forwardZ:w(2,-1,b(2)),positionX:w(6,0,y(0)),positionY:w(7,0,y(1)),positionZ:w(8,0,y(2)),upX:w(3,0,b(3)),upY:w(4,1,b(4)),upZ:w(5,0,b(5))}})():u;return{get forwardX(){return d},get forwardY(){return f},get forwardZ(){return h},get positionX(){return p},get positionY(){return m},get positionZ(){return g},get upX(){return v},get upY(){return b},get upZ(){return y}}})(Rc,Qc,ru,ll,cl,vl,Ql,yl),_u=new WeakMap,Eu=((e,t,n,r,o,i)=>class extends n{constructor(n,i){super(n),this._nativeContext=n,sa.set(this,n),r(n)&&o.set(n,new Set),this._destination=new e(this,i),this._listener=t(this,n),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(e){const t="function"==typeof e?i(this,e):null;this._nativeContext.onstatechange=t;const n=this._nativeContext.onstatechange;this._onstatechange=null!==n&&n===t?e:n}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}})(Lc,Mu,ec,Ql,_u,El),Au=((e,t,n,r,o,i)=>(a,s)=>{const l=a.createOscillator();return Gs(l,s),Vs(l,s,"detune"),Vs(l,s,"frequency"),void 0!==s.periodicWave?l.setPeriodicWave(s.periodicWave):Hs(l,s,"type"),t(n,(()=>n(a)))||Ks(l),t(r,(()=>r(a)))||i(l,a),t(o,(()=>o(a)))||$s(l),e(a,l),l})(wc,Nl,xl,Sl,Ml,_l),Cu=((e,t,n,r,o)=>()=>{const i=new WeakMap;let a=null,s=null,l=null;return{set periodicWave(e){a=e},set start(e){s=e},set stop(e){l=e},render(c,u){const d=i.get(u);return void 0!==d?Promise.resolve(d):(async(c,u)=>{let d=n(c);const f=Ca(d,u);if(!f){const e={channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,detune:d.detune.value,frequency:d.frequency.value,periodicWave:null===a?void 0:a,type:d.type};d=t(u,e),null!==s&&d.start(s),null!==l&&d.stop(l)}return i.set(u,d),f?(await e(u,c.detune,d.detune),await e(u,c.frequency,d.frequency)):(await r(u,c.detune,d.detune),await r(u,c.frequency,d.frequency)),await o(c,u,d),d})(c,u)}}})(Ac,Au,is,Ic,Gl),ku=((e,t,n,r,o,i,a)=>class extends e{constructor(e,a){const s=o(e),l={...dl,...a},c=n(s,l),u=i(s),d=u?r():null,f=e.sampleRate/2;super(e,!1,c,d),this._detune=t(this,u,c.detune,153600,-153600),this._frequency=t(this,u,c.frequency,f,-f),this._nativeOscillatorNode=c,this._onended=null,this._oscillatorNodeRenderer=d,null!==this._oscillatorNodeRenderer&&void 0!==l.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=l.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(this,e):null;this._nativeOscillatorNode.onended=t;const n=this._nativeOscillatorNode.onended;this._onended=null!==n&&n===t?e:n}get type(){return this._nativeOscillatorNode.type}set type(e){this._nativeOscillatorNode.type=e,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(e){this._nativeOscillatorNode.setPeriodicWave(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=e)}start(e=0){if(this._nativeOscillatorNode.start(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=e),"closed"!==this.context.state){Sa(this);const e=()=>{this._nativeOscillatorNode.removeEventListener("ended",e),Na(this)&&_a(this)};this._nativeOscillatorNode.addEventListener("ended",e)}}stop(e=0){this._nativeOscillatorNode.stop(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=e)}})(lc,Rc,Au,Cu,$l,Ql,El),Tu=(Iu=kc,(e,t)=>{const n=Iu(e,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),r=e.createBuffer(1,2,44100);return n.buffer=r,n.loop=!0,n.connect(t),n.start(),()=>{n.stop(),n.disconnect(t)}});var Iu;const Ou=((e,t,n,r,o)=>(i,{curve:a,oversample:s,...l})=>{const c=i.createWaveShaper(),u=i.createWaveShaper();Gs(c,l),Gs(u,l);const d=n(i,{...l,gain:1}),f=n(i,{...l,gain:-1}),h=n(i,{...l,gain:1}),p=n(i,{...l,gain:-1});let m=null,g=!1,v=null;const b={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){d.channelCount=e,f.channelCount=e,c.channelCount=e,h.channelCount=e,u.channelCount=e,p.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){d.channelCountMode=e,f.channelCountMode=e,c.channelCountMode=e,h.channelCountMode=e,u.channelCountMode=e,p.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){d.channelInterpretation=e,f.channelInterpretation=e,c.channelInterpretation=e,h.channelInterpretation=e,u.channelInterpretation=e,p.channelInterpretation=e},get context(){return c.context},get curve(){return v},set curve(n){if(null!==n&&n.length<2)throw t();if(null===n)c.curve=n,u.curve=n;else{const e=n.length,t=new Float32Array(e+2-e%2),r=new Float32Array(e+2-e%2);t[0]=n[0],r[0]=-n[e-1];const o=Math.ceil((e+1)/2),i=(e+1)/2-1;for(let a=1;a<o;a+=1){const s=a/o*i,l=Math.floor(s),c=Math.ceil(s);t[a]=l===c?n[l]:(1-(s-l))*n[l]+(1-(c-s))*n[c],r[a]=l===c?-n[e-1-l]:-(1-(s-l))*n[e-1-l]-(1-(c-s))*n[e-1-c]}t[o]=e%2==1?n[o-1]:(n[o-2]+n[o-1])/2,c.curve=t,u.curve=r}v=n,g&&(r(v)&&null===m?m=e(i,d):null!==m&&(m(),m=null))},get inputs(){return[d]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get oversample(){return c.oversample},set oversample(e){c.oversample=e,u.oversample=e},addEventListener:(...e)=>d.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>d.dispatchEvent(e[0]),removeEventListener:(...e)=>d.removeEventListener(e[0],e[1],e[2])};null!==a&&(b.curve=a instanceof Float32Array?a:new Float32Array(a)),s!==b.oversample&&(b.oversample=s);return o(rl(b,h),(()=>{d.connect(c).connect(h),d.connect(f).connect(u).connect(p).connect(h),g=!0,r(v)&&(m=e(i,d))}),(()=>{d.disconnect(c),c.disconnect(h),d.disconnect(f),f.disconnect(u),u.disconnect(p),p.disconnect(h),g=!1,null!==m&&(m(),m=null)}))})(Tu,Ns,il,bl,Kc),Ru=((e,t,n,r,o,i,a)=>(s,l)=>{const c=s.createWaveShaper();if(null!==i&&"webkitAudioContext"===i.name&&void 0===s.createGain().gain.automationRate)return n(s,l);Gs(c,l);const u=null===l.curve||l.curve instanceof Float32Array?l.curve:new Float32Array(l.curve);if(null!==u&&u.length<2)throw t();Hs(c,{curve:u},"curve"),Hs(c,l,"oversample");let d=null,f=!1;a(c,"curve",(e=>()=>e.call(c)),(t=>n=>(t.call(c,n),f&&(r(n)&&null===d?d=e(s,c):r(n)||null===d||(d(),d=null)),n)));return o(c,(()=>{f=!0,r(c.curve)&&(d=e(s,c))}),(()=>{f=!1,null!==d&&(d(),d=null)}))})(Tu,Ns,Ou,bl,Kc,nc,yl),Pu=((e,t,n,r,o,i,a,s,l,c)=>(u,{coneInnerAngle:d,coneOuterAngle:f,coneOuterGain:h,distanceModel:p,maxDistance:m,orientationX:g,orientationY:v,orientationZ:b,panningModel:y,positionX:w,positionY:x,positionZ:S,refDistance:M,rolloffFactor:_,...E})=>{const A=u.createPanner();if(E.channelCount>2)throw a();if("max"===E.channelCountMode)throw a();Gs(A,E);const C={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},k=n(u,{...C,channelInterpretation:"speakers",numberOfInputs:6}),T=r(u,{...E,gain:1}),I=r(u,{...C,gain:1}),O=r(u,{...C,gain:0}),R=r(u,{...C,gain:0}),P=r(u,{...C,gain:0}),N=r(u,{...C,gain:0}),L=r(u,{...C,gain:0}),B=o(u,256,6,1),D=i(u,{...C,curve:new Float32Array([1,1]),oversample:"none"});let j=[g,v,b],F=[w,x,S];const z=new Float32Array(1);B.onaudioprocess=({inputBuffer:e})=>{const t=[l(e,z,0),l(e,z,1),l(e,z,2)];t.some(((e,t)=>e!==j[t]))&&(A.setOrientation(...t),j=t);const n=[l(e,z,3),l(e,z,4),l(e,z,5)];n.some(((e,t)=>e!==F[t]))&&(A.setPosition(...n),F=n)},Object.defineProperty(O.gain,"defaultValue",{get:()=>0}),Object.defineProperty(R.gain,"defaultValue",{get:()=>0}),Object.defineProperty(P.gain,"defaultValue",{get:()=>0}),Object.defineProperty(N.gain,"defaultValue",{get:()=>0}),Object.defineProperty(L.gain,"defaultValue",{get:()=>0});const U={get bufferSize(){},get channelCount(){return A.channelCount},set channelCount(e){if(e>2)throw a();T.channelCount=e,A.channelCount=e},get channelCountMode(){return A.channelCountMode},set channelCountMode(e){if("max"===e)throw a();T.channelCountMode=e,A.channelCountMode=e},get channelInterpretation(){return A.channelInterpretation},set channelInterpretation(e){T.channelInterpretation=e,A.channelInterpretation=e},get coneInnerAngle(){return A.coneInnerAngle},set coneInnerAngle(e){A.coneInnerAngle=e},get coneOuterAngle(){return A.coneOuterAngle},set coneOuterAngle(e){A.coneOuterAngle=e},get coneOuterGain(){return A.coneOuterGain},set coneOuterGain(e){if(e<0||e>1)throw t();A.coneOuterGain=e},get context(){return A.context},get distanceModel(){return A.distanceModel},set distanceModel(e){A.distanceModel=e},get inputs(){return[T]},get maxDistance(){return A.maxDistance},set maxDistance(e){if(e<0)throw new RangeError;A.maxDistance=e},get numberOfInputs(){return A.numberOfInputs},get numberOfOutputs(){return A.numberOfOutputs},get orientationX(){return I.gain},get orientationY(){return O.gain},get orientationZ(){return R.gain},get panningModel(){return A.panningModel},set panningModel(e){A.panningModel=e},get positionX(){return P.gain},get positionY(){return N.gain},get positionZ(){return L.gain},get refDistance(){return A.refDistance},set refDistance(e){if(e<0)throw new RangeError;A.refDistance=e},get rolloffFactor(){return A.rolloffFactor},set rolloffFactor(e){if(e<0)throw new RangeError;A.rolloffFactor=e},addEventListener:(...e)=>T.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>T.dispatchEvent(e[0]),removeEventListener:(...e)=>T.removeEventListener(e[0],e[1],e[2])};d!==U.coneInnerAngle&&(U.coneInnerAngle=d),f!==U.coneOuterAngle&&(U.coneOuterAngle=f),h!==U.coneOuterGain&&(U.coneOuterGain=h),p!==U.distanceModel&&(U.distanceModel=p),m!==U.maxDistance&&(U.maxDistance=m),g!==U.orientationX.value&&(U.orientationX.value=g),v!==U.orientationY.value&&(U.orientationY.value=v),b!==U.orientationZ.value&&(U.orientationZ.value=b),y!==U.panningModel&&(U.panningModel=y),w!==U.positionX.value&&(U.positionX.value=w),x!==U.positionY.value&&(U.positionY.value=x),S!==U.positionZ.value&&(U.positionZ.value=S),M!==U.refDistance&&(U.refDistance=M),_!==U.rolloffFactor&&(U.rolloffFactor=_),1===j[0]&&0===j[1]&&0===j[2]||A.setOrientation(...j),0===F[0]&&0===F[1]&&0===F[2]||A.setPosition(...F);return c(rl(U,A),(()=>{T.connect(A),e(T,D,0,0),D.connect(I).connect(k,0,0),D.connect(O).connect(k,0,1),D.connect(R).connect(k,0,2),D.connect(P).connect(k,0,3),D.connect(N).connect(k,0,4),D.connect(L).connect(k,0,5),k.connect(B).connect(u.destination)}),(()=>{T.disconnect(A),s(T,D,0,0),D.disconnect(I),I.disconnect(k),D.disconnect(O),O.disconnect(k),D.disconnect(R),R.disconnect(k),D.disconnect(P),P.disconnect(k),D.disconnect(N),N.disconnect(k),D.disconnect(L),L.disconnect(k),k.disconnect(B),B.disconnect(u.destination)}))})(Za,Ns,Qc,il,ll,Ru,cl,os,vl,Kc),Nu=(Lu=Pu,(e,t)=>{const n=e.createPanner();return void 0===n.orientationX?Lu(e,t):(Gs(n,t),Vs(n,t,"orientationX"),Vs(n,t,"orientationY"),Vs(n,t,"orientationZ"),Vs(n,t,"positionX"),Vs(n,t,"positionY"),Vs(n,t,"positionZ"),Hs(n,t,"coneInnerAngle"),Hs(n,t,"coneOuterAngle"),Hs(n,t,"coneOuterGain"),Hs(n,t,"distanceModel"),Hs(n,t,"maxDistance"),Hs(n,t,"panningModel"),Hs(n,t,"refDistance"),Hs(n,t,"rolloffFactor"),n)});var Lu;const Bu=((e,t,n,r,o,i,a,s,l,c)=>()=>{const u=new WeakMap;let d=null;return{render(f,h){const p=u.get(h);return void 0!==p?Promise.resolve(p):(async(f,h)=>{let p=null,m=i(f);const g={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},v={...g,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},b=Ca(m,h);if("bufferSize"in m)p=r(h,{...g,gain:1});else if(!b){const e={...v,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=o(h,e)}if(u.set(h,null===p?m:p),null!==p){if(null===d){if(null===a)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new a(6,f.context.length,h.sampleRate),r=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});r.connect(e.destination),d=(async()=>{const t=await Promise.all([f.orientationX,f.orientationY,f.orientationZ,f.positionX,f.positionY,f.positionZ].map((async(t,r)=>{const o=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===r?1:0});return await s(e,t,o.offset),o})));for(let e=0;e<6;e+=1)t[e].connect(r,0,e),t[e].start(0);return c(e)})()}const e=await d,i=r(h,{...g,gain:1});await l(f,h,i);const u=[];for(let t=0;t<e.numberOfChannels;t+=1)u.push(e.getChannelData(t));let m=[u[0][0],u[1][0],u[2][0]],b=[u[3][0],u[4][0],u[5][0]],y=r(h,{...g,gain:1}),w=o(h,{...v,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:b[0],positionY:b[1],positionZ:b[2]});i.connect(y).connect(w.inputs[0]),w.connect(p);for(let t=128;t<e.length;t+=128){const e=[u[0][t],u[1][t],u[2][t]],n=[u[3][t],u[4][t],u[5][t]];if(e.some(((e,t)=>e!==m[t]))||n.some(((e,t)=>e!==b[t]))){m=e,b=n;const a=t/h.sampleRate;y.gain.setValueAtTime(0,a),y=r(h,{...g,gain:0}),w=o(h,{...v,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:b[0],positionY:b[1],positionZ:b[2]}),y.gain.setValueAtTime(1,a),i.connect(y).connect(w.inputs[0]),w.connect(p)}}return p}return b?(await e(h,f.orientationX,m.orientationX),await e(h,f.orientationY,m.orientationY),await e(h,f.orientationZ,m.orientationZ),await e(h,f.positionX,m.positionX),await e(h,f.positionY,m.positionY),await e(h,f.positionZ,m.positionZ)):(await s(h,f.orientationX,m.orientationX),await s(h,f.orientationY,m.orientationY),await s(h,f.orientationZ,m.orientationZ),await s(h,f.positionX,m.positionX),await s(h,f.positionY,m.positionY),await s(h,f.positionZ,m.positionZ)),Ya(m)?await l(f,h,m.inputs[0]):await l(f,h,m),m})(f,h)}}})(Ac,Qc,ru,il,Nu,is,Xl,Ic,Gl,bu),Du=((e,t,n,r,o,i,a)=>class extends e{constructor(e,s){const l=o(e),c={...fl,...s},u=n(l,c),d=i(l);super(e,!1,u,d?r():null),this._nativePannerNode=u,this._orientationX=t(this,d,u.orientationX,Pa,Ra),this._orientationY=t(this,d,u.orientationY,Pa,Ra),this._orientationZ=t(this,d,u.orientationZ,Pa,Ra),this._positionX=t(this,d,u.positionX,Pa,Ra),this._positionY=t(this,d,u.positionY,Pa,Ra),this._positionZ=t(this,d,u.positionZ,Pa,Ra),a(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(e){this._nativePannerNode.coneInnerAngle=e}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(e){this._nativePannerNode.coneOuterAngle=e}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(e){this._nativePannerNode.coneOuterGain=e}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(e){this._nativePannerNode.distanceModel=e}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(e){this._nativePannerNode.maxDistance=e}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(e){this._nativePannerNode.panningModel=e}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(e){this._nativePannerNode.refDistance=e}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(e){this._nativePannerNode.rolloffFactor=e}})(lc,Rc,Nu,Bu,$l,Ql,Dc),ju=(e=>(t,{disableNormalization:n,imag:r,real:o})=>{const i=r instanceof Float32Array?r:new Float32Array(r),a=o instanceof Float32Array?o:new Float32Array(o),s=t.createPeriodicWave(a,i,{disableNormalization:n});if(Array.from(r).length<2)throw e();return s})(Ta),Fu=((e,t,n,r)=>class o{constructor(o,i){const a=t(o),s=r({...hl,...i}),l=e(a,s);return n.add(l),l}static[Symbol.hasInstance](e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===o.prototype||n.has(e)}})(ju,$l,new WeakSet,(e=>{const{imag:t,real:n}=e;return void 0===t?void 0===n?{...e,imag:[0,0],real:[0,0]}:{...e,imag:Array.from(n,(()=>0)),real:n}:void 0===n?{...e,imag:t,real:Array.from(t,(()=>0))}:{...e,imag:t,real:n}})),zu=((e,t,n,r,o,i)=>{const a=16385,s=new Float32Array([1,1]),l=Math.PI/2,c={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...c,oversample:"none"},d=(e,i,d,f,h)=>{if(1===i)return((e,t,o,i)=>{const d=new Float32Array(a),f=new Float32Array(a);for(let e=0;e<a;e+=1){const t=e/16384*l;d[e]=Math.cos(t),f[e]=Math.sin(t)}const h=n(e,{...c,gain:0}),p=r(e,{...u,curve:d}),m=r(e,{...u,curve:s}),g=n(e,{...c,gain:0}),v=r(e,{...u,curve:f});return{connectGraph(){t.connect(h),t.connect(void 0===m.inputs?m:m.inputs[0]),t.connect(g),m.connect(o),o.connect(void 0===p.inputs?p:p.inputs[0]),o.connect(void 0===v.inputs?v:v.inputs[0]),p.connect(h.gain),v.connect(g.gain),h.connect(i,0,0),g.connect(i,0,1)},disconnectGraph(){t.disconnect(h),t.disconnect(void 0===m.inputs?m:m.inputs[0]),t.disconnect(g),m.disconnect(o),o.disconnect(void 0===p.inputs?p:p.inputs[0]),o.disconnect(void 0===v.inputs?v:v.inputs[0]),p.disconnect(h.gain),v.disconnect(g.gain),h.disconnect(i,0,0),g.disconnect(i,0,1)}}})(e,d,f,h);if(2===i)return((e,o,i,d)=>{const f=new Float32Array(a),h=new Float32Array(a),p=new Float32Array(a),m=new Float32Array(a),g=Math.floor(8192.5);for(let e=0;e<a;e+=1)if(e>g){const t=(e-g)/(16384-g)*l;f[e]=Math.cos(t),h[e]=Math.sin(t),p[e]=0,m[e]=1}else{const t=e/(16384-g)*l;f[e]=1,h[e]=0,p[e]=Math.cos(t),m[e]=Math.sin(t)}const v=t(e,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),b=n(e,{...c,gain:0}),y=r(e,{...u,curve:f}),w=n(e,{...c,gain:0}),x=r(e,{...u,curve:h}),S=r(e,{...u,curve:s}),M=n(e,{...c,gain:0}),_=r(e,{...u,curve:p}),E=n(e,{...c,gain:0}),A=r(e,{...u,curve:m});return{connectGraph(){o.connect(v),o.connect(void 0===S.inputs?S:S.inputs[0]),v.connect(b,0),v.connect(w,0),v.connect(M,1),v.connect(E,1),S.connect(i),i.connect(void 0===y.inputs?y:y.inputs[0]),i.connect(void 0===x.inputs?x:x.inputs[0]),i.connect(void 0===_.inputs?_:_.inputs[0]),i.connect(void 0===A.inputs?A:A.inputs[0]),y.connect(b.gain),x.connect(w.gain),_.connect(M.gain),A.connect(E.gain),b.connect(d,0,0),M.connect(d,0,0),w.connect(d,0,1),E.connect(d,0,1)},disconnectGraph(){o.disconnect(v),o.disconnect(void 0===S.inputs?S:S.inputs[0]),v.disconnect(b,0),v.disconnect(w,0),v.disconnect(M,1),v.disconnect(E,1),S.disconnect(i),i.disconnect(void 0===y.inputs?y:y.inputs[0]),i.disconnect(void 0===x.inputs?x:x.inputs[0]),i.disconnect(void 0===_.inputs?_:_.inputs[0]),i.disconnect(void 0===A.inputs?A:A.inputs[0]),y.disconnect(b.gain),x.disconnect(w.gain),_.disconnect(M.gain),A.disconnect(E.gain),b.disconnect(d,0,0),M.disconnect(d,0,0),w.disconnect(d,0,1),E.disconnect(d,0,1)}}})(e,d,f,h);throw o()};return(t,{channelCount:r,channelCountMode:a,pan:s,...l})=>{if("max"===a)throw o();const c=e(t,{...l,channelCount:1,channelCountMode:a,numberOfInputs:2}),u=n(t,{...l,channelCount:r,channelCountMode:a,gain:1}),f=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:s});let{connectGraph:h,disconnectGraph:p}=d(t,r,u,f,c);Object.defineProperty(f.gain,"defaultValue",{get:()=>0}),Object.defineProperty(f.gain,"maxValue",{get:()=>1}),Object.defineProperty(f.gain,"minValue",{get:()=>-1});const m={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){u.channelCount!==e&&(g&&p(),({connectGraph:h,disconnectGraph:p}=d(t,e,u,f,c)),g&&h()),u.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){if("clamped-max"===e||"max"===e)throw o();u.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){u.channelInterpretation=e},get context(){return u.context},get inputs(){return[u]},get numberOfInputs(){return u.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get pan(){return f.gain},addEventListener:(...e)=>u.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>u.dispatchEvent(e[0]),removeEventListener:(...e)=>u.removeEventListener(e[0],e[1],e[2])};let g=!1;return i(rl(m,c),(()=>{h(),g=!0}),(()=>{p(),g=!1}))}})(Qc,nl,il,Ru,cl,Kc),Uu=((e,t)=>(n,r)=>{const o=r.channelCountMode;if("clamped-max"===o)throw t();if(void 0===n.createStereoPanner)return e(n,r);const i=n.createStereoPanner();return Gs(i,r),Vs(i,r,"pan"),Object.defineProperty(i,"channelCountMode",{get:()=>o,set:e=>{if(e!==o)throw t()}}),i})(zu,cl),Hu=((e,t,n,r,o)=>()=>{const i=new WeakMap;return{render(a,s){const l=i.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=Ca(l,s);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(s,e)}return i.set(s,l),c?await e(s,a.pan,l.pan):await r(s,a.pan,l.pan),Ya(l)?await o(a,s,l.inputs[0]):await o(a,s,l),l})(a,s)}}})(Ac,Uu,is,Ic,Gl),Gu=((e,t,n,r,o,i)=>class extends e{constructor(e,a){const s=o(e),l={...pl,...a},c=n(s,l),u=i(s);super(e,!1,c,u?r():null),this._pan=t(this,u,c.pan)}get pan(){return this._pan}})(lc,Rc,Uu,Hu,$l,Ql),Wu=((e,t,n)=>()=>{const r=new WeakMap;return{render(o,i){const a=r.get(i);return void 0!==a?Promise.resolve(a):(async(o,i)=>{let a=t(o);if(!Ca(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=e(i,t)}return r.set(i,a),Ya(a)?await n(o,i,a.inputs[0]):await n(o,i,a),a})(o,i)}}})(Ru,is,Gl),Vu=((e,t,n,r,o,i,a)=>class extends e{constructor(e,t){const s=o(e),l={...gl,...t},c=n(s,l);super(e,!0,c,i(s)?r():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=c,a(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(e){if(null===e)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(e.length<2)throw t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=e}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(e){this._nativeWaveShaperNode.oversample=e}})(lc,Ns,Ru,Wu,$l,Ql,Dc),qu=(e=>null!==e&&e.isSecureContext)(Dl),Ku=(e=>(t,n,r)=>{Object.defineProperties(e,{currentFrame:{configurable:!0,get:()=>Math.round(t*n)},currentTime:{configurable:!0,get:()=>t}});try{return r()}finally{null!==e&&(delete e.currentFrame,delete e.currentTime)}})(Dl),$u=new WeakMap,Ju=((e,t)=>n=>{let r=e.get(n);if(void 0!==r)return r;if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");return r=new t(1,1,44100),e.set(n,r),r})($u,Xl),Xu=qu?((e,t,n,r,o,i,a,s,l,c,u,d,f)=>{let h=0;return(p,m,g={credentials:"omit"})=>{const v=u.get(p);if(void 0!==v&&v.has(m))return Promise.resolve();const b=c.get(p);if(void 0!==b){const e=b.get(m);if(void 0!==e)return e}const y=i(p),w=void 0===y.audioWorklet?o(m).then((([e,t])=>{const[r,o]=ma(e,t);return n(`${r};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${o}\n})})(window,'_AWGS')`)})).then((()=>{const e=f._AWGS.pop();if(void 0===e)throw new SyntaxError;r(y.currentTime,y.sampleRate,(()=>e(class{},void 0,((e,n)=>{if(""===e.trim())throw t();const r=ua.get(y);if(void 0!==r){if(r.has(e))throw t();va(n),ga(n.parameterDescriptors),r.set(e,n)}else va(n),ga(n.parameterDescriptors),ua.set(y,new Map([[e,n]]))}),y.sampleRate,void 0,void 0)))})):Promise.all([o(m),Promise.resolve(e(d,d))]).then((([[e,t],n])=>{const r=h+1;h=r;const[o,i]=ma(e,t),c=new Blob([`${o};((AudioWorkletProcessor,registerProcessor)=>{${i}\n})(${n?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${n?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${n?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${r}',class extends AudioWorkletProcessor{process(){return !1}})`],{type:"application/javascript; charset=utf-8"}),u=URL.createObjectURL(c);return y.audioWorklet.addModule(u,g).then((()=>{if(s(y))return y;const e=a(y);return e.audioWorklet.addModule(u,g).then((()=>e))})).then((e=>{if(null===l)throw new SyntaxError;try{new l(e,`__sac${r}`)}catch{throw new SyntaxError}})).finally((()=>URL.revokeObjectURL(u)))}));return void 0===b?c.set(p,new Map([[m,w]])):b.set(m,w),w.then((()=>{const e=u.get(p);void 0===e?u.set(p,new Set([m])):e.add(m)})).finally((()=>{const e=c.get(p);void 0!==e&&e.delete(m)})),w}})(Nl,cl,(e=>t=>new Promise(((n,r)=>{if(null===e)return void r(new SyntaxError);const o=e.document.head;if(null===o)r(new SyntaxError);else{const i=e.document.createElement("script"),a=new Blob([t],{type:"application/javascript"}),s=URL.createObjectURL(a),l=e.onerror,c=()=>{e.onerror=l,URL.revokeObjectURL(s)};e.onerror=(t,n,o,i,a)=>n===s||n===e.location.href&&1===o&&1===i?(c(),r(a),!1):null!==l?l(t,n,o,i,a):void 0,i.onerror=()=>{c(),r(new SyntaxError)},i.onload=()=>{c(),n()},i.src=s,i.type="module",o.appendChild(i)}})))(Dl),Ku,(Qu=()=>new DOMException("","AbortError"),async e=>{try{const t=await fetch(e);if(t.ok)return[await t.text(),t.url]}catch{}throw Qu()}),$l,Ju,Ql,sc,new WeakMap,new WeakMap,((e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const n=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),r=new t(1,128,44100),o=URL.createObjectURL(n);let i=!1,a=!1;try{await r.audioWorklet.addModule(o);const t=new e(r,"a",{numberOfOutputs:0}),n=r.createOscillator();t.port.onmessage=()=>i=!0,t.onprocessorerror=()=>a=!0,n.connect(t),n.start(0),await r.startRendering()}catch{}finally{URL.revokeObjectURL(o)}return i&&!a})(sc,Xl),Dl):void 0;var Qu;const Yu=((e,t)=>n=>e(n)||t(n))(rc,Ql),Zu=((e,t,n,r,o,i,a,s,l,c,u)=>(d,f)=>{const h=a(d)?d:i(d);if(o.has(f)){const e=n();return Promise.reject(e)}try{o.add(f)}catch{}return t(l,(()=>l(h)))?h.decodeAudioData(f).then((n=>(ks(f).catch((()=>{})),t(s,(()=>s(n)))||u(n),e.add(n),n))):new Promise(((t,n)=>{const o=async()=>{try{await ks(f)}catch{}},i=e=>{n(e),o()};try{h.decodeAudioData(f,(n=>{"function"!=typeof n.copyFromChannel&&(c(n),Ia(n)),e.add(n),o().then((()=>t(n)))}),(e=>{i(null===e?r():e)}))}catch(e){i(e)}}))})(dc,Nl,(()=>new DOMException("","DataCloneError")),(()=>new DOMException("","EncodingError")),new WeakSet,$l,Yu,ka,zs,mc,gc),ed=(td=Xu,nd=uc,rd=bc,od=Nc,id=jc,ad=Zc,sd=tu,ld=iu,cd=lu,ud=Zu,dd=uu,fd=pu,hd=gu,pd=Su,md=Eu,gd=ku,vd=Du,bd=Fu,yd=Gu,wd=Vu,class extends md{constructor(e,t){super(e,t),this._nativeContext=e,this._audioWorklet=void 0===td?void 0:{addModule:(e,t)=>td(this,e,t)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new nd(this)}createBiquadFilter(){return new id(this)}createBuffer(e,t,n){return new rd({length:t,numberOfChannels:e,sampleRate:n})}createBufferSource(){return new od(this)}createChannelMerger(e=6){return new ad(this,{numberOfInputs:e})}createChannelSplitter(e=6){return new sd(this,{numberOfOutputs:e})}createConstantSource(){return new ld(this)}createConvolver(){return new cd(this)}createDelay(e=1){return new dd(this,{maxDelayTime:e})}createDynamicsCompressor(){return new fd(this)}createGain(){return new hd(this)}createIIRFilter(e,t){return new pd(this,{feedback:t,feedforward:e})}createOscillator(){return new gd(this)}createPanner(){return new vd(this)}createPeriodicWave(e,t,n={disableNormalization:!1}){return new bd(this,{...n,imag:t,real:e})}createStereoPanner(){return new yd(this)}createWaveShaper(){return new wd(this)}decodeAudioData(e,t,n){return ud(this._nativeContext,e).then((e=>("function"==typeof t&&t(e),e)),(e=>{throw"function"==typeof n&&n(e),e}))}});var td,nd,rd,od,id,ad,sd,ld,cd,ud,dd,fd,hd,pd,md,gd,vd,bd,yd,wd;const xd=((e,t,n,r)=>class extends e{constructor(e,o){const i=n(e),a=t(i,o);if(r(i))throw TypeError();super(e,!0,a,null),this._nativeMediaElementAudioSourceNode=a}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}})(lc,((e,t)=>e.createMediaElementSource(t.mediaElement)),$l,Ql),Sd=((e,t,n,r)=>class extends e{constructor(e,o){const i=n(e);if(r(i))throw new TypeError;const a={...Fs,...o},s=t(i,a);super(e,!1,s,null),this._nativeMediaStreamAudioDestinationNode=s}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}})(lc,((e,t)=>{const n=e.createMediaStreamDestination();return Gs(n,t),1===n.numberOfOutputs&&Object.defineProperty(n,"numberOfOutputs",{get:()=>0}),n}),$l,Ql),Md=((e,t,n,r)=>class extends e{constructor(e,o){const i=n(e),a=t(i,o);if(r(i))throw new TypeError;super(e,!0,a,null),this._nativeMediaStreamAudioSourceNode=a}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}})(lc,((e,{mediaStream:t})=>{const n=t.getAudioTracks();n.sort(((e,t)=>e.id<t.id?-1:e.id>t.id?1:0));const r=n.slice(0,1),o=e.createMediaStreamSource(new MediaStream(r));return Object.defineProperty(o,"mediaStream",{value:t}),o}),$l,Ql),_d=((e,t)=>(n,{mediaStreamTrack:r})=>{if("function"==typeof n.createMediaStreamTrackSource)return n.createMediaStreamTrackSource(r);const o=new MediaStream([r]),i=n.createMediaStreamSource(o);if("audio"!==r.kind)throw e();if(t(n))throw new TypeError;return i})(Ns,Ql),Ed=((e,t,n)=>class extends e{constructor(e,r){const o=n(e);super(e,!0,t(o,r),null)}})(lc,_d,$l),Ad=((e,t,n,r,o,i,a,s,l)=>class extends e{constructor(e={}){if(null===l)throw new Error("Missing the native AudioContext constructor.");let t;try{t=new l(e)}catch(e){if(12===e.code&&"sampleRate is not in range"===e.message)throw n();throw e}if(null===t)throw r();if(!qa(e.latencyHint))throw new TypeError(`The provided value '${e.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==e.sampleRate&&t.sampleRate!==e.sampleRate)throw n();super(t,2);const{latencyHint:o}=e,{sampleRate:i}=t;if(this._baseLatency="number"==typeof t.baseLatency?t.baseLatency:"balanced"===o?512/i:"interactive"===o||void 0===o?256/i:"playback"===o?1024/i:128*Math.max(2,Math.min(128,Math.round(o*i/128)))/i,this._nativeAudioContext=t,"webkitAudioContext"===l.name?(this._nativeGainNode=t.createGain(),this._nativeOscillatorNode=t.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(t.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===t.state){this._state="suspended";const e=()=>{"suspended"===this._state&&(this._state=null),t.removeEventListener("statechange",e)};t.addEventListener("statechange",e)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then((()=>{throw t()})):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then((()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),Va(this)})))}createMediaElementSource(e){return new o(this,{mediaElement:e})}createMediaStreamDestination(){return new i(this)}createMediaStreamSource(e){return new a(this,{mediaStream:e})}createMediaStreamTrackSource(e){return new s(this,{mediaStreamTrack:e})}resume(){return"suspended"===this._state?new Promise(((e,t)=>{const n=()=>{this._nativeAudioContext.removeEventListener("statechange",n),"running"===this._nativeAudioContext.state?e():this.resume().then(e,t)};this._nativeAudioContext.addEventListener("statechange",n)})):this._nativeAudioContext.resume().catch((e=>{if(void 0===e||15===e.code)throw t();throw e}))}suspend(){return this._nativeAudioContext.suspend().catch((e=>{if(void 0===e)throw t();throw e}))}})(ed,Ns,cl,ml,xd,Sd,Md,Ed,nc),Cd=(kd=_u,e=>{const t=kd.get(e);if(void 0===t)throw new Error("The context has no set of AudioWorkletNodes.");return t});var kd;const Td=(Id=Cd,(e,t)=>{Id(e).add(t)});var Id;const Od=(e=>(t,n,r=0,o=0)=>{const i=t[r];if(void 0===i)throw e();return ds(n)?i.connect(n,0,o):i.connect(n,0)})(Ta),Rd=(e=>(t,n)=>{e(t).delete(n)})(Cd),Pd=(e=>(t,n,r,o=0)=>void 0===n?t.forEach((e=>e.disconnect())):"number"==typeof n?Os(e,t,n).disconnect():ds(n)?void 0===r?t.forEach((e=>e.disconnect(n))):void 0===o?Os(e,t,r).disconnect(n,0):Os(e,t,r).disconnect(n,0,o):void 0===r?t.forEach((e=>e.disconnect(n))):Os(e,t,r).disconnect(n,0))(Ta),Nd=new WeakMap,Ld=(Bd=Nd,Dd=ba,e=>Dd(Bd,e));var Bd,Dd;const jd=((e,t,n,r,o,i,a,s,l,c,u,d,f)=>(h,p,m,g)=>{if(0===g.numberOfInputs&&0===g.numberOfOutputs)throw l();const v=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(v.some((e=>e<1)))throw l();if(v.length!==g.numberOfOutputs)throw t();if("explicit"!==g.channelCountMode)throw l();const b=g.channelCount*g.numberOfInputs,y=v.reduce(((e,t)=>e+t),0),w=void 0===m.parameterDescriptors?0:m.parameterDescriptors.length;if(b+w>6||y>6)throw l();const x=new MessageChannel,S=[],M=[];for(let e=0;e<g.numberOfInputs;e+=1)S.push(a(h,{channelCount:g.channelCount,channelCountMode:g.channelCountMode,channelInterpretation:g.channelInterpretation,gain:1})),M.push(o(h,{channelCount:g.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:g.channelCount}));const _=[];if(void 0!==m.parameterDescriptors)for(const{defaultValue:e,maxValue:t,minValue:n,name:r}of m.parameterDescriptors){const o=i(h,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:void 0!==g.parameterData[r]?g.parameterData[r]:void 0===e?0:e});Object.defineProperties(o.offset,{defaultValue:{get:()=>void 0===e?0:e},maxValue:{get:()=>void 0===t?Pa:t},minValue:{get:()=>void 0===n?Ra:n}}),_.push(o)}const E=r(h,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,b+w)}),A=Xs(p,h.sampleRate),C=s(h,A,b+w,Math.max(1,y)),k=o(h,{channelCount:Math.max(1,y),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,y)}),T=[];for(let e=0;e<g.numberOfOutputs;e+=1)T.push(r(h,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:v[e]}));for(let e=0;e<g.numberOfInputs;e+=1){S[e].connect(M[e]);for(let t=0;t<g.channelCount;t+=1)M[e].connect(E,t,e*g.channelCount+t)}const I=new gs(void 0===m.parameterDescriptors?[]:m.parameterDescriptors.map((({name:e},t)=>{const n=_[t];return n.connect(E,0,b+t),n.start(0),[e,n.offset]})));E.connect(C);let O=g.channelInterpretation,R=null;const P=0===g.numberOfOutputs?[C]:T,N={get bufferSize(){return A},get channelCount(){return g.channelCount},set channelCount(e){throw n()},get channelCountMode(){return g.channelCountMode},set channelCountMode(e){throw n()},get channelInterpretation(){return O},set channelInterpretation(e){for(const t of S)t.channelInterpretation=e;O=e},get context(){return C.context},get inputs(){return S},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return R},set onprocessorerror(e){"function"==typeof R&&N.removeEventListener("processorerror",R),R="function"==typeof e?e:null,"function"==typeof R&&N.addEventListener("processorerror",R)},get parameters(){return I},get port(){return x.port2},addEventListener:(...e)=>C.addEventListener(e[0],e[1],e[2]),connect:e.bind(null,P),disconnect:c.bind(null,P),dispatchEvent:(...e)=>C.dispatchEvent(e[0]),removeEventListener:(...e)=>C.removeEventListener(e[0],e[1],e[2])},L=new Map;var B,D;x.port1.addEventListener=(B=x.port1.addEventListener,(...e)=>{if("message"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=L.get(e[1]);void 0!==n?e[1]=n:(e[1]=e=>{u(h.currentTime,h.sampleRate,(()=>t(e)))},L.set(t,e[1]))}}return B.call(x.port1,e[0],e[1],e[2])}),x.port1.removeEventListener=(D=x.port1.removeEventListener,(...e)=>{if("message"===e[0]){const t=L.get(e[1]);void 0!==t&&(L.delete(e[1]),e[1]=t)}return D.call(x.port1,e[0],e[1],e[2])});let j=null;Object.defineProperty(x.port1,"onmessage",{get:()=>j,set:e=>{"function"==typeof j&&x.port1.removeEventListener("message",j),j="function"==typeof e?e:null,"function"==typeof j&&(x.port1.addEventListener("message",j),x.port1.start())}}),m.prototype.port=x.port1;let F=null;Zs(h,N,m,g).then((e=>F=e));const z=ws(g.numberOfInputs,g.channelCount),U=ws(g.numberOfOutputs,v),H=void 0===m.parameterDescriptors?[]:m.parameterDescriptors.reduce(((e,{name:t})=>({...e,[t]:new Float32Array(128)})),{});let G=!0;const W=()=>{g.numberOfOutputs>0&&C.disconnect(k);for(let e=0,t=0;e<g.numberOfOutputs;e+=1){const n=T[e];for(let r=0;r<v[e];r+=1)k.disconnect(n,t+r,r);t+=v[e]}},V=new Map;C.onaudioprocess=({inputBuffer:e,outputBuffer:t})=>{if(null!==F){const n=d(N);for(let r=0;r<A;r+=128){for(let t=0;t<g.numberOfInputs;t+=1)for(let n=0;n<g.channelCount;n+=1)bs(e,z[t],n,n,r);void 0!==m.parameterDescriptors&&m.parameterDescriptors.forEach((({name:t},n)=>{bs(e,H,t,b+n,r)}));for(let e=0;e<g.numberOfInputs;e+=1)for(let t=0;t<v[e];t+=1)0===U[e][t].byteLength&&(U[e][t]=new Float32Array(128));try{const e=z.map(((e,t)=>{if(n[t].size>0)return V.set(t,A/128),e;const r=V.get(t);return void 0===r?[]:(e.every((e=>e.every((e=>0===e))))&&(1===r?V.delete(t):V.set(t,r-1)),e)})),o=u(h.currentTime+r/h.sampleRate,h.sampleRate,(()=>F.process(e,U,H)));G=o;for(let e=0,n=0;e<g.numberOfOutputs;e+=1){for(let o=0;o<v[e];o+=1)ys(t,U[e],o,n+o,r);n+=v[e]}}catch(e){G=!1,N.dispatchEvent(new ErrorEvent("processorerror",{colno:e.colno,filename:e.filename,lineno:e.lineno,message:e.message}))}if(!G){for(let e=0;e<g.numberOfInputs;e+=1){S[e].disconnect(M[e]);for(let t=0;t<g.channelCount;t+=1)M[r].disconnect(E,t,e*g.channelCount+t)}if(void 0!==m.parameterDescriptors){const e=m.parameterDescriptors.length;for(let t=0;t<e;t+=1){const e=_[t];e.disconnect(E,0,b+t),e.stop()}}E.disconnect(C),C.onaudioprocess=null,q?W():J();break}}}};let q=!1;const K=a(h,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0}),$=()=>C.connect(K).connect(h.destination),J=()=>{C.disconnect(K),K.disconnect()};return $(),f(N,(()=>{if(G){J(),g.numberOfOutputs>0&&C.connect(k);for(let e=0,t=0;e<g.numberOfOutputs;e+=1){const n=T[e];for(let r=0;r<v[e];r+=1)k.connect(n,t+r,r);t+=v[e]}}q=!0}),(()=>{G&&($(),W()),q=!1}))})(Od,Ta,Ns,Qc,nl,ru,il,ll,cl,Pd,Ku,Ld,Kc),Fd=((e,t,n,r,o)=>(i,a,s,l,c,u)=>{if(null!==s)try{const t=new s(i,l,u),r=new Map;let a=null;if(Object.defineProperties(t,{channelCount:{get:()=>u.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>"explicit",set:()=>{throw e()}},onprocessorerror:{get:()=>a,set:e=>{"function"==typeof a&&t.removeEventListener("processorerror",a),a="function"==typeof e?e:null,"function"==typeof a&&t.addEventListener("processorerror",a)}}}),t.addEventListener=(f=t.addEventListener,(...e)=>{if("processorerror"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=r.get(e[1]);void 0!==n?e[1]=n:(e[1]=n=>{"error"===n.type?(Object.defineProperties(n,{type:{value:"processorerror"}}),t(n)):t(new ErrorEvent(e[0],{...n}))},r.set(t,e[1]))}}return f.call(t,"error",e[1],e[2]),f.call(t,...e)}),t.removeEventListener=(d=t.removeEventListener,(...e)=>{if("processorerror"===e[0]){const t=r.get(e[1]);void 0!==t&&(r.delete(e[1]),e[1]=t)}return d.call(t,"error",e[1],e[2]),d.call(t,e[0],e[1],e[2])}),0!==u.numberOfOutputs){const e=n(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(e).connect(i.destination);return o(t,(()=>e.disconnect()),(()=>e.connect(i.destination)))}return t}catch(e){if(11===e.code)throw r();throw e}var d,f;if(void 0===c)throw r();return Js(u),t(i,a,c,u)})(Ns,jd,il,cl,Kc),zd=((e,t,n,r,o,i,a,s,l,c,u,d,f,h,p,m)=>(g,v,b)=>{const y=new WeakMap;let w=null;return{render(x,S){s(S,x);const M=y.get(S);return void 0!==M?Promise.resolve(M):(async(s,x)=>{let S=u(s),M=null;const _=Ca(S,x),E=Array.isArray(v.outputChannelCount)?v.outputChannelCount:Array.from(v.outputChannelCount);if(null===d){const e=E.reduce(((e,t)=>e+t),0),n=o(x,{channelCount:Math.max(1,e),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,e)}),i=[];for(let e=0;e<s.numberOfOutputs;e+=1)i.push(r(x,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:E[e]}));const c=a(x,{channelCount:v.channelCount,channelCountMode:v.channelCountMode,channelInterpretation:v.channelInterpretation,gain:1});c.connect=t.bind(null,i),c.disconnect=l.bind(null,i),M=[n,i,c]}else _||(S=new d(x,g));if(y.set(x,null===M?S:M[2]),null!==M){if(null===w){if(void 0===b)throw new Error("Missing the processor constructor.");if(null===f)throw new Error("Missing the native OfflineAudioContext constructor.");const e=s.channelCount*s.numberOfInputs,t=void 0===b.parameterDescriptors?0:b.parameterDescriptors.length,n=e+t,l=async()=>{const l=new f(n,128*Math.ceil(s.context.length/128),x.sampleRate),c=[],u=[];for(let e=0;e<v.numberOfInputs;e+=1)c.push(a(l,{channelCount:v.channelCount,channelCountMode:v.channelCountMode,channelInterpretation:v.channelInterpretation,gain:1})),u.push(o(l,{channelCount:v.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:v.channelCount}));const d=await Promise.all(Array.from(s.parameters.values()).map((async e=>{const t=i(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:e.value});return await h(l,e,t.offset),t}))),g=r(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,e+t)});for(let e=0;e<v.numberOfInputs;e+=1){c[e].connect(u[e]);for(let t=0;t<v.channelCount;t+=1)u[e].connect(g,t,e*v.channelCount+t)}for(const[t,n]of d.entries())n.connect(g,0,e+t),n.start(0);return g.connect(l.destination),await Promise.all(c.map((e=>p(s,l,e)))),m(l)};w=Ss(s,0===n?null:await l(),x,v,E,b,c)}const e=await w,t=n(x,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[l,u,d]=M;null!==e&&(t.buffer=e,t.start(0)),t.connect(l);for(let e=0,t=0;e<s.numberOfOutputs;e+=1){const n=u[e];for(let r=0;r<E[e];r+=1)l.connect(n,t+r,r);t+=E[e]}return d}if(_)for(const[t,n]of s.parameters.entries())await e(x,n,S.parameters.get(t));else for(const[e,t]of s.parameters.entries())await h(x,t,S.parameters.get(e));return await p(s,x,S),S})(x,S)}}})(Ac,Od,kc,Qc,nl,ru,il,Rd,Pd,Ku,is,sc,Xl,Ic,Gl,bu),Ud=(Hd=$u,e=>Hd.get(e));var Hd;const Gd=(e=>(t,n)=>{e.set(t,n)})(Nd),Wd=(qu&&((e,t,n,r,o,i,a,s,l,c,u,d,f,h)=>{})(Td,lc,Rc,zd,Fd,Ha,Ud,$l,Ql,sc,(e=>({...e,outputChannelCount:void 0!==e.outputChannelCount?e.outputChannelCount:1===e.numberOfInputs&&1===e.numberOfOutputs?[e.channelCount]:Array.from({length:e.numberOfOutputs},(()=>1))})),Gd,(e=>{const{port1:t,port2:n}=new MessageChannel;try{t.postMessage(e)}finally{t.close(),n.close()}}),El),((e,t,n,r,o)=>{})(Ns,cl,ml,Eu,nc),((e,t)=>(n,r,o)=>{if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(n,r,o)}catch(t){if("SyntaxError"===t.name)throw e();throw t}})(cl,Xl)),Vd=((e,t,n,r,o,i,a,s)=>(l,c)=>n(l).render(l,c).then((()=>Promise.all(Array.from(r(c)).map((e=>n(e).render(e,c)))))).then((()=>o(c))).then((n=>("function"!=typeof n.copyFromChannel?(a(n),Ia(n)):t(i,(()=>i(n)))||s(n),e.add(n),n))))(dc,Nl,Ul,Cd,bu,ka,mc,gc);qd=oa,Kd=ic;var qd,Kd;$d=aa,Jd=ac;var $d,Jd;var Xd=a("4IUwl");u=a("85Hg2");var Qd={error:console.error,info:console.info,success:console.log};u=a("85Hg2"),u=a("85Hg2"),Xd=a("4IUwl"),u=a("85Hg2"),Xd=a("4IUwl");var Yd=({className:e,title:t,loading:n=!0})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:r(Xd)(e,{"memori-loading-icon":n}),"aria-label":t},r(u).createElement("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}));var Zd=({primary:e=!1,outlined:t=!1,ghost:n=!1,padded:o=!0,shape:i="rounded",danger:a=!1,loading:s=!1,disabled:l=!1,block:c=!1,icon:d,className:f,title:h,id:p,htmlType:m,onClick:g,onTouchEnd:v,children:b})=>r(u).createElement("button",{id:p,type:m,onClick:g,onTouchEnd:v,title:h,disabled:s||l,className:r(Xd)("memori-button",{"memori-button--primary":e,"memori-button--outlined":t,"memori-button--ghost":n,"memori-button--square":"square"===i,"memori-button--rounded":"rounded"===i,"memori-button--circle":"circle"===i,"memori-button--padded":o,"memori-button--block":c,"memori-button--with-icon":(d||s)&&b,"memori-button--icon-only":(d||s)&&!b,"memori-button--danger":a,"memori-button--loading":s},f)},d&&!s&&r(u).createElement("span",{className:"memori-button--icon"},d),s&&r(u).createElement("span",{className:"memori-button--icon loading-icon"},r(u).createElement(Yd,{loading:!0})),b);u=a("85Hg2"),u=a("85Hg2");function ef(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ef),r}u=a("85Hg2");var tf,nf,rf=((nf=rf||{})[nf.None=0]="None",nf[nf.RenderStrategy=1]="RenderStrategy",nf[nf.Static=2]="Static",nf),of=((tf=of||{})[tf.Unmount=0]="Unmount",tf[tf.Hidden=1]="Hidden",tf);function af({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:a}){let s=lf(t,e);if(i)return sf(s,n,r,a);let l=null!=o?o:0;if(2&l){let{static:e=!1,...t}=s;if(e)return sf(t,n,r,a)}if(1&l){let{unmount:e=!0,...t}=s;return ef(e?0:1,{0:()=>null,1:()=>sf({...t,hidden:!0,style:{display:"none"}},n,r,a)})}return sf(s,n,r,a)}function sf(e,t={},n,r){let{as:o=n,children:i,refName:a="ref",...s}=df(e,["unmount","static"]),l=void 0!==e.ref?{[a]:e.ref}:{},c="function"==typeof i?i(t):i;s.className&&"function"==typeof s.className&&(s.className=s.className(t));let d={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r);e&&(d["data-headlessui-state"]=n.join(" "))}if(o===u.Fragment&&Object.keys(uf(s)).length>0){if(!(0,u.isValidElement)(c)||Array.isArray(c)&&c.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"));return(0,u.cloneElement)(c,Object.assign({},lf(c.props,uf(df(s,["ref"]))),d,l,function(...e){return{ref:e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(c.ref,l.ref)))}return(0,u.createElement)(o,Object.assign({},df(s,["ref"]),o!==u.Fragment&&l,o!==u.Fragment&&d),c)}function lf(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map((e=>[e,void 0]))));for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function cf(e){var t;return Object.assign((0,u.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function uf(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function df(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}u=a("85Hg2"),u=a("85Hg2"),u=a("85Hg2"),u=a("85Hg2");const ff="undefined"==typeof window||"undefined"==typeof document;let hf=ff?u.useEffect:u.useLayoutEffect;function pf(e){let t=(0,u.useRef)(e);return hf((()=>{t.current=e}),[e]),t}let mf=function(e){let t=pf(e);return r(u).useCallback(((...e)=>t.current(...e)),[t])},gf=Symbol();function vf(e,t=!0){return Object.assign(e,{[gf]:t})}function bf(...e){let t=(0,u.useRef)(e);(0,u.useEffect)((()=>{t.current=e}),[e]);let n=mf((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[gf])))?void 0:n}var yf,wf=((yf=wf||{}).Space=" ",yf.Enter="Enter",yf.Escape="Escape",yf.Backspace="Backspace",yf.Delete="Delete",yf.ArrowLeft="ArrowLeft",yf.ArrowUp="ArrowUp",yf.ArrowRight="ArrowRight",yf.ArrowDown="ArrowDown",yf.Home="Home",yf.End="End",yf.PageUp="PageUp",yf.PageDown="PageDown",yf.Tab="Tab",yf);function xf(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}u=a("85Hg2"),u=a("85Hg2");let Sf={serverHandoffComplete:!1};function Mf(){let[e,t]=(0,u.useState)(Sf.serverHandoffComplete);return(0,u.useEffect)((()=>{!0!==e&&t(!0)}),[e]),(0,u.useEffect)((()=>{!1===Sf.serverHandoffComplete&&(Sf.serverHandoffComplete=!0)}),[]),e}var _f;let Ef=0;function Af(){return++Ef}let Cf=null!=(_f=r(u).useId)?_f:function(){let e=Mf(),[t,n]=r(u).useState(e?Af:null);return hf((()=>{null===t&&n(Af())}),[t]),null!=t?""+t:void 0};u=a("85Hg2");var kf=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(kf||{});let Tf=cf((function(e,t){let{features:n=1,...r}=e;return af({ourProps:{ref:t,"aria-hidden":2==(2&n)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&n)&&2!=(2&n)&&{display:"none"}}},theirProps:r,slot:{},defaultTag:"div",name:"Hidden"})}));function If(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}function Of(){let e=[],t=[],n={enqueue(e){t.push(e)},addEventListener:(e,t,r,o)=>(e.addEventListener(t,r,o),n.add((()=>e.removeEventListener(t,r,o)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return n.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>n.requestAnimationFrame((()=>n.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return n.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return If((()=>{t.current&&e[0]()})),n.add((()=>{t.current=!1}))},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0){let[t]=e.splice(n,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return n}function Rf(e){return ff?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Pf=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var Nf,Lf,Bf=((Lf=Bf||{})[Lf.First=1]="First",Lf[Lf.Previous=2]="Previous",Lf[Lf.Next=4]="Next",Lf[Lf.Last=8]="Last",Lf[Lf.WrapAround=16]="WrapAround",Lf[Lf.NoScroll=32]="NoScroll",Lf),Df=((Nf=Df||{})[Nf.Error=0]="Error",Nf[Nf.Overflow=1]="Overflow",Nf[Nf.Success=2]="Success",Nf[Nf.Underflow=3]="Underflow",Nf),jf=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(jf||{});function Ff(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(Pf))}var zf=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(zf||{});function Uf(e,t=0){var n;return e!==(null==(n=Rf(e))?void 0:n.body)&&ef(t,{0:()=>e.matches(Pf),1(){let t=e;for(;null!==t;){if(t.matches(Pf))return!0;t=t.parentElement}return!1}})}function Hf(e){let t=Rf(e);Of().nextFrame((()=>{t&&!Uf(t.activeElement,0)&&Gf(e)}))}function Gf(e){null==e||e.focus({preventScroll:!0})}let Wf=["textarea","input"].join(",");function Vf(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function qf(e,t){return Kf(Ff(),t,!0,e)}function Kf(e,t,n=!0,r=null){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?n?Vf(e):e:Ff(e);r=null!=r?r:o.activeElement;let a,s=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,i.indexOf(r))-1;if(4&t)return Math.max(0,i.indexOf(r))+1;if(8&t)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&t?{preventScroll:!0}:{},u=0,d=i.length;do{if(u>=d||u+d<=0)return 0;let e=l+u;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}a=i[e],null==a||a.focus(c),u+=s}while(a!==o.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,Wf))&&n}(a)&&a.select(),a.hasAttribute("tabindex")||a.setAttribute("tabindex","0"),2}u=a("85Hg2"),u=a("85Hg2");function $f(e,t,n){let r=pf(t);(0,u.useEffect)((()=>{function t(e){r.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)}),[e,n])}var Jf=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Jf||{});function Xf(){let e=(0,u.useRef)(0);return $f("keydown",(t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)}),!0),e}u=a("85Hg2");function Qf(){let e=(0,u.useRef)(!1);return hf((()=>(e.current=!0,()=>{e.current=!1})),[]),e}u=a("85Hg2");function Yf(...e){return(0,u.useMemo)((()=>Rf(...e)),[...e])}u=a("85Hg2");function Zf(e,t,n,r){let o=pf(n);(0,u.useEffect)((()=>{function n(e){o.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}),[e,t,r])}u=a("85Hg2");function eh(e,t){let n=(0,u.useRef)([]),r=mf(e);(0,u.useEffect)((()=>{let e=[...n.current];for(let[o,i]of t.entries())if(n.current[o]!==i){let o=r(t,e);return n.current=t,o}}),[r,...t])}var th=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(th||{});let nh=Object.assign(cf((function(e,t){let n=(0,u.useRef)(null),o=bf(n,t),{initialFocus:i,containers:a,features:s=30,...l}=e;Mf()||(s=1);let c=Yf(n);!function({ownerDocument:e},t){let n=(0,u.useRef)(null);Zf(null==e?void 0:e.defaultView,"focusout",(e=>{!t||n.current||(n.current=e.target)}),!0),eh((()=>{t||((null==e?void 0:e.activeElement)===(null==e?void 0:e.body)&&Gf(n.current),n.current=null)}),[t]);let r=(0,u.useRef)(!1);(0,u.useEffect)((()=>(r.current=!1,()=>{r.current=!0,If((()=>{!r.current||(Gf(n.current),n.current=null)}))})),[])}({ownerDocument:c},Boolean(16&s));let d=function({ownerDocument:e,container:t,initialFocus:n},r){let o=(0,u.useRef)(null),i=Qf();return eh((()=>{if(!r)return;let a=t.current;!a||If((()=>{if(!i.current)return;let t=null==e?void 0:e.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===t)return void(o.current=t)}else if(a.contains(t))return void(o.current=t);null!=n&&n.current?Gf(n.current):Kf(a,Bf.First)===Df.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),o.current=null==e?void 0:e.activeElement}))}),[r]),o}({ownerDocument:c,container:n,initialFocus:i},Boolean(2&s));!function({ownerDocument:e,container:t,containers:n,previousActiveElement:r},o){let i=Qf();Zf(null==e?void 0:e.defaultView,"focus",(e=>{if(!o||!i.current)return;let a=new Set(null==n?void 0:n.current);a.add(t);let s=r.current;if(!s)return;let l=e.target;l&&l instanceof HTMLElement?function(e,t){var n;for(let r of e)if(null!=(n=r.current)&&n.contains(t))return!0;return!1}(a,l)?(r.current=l,Gf(l)):(e.preventDefault(),e.stopPropagation(),Gf(s)):Gf(r.current)}),!0)}({ownerDocument:c,container:n,containers:a,previousActiveElement:d},Boolean(8&s));let f=Xf(),h=mf((()=>{let e=n.current;!e||ef(f.current,{[Jf.Forwards]:()=>Kf(e,Bf.First),[Jf.Backwards]:()=>Kf(e,Bf.Last)})})),p={ref:o};return r(u).createElement(r(u).Fragment,null,Boolean(4&s)&&r(u).createElement(Tf,{as:"button",type:"button",onFocus:h,features:kf.Focusable}),af({ourProps:p,theirProps:l,defaultTag:"div",name:"FocusTrap"}),Boolean(4&s)&&r(u).createElement(Tf,{as:"button",type:"button",onFocus:h,features:kf.Focusable}))})),{features:th});let rh=new Set,oh=new Map;function ih(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function ah(e){let t=oh.get(e);!t||(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function sh(e,t=!0){hf((()=>{if(!t||!e.current)return;let n=e.current,r=Rf(n);if(r){rh.add(n);for(let e of oh.keys())e.contains(n)&&(ah(e),oh.delete(e));return r.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement){for(let t of rh)if(e.contains(t))return;1===rh.size&&(oh.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),ih(e))}})),()=>{if(rh.delete(n),rh.size>0)r.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement&&!oh.has(e)){for(let t of rh)if(e.contains(t))return;oh.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),ih(e)}}));else for(let e of oh.keys())ah(e),oh.delete(e)}}}),[t])}u=a("85Hg2"),c=a("2BCLI");let lh=(0,(u=a("85Hg2")).createContext)(!1);function ch(e){return r(u).createElement(lh.Provider,{value:e.force},e.children)}function uh(e){let t=(0,u.useContext)(lh),n=(0,u.useContext)(ph),r=Yf(e),[o,i]=(0,u.useState)((()=>{if(!t&&null!==n||ff)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)}));return(0,u.useEffect)((()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))}),[o,r]),(0,u.useEffect)((()=>{t||null!==n&&i(n.current)}),[n,i,t]),o}let dh=u.Fragment,fh=cf((function(e,t){let n=e,r=(0,u.useRef)(null),o=bf(vf((e=>{r.current=e})),t),i=Yf(r),a=uh(r),[s]=(0,u.useState)((()=>{var e;return ff?null:null!=(e=null==i?void 0:i.createElement("div"))?e:null})),l=Mf(),d=(0,u.useRef)(!1);return hf((()=>{if(d.current=!1,a&&s)return a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s)),()=>{d.current=!0,If((()=>{var e;!d.current||!a||!s||(a.removeChild(s),a.childNodes.length<=0&&(null==(e=a.parentElement)||e.removeChild(a)))}))}}),[a,s]),l&&a&&s?(0,c.createPortal)(af({ourProps:{ref:o},theirProps:n,defaultTag:dh,name:"Portal"}),s):null})),hh=u.Fragment,ph=(0,u.createContext)(null),mh=cf((function(e,t){let{target:n,...o}=e,i={ref:bf(t)};return r(u).createElement(ph.Provider,{value:n},af({ourProps:i,theirProps:o,defaultTag:hh,name:"Popover.Group"}))})),gh=Object.assign(fh,{Group:mh});let vh=(0,(u=a("85Hg2")).createContext)(null);function bh(){let e=(0,u.useContext)(vh);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,bh),e}return e}function yh(){let[e,t]=(0,u.useState)([]);return[e.length>0?e.join(" "):void 0,(0,u.useMemo)((()=>function(e){let n=mf((e=>(t((t=>[...t,e])),()=>t((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),o=(0,u.useMemo)((()=>({register:n,slot:e.slot,name:e.name,props:e.props})),[n,e.slot,e.name,e.props]);return r(u).createElement(vh.Provider,{value:o},e.children)}),[t])]}let wh=cf((function(e,t){let n=bh(),r=`headlessui-description-${Cf()}`,o=bf(t);hf((()=>n.register(r)),[r,n.register]);let i=e;return af({ourProps:{ref:o,...n.props,id:r},theirProps:i,slot:n.slot||{},defaultTag:"p",name:n.name||"Description"})}));let xh=(0,(u=a("85Hg2")).createContext)(null);xh.displayName="OpenClosedContext";var Sh=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Sh||{});function Mh(){return(0,u.useContext)(xh)}function _h({value:e,children:t}){return r(u).createElement(xh.Provider,{value:e},t)}let Eh=(0,(u=a("85Hg2")).createContext)((()=>{}));Eh.displayName="StackContext";var Ah=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Ah||{});function Ch({children:e,onUpdate:t,type:n,element:o,enabled:i}){let a=(0,u.useContext)(Eh),s=mf(((...e)=>{null==t||t(...e),a(...e)}));return hf((()=>{let e=void 0===i||!0===i;return e&&s(0,n,o),()=>{e&&s(1,n,o)}}),[s,n,o,i]),r(u).createElement(Eh.Provider,{value:s},e)}u=a("85Hg2"),u=a("85Hg2");function kh(e,t,n){let r=pf(t);(0,u.useEffect)((()=>{function t(e){r.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}function Th(e,t,n=!0){let r=(0,u.useRef)(!1);function o(n,o){if(!r.current||n.defaultPrevented)return;let i=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e),a=o(n);if(null!==a&&a.getRootNode().contains(a)){for(let e of i){if(null===e)continue;let t=e instanceof HTMLElement?e:e.current;if(null!=t&&t.contains(a))return}return!Uf(a,zf.Loose)&&-1!==a.tabIndex&&n.preventDefault(),t(n,a)}}(0,u.useEffect)((()=>{requestAnimationFrame((()=>{r.current=n}))}),[n]);let i=(0,u.useRef)(null);kh("mousedown",(e=>{var t,n;r.current&&(i.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)}),!0),kh("click",(e=>{!i.current||(o(e,(()=>i.current)),i.current=null)}),!0),kh("blur",(e=>o(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}var Ih=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ih||{}),Oh=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Oh||{});let Rh={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},Ph=(0,u.createContext)(null);function Nh(e){let t=(0,u.useContext)(Ph);if(null===t){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Nh),t}return t}function Lh(e,t){(0,u.useEffect)((()=>{var n;if(!t||!e)return;let r=Of();function o(e,t,n){let o=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),r.add((()=>{Object.assign(e.style,{[t]:o})}))}let i=e.documentElement,a=(null!=(n=e.defaultView)?n:window).innerWidth-i.clientWidth;if(o(i,"overflow","hidden"),a>0){o(i,"paddingRight",`${a-(i.clientWidth-i.offsetWidth)}px`)}if(/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0){let e=window.pageYOffset;o(i,"position","fixed"),o(i,"marginTop",`-${e}px`),o(i,"width","100%"),r.add((()=>window.scrollTo(0,e)))}return r.dispose}),[e,t])}function Bh(e,t){return ef(t.type,Rh,e,t)}Ph.displayName="DialogContext";let Dh=rf.RenderStrategy|rf.Static,jh=cf((function(e,t){let{open:n,onClose:o,initialFocus:i,__demoMode:a=!1,...s}=e,[l,c]=(0,u.useState)(0),d=Mh();void 0===n&&null!==d&&(n=ef(d,{[Sh.Open]:!0,[Sh.Closed]:!1}));let f=(0,u.useRef)(new Set),h=(0,u.useRef)(null),p=bf(h,t),m=(0,u.useRef)(null),g=Yf(h),v=e.hasOwnProperty("open")||null!==d,b=e.hasOwnProperty("onClose");if(!v&&!b)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!b)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof n)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n}`);if("function"!=typeof o)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let y=n?0:1,[w,x]=(0,u.useReducer)(Bh,{titleId:null,descriptionId:null,panelRef:(0,u.createRef)()}),S=mf((()=>o(!1))),M=mf((e=>x({type:0,id:e}))),_=!!Mf()&&(!a&&0===y),E=l>1,A=null!==(0,u.useContext)(Ph),C=E?"parent":"leaf";sh(h,!!E&&_),Th((()=>{var e,t;return[...Array.from(null!=(e=null==g?void 0:g.querySelectorAll("body > *, [data-headlessui-portal]"))?e:[]).filter((e=>!(!(e instanceof HTMLElement)||e.contains(m.current)||w.panelRef.current&&e.contains(w.panelRef.current)))),null!=(t=w.panelRef.current)?t:h.current]}),S,_&&!E),Zf(null==g?void 0:g.defaultView,"keydown",(e=>{e.defaultPrevented||e.key===wf.Escape&&0===y&&(E||(e.preventDefault(),e.stopPropagation(),S()))})),Lh(g,0===y&&!A),(0,u.useEffect)((()=>{if(0!==y||!h.current)return;let e=new IntersectionObserver((e=>{for(let t of e)0===t.boundingClientRect.x&&0===t.boundingClientRect.y&&0===t.boundingClientRect.width&&0===t.boundingClientRect.height&&S()}));return e.observe(h.current),()=>e.disconnect()}),[y,h,S]);let[k,T]=yh(),I=`headlessui-dialog-${Cf()}`,O=(0,u.useMemo)((()=>[{dialogState:y,close:S,setTitleId:M},w]),[y,w,S,M]),R=(0,u.useMemo)((()=>({open:0===y})),[y]),P={ref:p,id:I,role:"dialog","aria-modal":0===y||void 0,"aria-labelledby":w.titleId,"aria-describedby":k};return r(u).createElement(Ch,{type:"Dialog",enabled:0===y,element:h,onUpdate:mf(((e,t,n)=>{"Dialog"===t&&ef(e,{[Ah.Add](){f.current.add(n),c((e=>e+1))},[Ah.Remove](){f.current.add(n),c((e=>e-1))}})}))},r(u).createElement(ch,{force:!0},r(u).createElement(gh,null,r(u).createElement(Ph.Provider,{value:O},r(u).createElement(gh.Group,{target:h},r(u).createElement(ch,{force:!1},r(u).createElement(T,{slot:R,name:"Dialog.Description"},r(u).createElement(nh,{initialFocus:i,containers:f,features:_?ef(C,{parent:nh.features.RestoreFocus,leaf:nh.features.All&~nh.features.FocusLock}):nh.features.None},af({ourProps:P,theirProps:s,slot:R,defaultTag:"div",features:Dh,visible:0===y,name:"Dialog"})))))))),r(u).createElement(Tf,{features:kf.Hidden,ref:m}))})),Fh=cf((function(e,t){let[{dialogState:n,close:r}]=Nh("Dialog.Overlay");return af({ourProps:{ref:bf(t),id:`headlessui-dialog-overlay-${Cf()}`,"aria-hidden":!0,onClick:mf((e=>{if(e.target===e.currentTarget){if(xf(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),r()}}))},theirProps:e,slot:(0,u.useMemo)((()=>({open:0===n})),[n]),defaultTag:"div",name:"Dialog.Overlay"})})),zh=cf((function(e,t){let[{dialogState:n},o]=Nh("Dialog.Backdrop"),i=bf(t),a=`headlessui-dialog-backdrop-${Cf()}`;(0,u.useEffect)((()=>{if(null===o.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")}),[o.panelRef]);let s=(0,u.useMemo)((()=>({open:0===n})),[n]);return r(u).createElement(ch,{force:!0},r(u).createElement(gh,null,af({ourProps:{ref:i,id:a,"aria-hidden":!0},theirProps:e,slot:s,defaultTag:"div",name:"Dialog.Backdrop"})))})),Uh=cf((function(e,t){let[{dialogState:n},r]=Nh("Dialog.Panel"),o=bf(t,r.panelRef),i=`headlessui-dialog-panel-${Cf()}`,a=(0,u.useMemo)((()=>({open:0===n})),[n]);return af({ourProps:{ref:o,id:i,onClick:mf((e=>{e.stopPropagation()}))},theirProps:e,slot:a,defaultTag:"div",name:"Dialog.Panel"})})),Hh=cf((function(e,t){let[{dialogState:n,setTitleId:r}]=Nh("Dialog.Title"),o=`headlessui-dialog-title-${Cf()}`,i=bf(t);(0,u.useEffect)((()=>(r(o),()=>r(null))),[o,r]);let a=(0,u.useMemo)((()=>({open:0===n})),[n]);return af({ourProps:{ref:i,id:o},theirProps:e,slot:a,defaultTag:"h2",name:"Dialog.Title"})})),Gh=Object.assign(jh,{Backdrop:zh,Panel:Uh,Overlay:Fh,Title:Hh,Description:wh});u=a("85Hg2");function Wh(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Vh(e,...t){e&&t.length>0&&e.classList.add(...t)}function qh(e,...t){e&&t.length>0&&e.classList.remove(...t)}var Kh=(e=>(e.Ended="ended",e.Cancelled="cancelled",e))(Kh||{});function $h(e,t,n,r){let o=n?"enter":"leave",i=Of(),a=void 0!==r?Wh(r):()=>{};"enter"===o&&(e.removeAttribute("hidden"),e.style.display="");let s=ef(o,{enter:()=>t.enter,leave:()=>t.leave}),l=ef(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=ef(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return qh(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Vh(e,...s,...c),i.nextFrame((()=>{qh(e,...c),Vh(e,...l),function(e,t){let n=Of();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,a]=[r,o].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t}));if(i+a!==0){let r=[];r.push(n.addEventListener(e,"transitionrun",(o=>{o.target===o.currentTarget&&(r.splice(0).forEach((e=>e())),r.push(n.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(t("ended"),r.splice(0).forEach((e=>e())))})),n.addEventListener(e,"transitioncancel",(e=>{e.target===e.currentTarget&&(t("cancelled"),r.splice(0).forEach((e=>e())))}))))})))}else t("ended");n.add((()=>t("cancelled"))),n.dispose}(e,(n=>("ended"===n&&(qh(e,...s),Vh(e,...t.entered)),a(n))))})),i.dispose}function Jh(){let[e]=(0,u.useState)(Of);return(0,u.useEffect)((()=>()=>e.dispose()),[e]),e}function Xh({container:e,direction:t,classes:n,onStart:r,onStop:o}){let i=Qf(),a=Jh(),s=pf(t);hf((()=>{let t=Of();a.add(t.dispose);let l=e.current;if(l&&"idle"!==s.current&&i.current)return t.dispose(),r.current(s.current),t.add($h(l,n.current,"enter"===s.current,(e=>{t.dispose(),ef(e,{[Kh.Ended](){o.current(s.current)},[Kh.Cancelled]:()=>{}})}))),t.dispose}),[t])}function Qh(e=""){return e.split(" ").filter((e=>e.trim().length>1))}let Yh=(0,(u=a("85Hg2")).createContext)(null);Yh.displayName="TransitionContext";var Zh,ep=((Zh=ep||{}).Visible="visible",Zh.Hidden="hidden",Zh);let tp=(0,u.createContext)(null);function np(e){return"children"in e?np(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function rp(e,t){let n=pf(e),r=(0,u.useRef)([]),o=Qf(),i=Jh(),a=mf(((e,t=of.Hidden)=>{let a=r.current.findIndex((({el:t})=>t===e));-1!==a&&(ef(t,{[of.Unmount](){r.current.splice(a,1)},[of.Hidden](){r.current[a].state="hidden"}}),i.microTask((()=>{var e;!np(r)&&o.current&&(null==(e=n.current)||e.call(n))})))})),s=mf((e=>{let t=r.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>a(e,of.Unmount)})),l=(0,u.useRef)([]),c=(0,u.useRef)(Promise.resolve()),d=(0,u.useRef)({enter:[],leave:[],idle:[]}),f=mf(((e,n,r)=>{l.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter((([t])=>t!==e))),null==t||t.chains.current[n].push([e,new Promise((e=>{l.current.push(e)}))]),null==t||t.chains.current[n].push([e,new Promise((e=>{Promise.all(d.current[n].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===n?c.current=c.current.then((()=>null==t?void 0:t.wait.current)).then((()=>r(n))):r(n)})),h=mf(((e,t,n)=>{Promise.all(d.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=l.current.shift())||e()})).then((()=>n(t)))}));return(0,u.useMemo)((()=>({children:r,register:s,unregister:a,onStart:f,onStop:h,wait:c,chains:d})),[s,a,r,f,h,d,c])}function op(){}tp.displayName="NestingContext";let ip=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function ap(e){var t;let n={};for(let r of ip)n[r]=null!=(t=e[r])?t:op;return n}let sp=rf.RenderStrategy,lp=cf((function(e,t){let{beforeEnter:n,afterEnter:o,beforeLeave:i,afterLeave:a,enter:s,enterFrom:l,enterTo:c,entered:d,leave:f,leaveFrom:h,leaveTo:p,...m}=e,g=(0,u.useRef)(null),v=bf(g,t),b=m.unmount?of.Unmount:of.Hidden,{show:y,appear:w,initial:x}=function(){let e=(0,u.useContext)(Yh);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[S,M]=(0,u.useState)(y?"visible":"hidden"),_=function(){let e=(0,u.useContext)(tp);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:E,unregister:A}=_,C=(0,u.useRef)(null);(0,u.useEffect)((()=>E(g)),[E,g]),(0,u.useEffect)((()=>{if(b===of.Hidden&&g.current)return y&&"visible"!==S?void M("visible"):ef(S,{hidden:()=>A(g),visible:()=>E(g)})}),[S,g,E,A,y,b]);let k=pf({enter:Qh(s),enterFrom:Qh(l),enterTo:Qh(c),entered:Qh(d),leave:Qh(f),leaveFrom:Qh(h),leaveTo:Qh(p)}),T=function(e){let t=(0,u.useRef)(ap(e));return(0,u.useEffect)((()=>{t.current=ap(e)}),[e]),t}({beforeEnter:n,afterEnter:o,beforeLeave:i,afterLeave:a}),I=Mf();(0,u.useEffect)((()=>{if(I&&"visible"===S&&null===g.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[g,S,I]);let O=x&&!w,R=!I||O||C.current===y?"idle":y?"enter":"leave",P=mf((e=>ef(e,{enter:()=>T.current.beforeEnter(),leave:()=>T.current.beforeLeave(),idle:()=>{}}))),N=mf((e=>ef(e,{enter:()=>T.current.afterEnter(),leave:()=>T.current.afterLeave(),idle:()=>{}}))),L=rp((()=>{M("hidden"),A(g)}),_);Xh({container:g,classes:k,direction:R,onStart:pf((e=>{L.onStart(g,e,P)})),onStop:pf((e=>{L.onStop(g,e,N),"leave"===e&&!np(L)&&(M("hidden"),A(g))}))}),(0,u.useEffect)((()=>{!O||(b===of.Hidden?C.current=null:C.current=y)}),[y,O,S]);let B=m,D={ref:v};return r(u).createElement(tp.Provider,{value:L},r(u).createElement(_h,{value:ef(S,{visible:Sh.Open,hidden:Sh.Closed})},af({ourProps:D,theirProps:B,defaultTag:"div",features:sp,visible:"visible"===S,name:"Transition.Child"})))})),cp=cf((function(e,t){let{show:n,appear:o=!1,unmount:i,...a}=e,s=(0,u.useRef)(null),l=bf(s,t);Mf();let c=Mh();if(void 0===n&&null!==c&&(n=ef(c,{[Sh.Open]:!0,[Sh.Closed]:!1})),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,f]=(0,u.useState)(n?"visible":"hidden"),h=rp((()=>{f("hidden")})),[p,m]=(0,u.useState)(!0),g=(0,u.useRef)([n]);hf((()=>{!1!==p&&g.current[g.current.length-1]!==n&&(g.current.push(n),m(!1))}),[g,n]);let v=(0,u.useMemo)((()=>({show:n,appear:o,initial:p})),[n,o,p]);(0,u.useEffect)((()=>{if(n)f("visible");else if(np(h)){let e=s.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&f("hidden")}else f("hidden")}),[n,h]);let b={unmount:i};return r(u).createElement(tp.Provider,{value:h},r(u).createElement(Yh.Provider,{value:v},af({ourProps:{...b,as:u.Fragment,children:r(u).createElement(lp,{ref:l,...b,...a})},theirProps:{},defaultTag:u.Fragment,features:sp,visible:"visible"===d,name:"Transition"})))})),up=cf((function(e,t){let n=null!==(0,u.useContext)(Yh),o=null!==Mh();return r(u).createElement(r(u).Fragment,null,!n&&o?r(u).createElement(cp,{ref:t,...e}):r(u).createElement(lp,{ref:t,...e}))})),dp=Object.assign(cp,{Child:up,Root:cp});u=a("85Hg2"),Xd=a("4IUwl");var fp=({spinning:e=!1,primary:t=!1,className:n,children:o})=>r(u).createElement("div",{className:r(Xd)("memori-spin",n,{"memori-spin--spinning":e,"memori-spin--primary":t})},o,r(u).createElement("div",{className:"memori-spin--spinner"},r(u).createElement(Yd,{loading:!0})));u=a("85Hg2");var hp=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}));Xd=a("4IUwl");var pp=({open:e=!1,onClose:t,className:n,title:o,description:i,children:a,footer:s,loading:l=!1,closable:c=!0,width:d="100%",widthMd:f="100%"})=>{const{t:h}=ea();return r(u).createElement(dp,{appear:!0,show:e,as:r(u).Fragment},r(u).createElement(Gh,{open:e,onClose:t,className:r(Xd)("memori-modal",n)},r(u).createElement(dp.Child,{as:r(u).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},r(u).createElement("div",{className:"memori-modal--backdrop"})),r(u).createElement("div",{className:"memori-modal--container"},r(u).createElement("div",{className:"memori-modal--container-scrollable"},r(u).createElement(dp.Child,{as:r(u).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95"},r(u).createElement(Gh.Panel,{className:"memori-modal--panel"},r(u).createElement("style",{dangerouslySetInnerHTML:{__html:`\n .memori-modal--panel {\n --memori-modal--width: ${d};\n --memori-modal--width-md: ${f};\n }\n `}}),c&&r(u).createElement("div",{className:"memori-modal--close"},r(u).createElement(Zd,{ghost:!0,padded:!0,shape:"circle",icon:r(u).createElement(hp,null),title:h("close")||"Close",onClick:()=>t(!1)})),r(u).createElement(fp,{spinning:l},o&&r(u).createElement(Gh.Title,{className:"memori-modal--title"},o),i&&r(u).createElement(Gh.Description,{className:"memori-modal--description"},i),a,s&&r(u).createElement("div",{className:"memori-modal--footer"},s))))))))},mp=(u=a("85Hg2"),e=>"checkbox"===e.type),gp=e=>e instanceof Date,vp=e=>null==e;const bp=e=>"object"==typeof e;var yp=e=>!vp(e)&&!Array.isArray(e)&&bp(e)&&!gp(e),wp=e=>yp(e)&&e.target?mp(e.target)?e.target.checked:e.target.value:e,xp=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Sp=e=>Array.isArray(e)?e.filter(Boolean):[],Mp=e=>void 0===e,_p=(e,t,n)=>{if(!t||!yp(e))return n;const r=Sp(t.split(/[,[\].]+?/)).reduce(((e,t)=>vp(e)?e:e[t]),e);return Mp(r)||r===e?Mp(e[t])?n:e[t]:r};const Ep="blur",Ap="focusout",Cp="onBlur",kp="onChange",Tp="onSubmit",Ip="onTouched",Op="all",Rp="max",Pp="min",Np="maxLength",Lp="minLength",Bp="pattern",Dp="required",jp="validate";r(u).createContext(null);var Fp=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const o=i;return t._proxyFormState[o]!==Op&&(t._proxyFormState[o]=!r||Op),n&&(n[o]=!0),e[o]}});return o},zp=e=>yp(e)&&!Object.keys(e).length,Up=(e,t,n)=>{const{name:r,...o}=e;return zp(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find((e=>t[e]===(!n||Op)))},Hp=e=>Array.isArray(e)?e:[e];function Gp(e){const t=r(u).useRef(e);t.current=e,r(u).useEffect((()=>{const n=!e.disabled&&t.current.subject.subscribe({next:t.current.callback});return()=>{n&&n.unsubscribe()}}),[e.disabled])}var Wp=e=>"string"==typeof e,Vp=(e,t,n,r)=>Wp(e)?(r&&t.watch.add(e),_p(n,e)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),_p(n,e)))):(t.watchAll=!!r,n),qp="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Kp(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(qp&&(e instanceof Blob||e instanceof FileList)||!n&&!yp(e))return e;if(t=n?[]:{},Array.isArray(e)||(e=>{const t=e.constructor&&e.constructor.prototype;return yp(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)t[n]=Kp(e[n]);else t=e}return t}var $p=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Jp=e=>/^\w*$/.test(e),Xp=e=>Sp(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Qp(e,t,n){let r=-1;const o=Jp(t)?[t]:Xp(t),i=o.length,a=i-1;for(;++r<i;){const t=o[r];let i=n;if(r!==a){const n=e[t];i=yp(n)||Array.isArray(n)?n:isNaN(+o[r+1])?{}:[]}e[t]=i,e=e[t]}return e}const Yp=(e,t,n)=>{for(const r of n||Object.keys(e)){const n=_p(e,r);if(n){const{_f:e,...r}=n;if(e&&t(e.name)){if(e.ref.focus){e.ref.focus();break}if(e.refs&&e.refs[0].focus){e.refs[0].focus();break}}else yp(r)&&Yp(r,t)}}};var Zp=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))))),em=(e,t,n)=>{const r=Sp(_p(e,n));return Qp(r,"root",t[n]),Qp(e,n,r),e},tm=e=>"boolean"==typeof e,nm=e=>"file"===e.type,rm=e=>"function"==typeof e,om=e=>Wp(e)||r(u).isValidElement(e),im=e=>"radio"===e.type,am=e=>e instanceof RegExp;const sm={value:!1,isValid:!1},lm={value:!0,isValid:!0};var cm=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Mp(e[0].attributes.value)?Mp(e[0].value)||""===e[0].value?lm:{value:e[0].value,isValid:!0}:lm:sm}return sm};const um={isValid:!1,value:null};var dm=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),um):um;function fm(e,t,n="validate"){if(om(e)||Array.isArray(e)&&e.every(om)||tm(e)&&!e)return{type:n,message:om(e)?e:"",ref:t}}var hm=e=>yp(e)&&!am(e)?e:{value:e,message:""},pm=async(e,t,n,r,o)=>{const{ref:i,refs:a,required:s,maxLength:l,minLength:c,min:u,max:d,pattern:f,validate:h,name:p,valueAsNumber:m,mount:g,disabled:v}=e._f;if(!g||v)return{};const b=a?a[0]:i,y=e=>{r&&b.reportValidity&&(b.setCustomValidity(tm(e)?"":e||""),b.reportValidity())},w={},x=im(i),S=mp(i),M=x||S,_=(m||nm(i))&&!i.value||""===t||Array.isArray(t)&&!t.length,E=$p.bind(null,p,n,w),A=(e,t,n,r=Np,o=Lp)=>{const a=e?t:n;w[p]={type:e?r:o,message:a,ref:i,...E(e?r:o,a)}};if(o?!Array.isArray(t)||!t.length:s&&(!M&&(_||vp(t))||tm(t)&&!t||S&&!cm(a).isValid||x&&!dm(a).isValid)){const{value:e,message:t}=om(s)?{value:!!s,message:s}:hm(s);if(e&&(w[p]={type:Dp,message:t,ref:b,...E(Dp,t)},!n))return y(t),w}if(!(_||vp(u)&&vp(d))){let e,r;const o=hm(d),a=hm(u);if(vp(t)||isNaN(t)){const n=i.valueAsDate||new Date(t),s=e=>new Date((new Date).toDateString()+" "+e),l="time"==i.type,c="week"==i.type;Wp(o.value)&&t&&(e=l?s(t)>s(o.value):c?t>o.value:n>new Date(o.value)),Wp(a.value)&&t&&(r=l?s(t)<s(a.value):c?t<a.value:n<new Date(a.value))}else{const n=i.valueAsNumber||(t?+t:t);vp(o.value)||(e=n>o.value),vp(a.value)||(r=n<a.value)}if((e||r)&&(A(!!e,o.message,a.message,Rp,Pp),!n))return y(w[p].message),w}if((l||c)&&!_&&(Wp(t)||o&&Array.isArray(t))){const e=hm(l),r=hm(c),o=!vp(e.value)&&t.length>e.value,i=!vp(r.value)&&t.length<r.value;if((o||i)&&(A(o,e.message,r.message),!n))return y(w[p].message),w}if(f&&!_&&Wp(t)){const{value:e,message:r}=hm(f);if(am(e)&&!t.match(e)&&(w[p]={type:Bp,message:r,ref:i,...E(Bp,r)},!n))return y(r),w}if(h)if(rm(h)){const e=fm(await h(t),b);if(e&&(w[p]={...e,...E(jp,e.message)},!n))return y(e.message),w}else if(yp(h)){let e={};for(const r in h){if(!zp(e)&&!n)break;const o=fm(await h[r](t),b,r);o&&(e={...o,...E(r,o.message)},y(o.message),n&&(w[p]=e))}if(!zp(e)&&(w[p]={ref:b,...e},!n))return w}return y(!0),w};var mm=e=>({isOnSubmit:!e||e===Tp,isOnBlur:e===Cp,isOnChange:e===kp,isOnAll:e===Op,isOnTouch:e===Ip});function gm(e){for(const t in e)if(!Mp(e[t]))return!1;return!0}function vm(e,t){const n=Jp(t)?[t]:Xp(t),r=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Mp(e)?r++:e[t[r++]];return e}(e,n),o=n[n.length-1];let i;r&&delete r[o];for(let t=0;t<n.slice(0,-1).length;t++){let r,o=-1;const a=n.slice(0,-(t+1)),s=a.length-1;for(t>0&&(i=e);++o<a.length;){const t=a[o];r=r?r[t]:e[t],s===o&&(yp(r)&&zp(r)||Array.isArray(r)&&gm(r))&&(i?delete i[t]:delete e[t]),i=r}}return e}function bm(){let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}}var ym=e=>vp(e)||!bp(e);function wm(e,t){if(ym(e)||ym(t))return e===t;if(gp(e)&&gp(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const n=e[o];if(!r.includes(o))return!1;if("ref"!==o){const e=t[o];if(gp(n)&&gp(e)||yp(n)&&yp(e)||Array.isArray(n)&&Array.isArray(e)?!wm(n,e):n!==e)return!1}}return!0}var xm=e=>{const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Sm=e=>"select-multiple"===e.type,Mm=e=>xm(e)&&e.isConnected,_m=e=>{for(const t in e)if(rm(e[t]))return!0;return!1};function Em(e,t={}){const n=Array.isArray(e);if(yp(e)||n)for(const n in e)Array.isArray(e[n])||yp(e[n])&&!_m(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Em(e[n],t[n])):vp(e[n])||(t[n]=!0);return t}function Am(e,t,n){const r=Array.isArray(e);if(yp(e)||r)for(const r in e)Array.isArray(e[r])||yp(e[r])&&!_m(e[r])?Mp(t)||ym(n[r])?n[r]=Array.isArray(e[r])?Em(e[r],[]):{...Em(e[r])}:Am(e[r],vp(t)?{}:t[r],n[r]):wm(e[r],t[r])?delete n[r]:n[r]=!0;return n}var Cm=(e,t)=>Am(e,t,Em(t)),km=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Mp(e)?e:t?""===e?NaN:e?+e:e:n&&Wp(e)?new Date(e):r?r(e):e;function Tm(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return nm(t)?t.files:im(t)?dm(e.refs).value:Sm(t)?[...t.selectedOptions].map((({value:e})=>e)):mp(t)?cm(e.refs).value:km(Mp(t.value)?e.ref.value:t.value,e)}var Im=e=>Mp(e)?e:am(e)?e.source:yp(e)?am(e.value)?e.value.source:e.value:e;function Om(e,t,n){const r=_p(e,n);if(r||Jp(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const r=o.join("."),i=_p(t,r),a=_p(e,r);if(i&&!Array.isArray(i)&&n!==r)return{name:n};if(a&&a.type)return{name:r,error:a};o.pop()}return{name:n}}const Rm={mode:Tp,reValidateMode:kp,shouldFocusError:!0};function Pm(e={}){let t,n={...Rm,...e},r={submitCount:0,isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},o={},i=Kp(n.defaultValues)||{},a=n.shouldUnregister?{}:Kp(i),s={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c=0,u={};const d={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={watch:bm(),array:bm(),state:bm()},h=mm(n.mode),p=mm(n.reValidateMode),m=n.criteriaMode===Op,g=async()=>{let e=!1;return d.isValid&&(e=n.resolver?zp((await w()).errors):await x(o,!0),e!==r.isValid&&(r.isValid=e,f.state.next({isValid:e}))),e},v=(e,t,n,r)=>{const l=_p(o,e);if(l){const o=_p(a,e,Mp(n)?_p(i,e):n);Mp(o)||r&&r.defaultChecked||t?Qp(a,e,t?o:Tm(l._f)):_(e,o),s.mount&&g()}},b=(e,t,n,o,a)=>{let s=!1,l=!1;const c={name:e};if(d.isDirty&&(l=r.isDirty,r.isDirty=c.isDirty=S(),s=l!==c.isDirty),d.dirtyFields&&(!n||o)){l=_p(r.dirtyFields,e);const n=wm(_p(i,e),t);n?vm(r.dirtyFields,e):Qp(r.dirtyFields,e,!0),c.dirtyFields=r.dirtyFields,s=s||l!==!n}if(n){const t=_p(r.touchedFields,e);t||(Qp(r.touchedFields,e,n),c.touchedFields=r.touchedFields,s=s||d.touchedFields&&t!==n)}return s&&a&&f.state.next(c),s?c:{}},y=(n,o,i,a)=>{const s=_p(r.errors,n),l=d.isValid&&tm(o)&&r.isValid!==o;var h;if(e.delayError&&i?(h=()=>((e,t)=>{Qp(r.errors,e,t),f.state.next({errors:r.errors})})(n,i),t=e=>{clearTimeout(c),c=window.setTimeout(h,e)},t(e.delayError)):(clearTimeout(c),t=null,i?Qp(r.errors,n,i):vm(r.errors,n)),(i?!wm(s,i):s)||!zp(a)||l){const e={...a,...l&&tm(o)?{isValid:o}:{},errors:r.errors,name:n};r={...r,...e},f.state.next(e)}u[n]--,d.isValidating&&!Object.values(u).some((e=>e))&&(f.state.next({isValidating:!1}),u={})},w=async e=>n.resolver?await n.resolver({...a},n.context,((e,t,n,r)=>{const o={};for(const n of e){const e=_p(t,n);e&&Qp(o,n,e._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}})(e||l.mount,o,n.criteriaMode,n.shouldUseNativeValidation)):{},x=async(e,t,o={valid:!0})=>{for(const i in e){const s=e[i];if(s){const{_f:e,...i}=s;if(e){const i=l.array.has(e.name),c=await pm(s,_p(a,e.name),m,n.shouldUseNativeValidation,i);if(c[e.name]&&(o.valid=!1,t))break;!t&&(_p(c,e.name)?i?em(r.errors,c,e.name):Qp(r.errors,e.name,c[e.name]):vm(r.errors,e.name))}i&&await x(i,t,o)}}return o.valid},S=(e,t)=>(e&&t&&Qp(a,e,t),!wm(T(),i)),M=(e,t,n)=>Vp(e,l,{...s.mount?a:Mp(t)?i:Wp(e)?{[e]:t}:t},n),_=(e,t,n={})=>{const r=_p(o,e);let i=t;if(r){const n=r._f;n&&(!n.disabled&&Qp(a,e,km(t,n)),i=qp&&xm(n.ref)&&vp(t)?"":t,Sm(n.ref)?[...n.ref.options].forEach((e=>e.selected=i.includes(e.value))):n.refs?mp(n.ref)?n.refs.length>1?n.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(i)?!!i.find((t=>t===e.value)):i===e.value))):n.refs[0]&&(n.refs[0].checked=!!i):n.refs.forEach((e=>e.checked=e.value===i)):nm(n.ref)?n.ref.value="":(n.ref.value=i,n.ref.type||f.watch.next({name:e})))}(n.shouldDirty||n.shouldTouch)&&b(e,i,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&k(e)},E=(e,t,n)=>{for(const r in t){const i=t[r],a=`${e}.${r}`,s=_p(o,a);!l.array.has(e)&&ym(i)&&(!s||s._f)||gp(i)?_(a,i,n):E(a,i,n)}},A=(e,t,n={})=>{const s=_p(o,e),c=l.array.has(e),u=Kp(t);Qp(a,e,u),c?(f.array.next({name:e,values:a}),(d.isDirty||d.dirtyFields)&&n.shouldDirty&&(r.dirtyFields=Cm(i,a),f.state.next({name:e,dirtyFields:r.dirtyFields,isDirty:S(e,u)}))):!s||s._f||vp(u)?_(e,u,n):E(e,u,n),Zp(e,l)&&f.state.next({}),f.watch.next({name:e})},C=async e=>{const i=e.target;let s=i.name;const c=_p(o,s);if(c){let x,S;const M=i.type?Tm(c._f):wp(e),_=e.type===Ep||e.type===Ap,E=!((v=c._f).mount&&(v.required||v.min||v.max||v.maxLength||v.minLength||v.pattern||v.validate)||n.resolver||_p(r.errors,s)||c._f.deps)||((e,t,n,r,o)=>!o.isOnAll&&(!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:!(n?r.isOnChange:o.isOnChange)||e))(_,_p(r.touchedFields,s),r.isSubmitted,p,h),A=Zp(s,l,_);Qp(a,s,M),_?(c._f.onBlur&&c._f.onBlur(e),t&&t(0)):c._f.onChange&&c._f.onChange(e);const C=b(s,M,_,!1),T=!zp(C)||A;if(!_&&f.watch.next({name:s,type:e.type}),E)return d.isValid&&g(),T&&f.state.next({name:s,...A?{}:C});if(!_&&A&&f.state.next({}),u[s]=u[s]?u[s]+1:1,f.state.next({isValidating:!0}),n.resolver){const{errors:e}=await w([s]),t=Om(r.errors,o,s),n=Om(e,o,t.name||s);x=n.error,s=n.name,S=zp(e)}else x=(await pm(c,_p(a,s),m,n.shouldUseNativeValidation))[s],g();c._f.deps&&k(c._f.deps),y(s,S,x,C)}var v},k=async(e,t={})=>{let i,a;const s=Hp(e);if(f.state.next({isValidating:!0}),n.resolver){const t=await(async e=>{const{errors:t}=await w();if(e)for(const n of e){const e=_p(t,n);e?Qp(r.errors,n,e):vm(r.errors,n)}else r.errors=t;return t})(Mp(e)?e:s);i=zp(t),a=e?!s.some((e=>_p(t,e))):i}else e?(a=(await Promise.all(s.map((async e=>{const t=_p(o,e);return await x(t&&t._f?{[e]:t}:t)})))).every(Boolean),(a||r.isValid)&&g()):a=i=await x(o);return f.state.next({...!Wp(e)||d.isValid&&i!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:i}:{},errors:r.errors,isValidating:!1}),t.shouldFocus&&!a&&Yp(o,(e=>e&&_p(r.errors,e)),e?s:l.mount),a},T=e=>{const t={...i,...s.mount?a:{}};return Mp(e)?t:Wp(e)?_p(t,e):e.map((e=>_p(t,e)))},I=(e,t)=>({invalid:!!_p((t||r).errors,e),isDirty:!!_p((t||r).dirtyFields,e),isTouched:!!_p((t||r).touchedFields,e),error:_p((t||r).errors,e)}),O=(e,t={})=>{for(const s of e?Hp(e):l.mount)l.mount.delete(s),l.array.delete(s),_p(o,s)&&(t.keepValue||(vm(o,s),vm(a,s)),!t.keepError&&vm(r.errors,s),!t.keepDirty&&vm(r.dirtyFields,s),!t.keepTouched&&vm(r.touchedFields,s),!n.shouldUnregister&&!t.keepDefaultValue&&vm(i,s));f.watch.next({}),f.state.next({...r,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&g()},R=(e,t={})=>{let r=_p(o,e);const c=tm(t.disabled);return Qp(o,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),r?c&&Qp(a,e,t.disabled?void 0:_p(a,e,Tm(r._f))):v(e,!0,t.value),{...c?{disabled:t.disabled}:{},...n.shouldUseNativeValidation?{required:!!t.required,min:Im(t.min),max:Im(t.max),minLength:Im(t.minLength),maxLength:Im(t.maxLength),pattern:Im(t.pattern)}:{},name:e,onChange:C,onBlur:C,ref:a=>{if(a){R(e,t),r=_p(o,e);const n=Mp(a.value)&&a.querySelectorAll&&a.querySelectorAll("input,select,textarea")[0]||a,s=(e=>im(e)||mp(e))(n),l=r._f.refs||[];if(s?l.find((e=>e===n)):n===r._f.ref)return;Qp(o,e,{_f:{...r._f,...s?{refs:[...l.filter(Mm),n,...Array.isArray(_p(i,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),v(e,!1,void 0,n)}else r=_p(o,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!xp(l.array,e)||!s.action)&&l.unMount.add(e)}}},P=()=>n.shouldFocusError&&Yp(o,(e=>e&&_p(r.errors,e)),l.mount);return{control:{register:R,unregister:O,getFieldState:I,_executeSchema:w,_focusError:P,_getWatch:M,_getDirty:S,_updateValid:g,_removeUnmounted:()=>{for(const e of l.unMount){const t=_p(o,e);t&&(t._f.refs?t._f.refs.every((e=>!Mm(e))):!Mm(t._f.ref))&&O(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],n,l,c=!0,u=!0)=>{if(l&&n){if(s.action=!0,u&&Array.isArray(_p(o,e))){const t=n(_p(o,e),l.argA,l.argB);c&&Qp(o,e,t)}if(u&&Array.isArray(_p(r.errors,e))){const t=n(_p(r.errors,e),l.argA,l.argB);c&&Qp(r.errors,e,t),((e,t)=>{!Sp(_p(e,t)).length&&vm(e,t)})(r.errors,e)}if(d.touchedFields&&u&&Array.isArray(_p(r.touchedFields,e))){const t=n(_p(r.touchedFields,e),l.argA,l.argB);c&&Qp(r.touchedFields,e,t)}d.dirtyFields&&(r.dirtyFields=Cm(i,a)),f.state.next({isDirty:S(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Qp(a,e,t)},_getFieldArray:t=>Sp(_p(s.mount?a:i,t,e.shouldUnregister?_p(i,t,[]):[])),_subjects:f,_proxyFormState:d,get _fields(){return o},get _formValues(){return a},get _stateFlags(){return s},set _stateFlags(e){s=e},get _defaultValues(){return i},get _names(){return l},set _names(e){l=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:k,register:R,handleSubmit:(e,t)=>async i=>{i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let s=!0,l=Kp(a);f.state.next({isSubmitting:!0});try{if(n.resolver){const{errors:e,values:t}=await w();r.errors=e,l=t}else await x(o);zp(r.errors)?(f.state.next({errors:{},isSubmitting:!0}),await e(l,i)):(t&&await t({...r.errors},i),P())}catch(e){throw s=!1,e}finally{r.isSubmitted=!0,f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:zp(r.errors)&&s,submitCount:r.submitCount+1,errors:r.errors})}},watch:(e,t)=>rm(e)?f.watch.subscribe({next:n=>e(M(void 0,t),n)}):M(e,t,!0),setValue:A,getValues:T,reset:(t,n)=>((t,n={})=>{const c=t||i,u=Kp(c),h=t&&!zp(t)?u:i;if(n.keepDefaultValues||(i=c),!n.keepValues){if(n.keepDirtyValues)for(const e of l.mount)_p(r.dirtyFields,e)?Qp(h,e,_p(a,e)):A(e,_p(h,e));else{if(qp&&Mp(t))for(const e of l.mount){const t=_p(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(xm(e)){const t=e.closest("form");if(t){t.reset();break}}}}o={}}a=e.shouldUnregister?n.keepDefaultValues?Kp(i):{}:u,f.array.next({values:h}),f.watch.next({values:h})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!n.keepIsValid,s.watch=!!e.shouldUnregister,f.state.next({submitCount:n.keepSubmitCount?r.submitCount:0,isDirty:n.keepDirty||n.keepDirtyValues?r.isDirty:!(!n.keepDefaultValues||wm(t,i)),isSubmitted:!!n.keepIsSubmitted&&r.isSubmitted,dirtyFields:n.keepDirty||n.keepDirtyValues?r.dirtyFields:n.keepDefaultValues&&t?Cm(i,t):{},touchedFields:n.keepTouched?r.touchedFields:{},errors:n.keepErrors?r.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(rm(t)?t(a):t,n),resetField:(e,t={})=>{_p(o,e)&&(Mp(t.defaultValue)?A(e,_p(i,e)):(A(e,t.defaultValue),Qp(i,e,t.defaultValue)),t.keepTouched||vm(r.touchedFields,e),t.keepDirty||(vm(r.dirtyFields,e),r.isDirty=t.defaultValue?S(e,_p(i,e)):S()),t.keepError||(vm(r.errors,e),d.isValid&&g()),f.state.next({...r}))},clearErrors:e=>{e?Hp(e).forEach((e=>vm(r.errors,e))):r.errors={},f.state.next({errors:r.errors})},unregister:O,setError:(e,t,n)=>{const i=(_p(o,e,{_f:{}})._f||{}).ref;Qp(r.errors,e,{...t,ref:i}),f.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&i&&i.focus&&i.focus()},setFocus:(e,t={})=>{const n=_p(o,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:I}}function Nm(e={}){const t=r(u).useRef(),[n,o]=r(u).useState({isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:e.defaultValues});t.current||(t.current={...Pm(e),formState:n});const i=t.current.control;return i._options=e,Gp({subject:i._subjects.state,callback:r(u).useCallback((e=>{Up(e,i._proxyFormState,!0)&&(i._formState={...i._formState,...e},o({...i._formState}))}),[i])}),r(u).useEffect((()=>{i._stateFlags.mount||(i._proxyFormState.isValid&&i._updateValid(),i._stateFlags.mount=!0),i._stateFlags.watch&&(i._stateFlags.watch=!1,i._subjects.state.next({})),i._removeUnmounted()})),r(u).useEffect((()=>{n.submitCount&&i._focusError()}),[i,n.submitCount]),t.current.formState=Fp(n,i),t.current}u=a("85Hg2");var Lm=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),r(u).createElement("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"}));var Bm=({pwdOrTokens:e,setPwdOrTokens:t,onFinish:n,minimumNumberOfRecoveryTokens:o=1,showTokens:i=!0,openModal:a=!1,withModal:s=!1})=>{var l;const{t:c}=ea(),{register:d,handleSubmit:f,formState:{errors:h},setError:p}=Nm(),[m,g]=(0,u.useState)(1),[v,b]=(0,u.useState)(!!e),y=r(u).createElement("form",{name:"memoriAuth",onSubmit:f((t=>{var r,i,a;"password"===e&&!(null===(r=t.password)||void 0===r?void 0:r.length)||"tokens"===e&&(((null===(i=null==t?void 0:t.tokens)||void 0===i?void 0:i.length)||0)<o||!(null===(a=null==t?void 0:t.tokens)||void 0===a?void 0:a.every((e=>e.length))))?p("tokens",{type:"minLength",message:"Tokens"}):n&&n(t).then((()=>{b(!1)}))})),className:"memori-auth-widget--form"},("password"===e||!i)&&r(u).createElement("fieldset",{className:"memori-auth-widget--password-fieldset"},r(u).createElement("label",null,"Password:"," ",r(u).createElement("input",{className:"memori-auth-widget--input",required:!0,type:"password",placeholder:"Password",...d("password",{required:!0})})),i&&r(u).createElement(r(u).Fragment,null,r(u).createElement("hr",null),r(u).createElement(Zd,{outlined:!0,onClick:()=>t("tokens")},c("auth.useRecoveryTokens")||"Recovery tokens"))),"tokens"===e&&i&&r(u).createElement("fieldset",{className:"memori-auth-widget--tokens-fieldset",name:"tokens"},r(u).createElement("legend",null,c("auth.tokens"),": "),(w=m,Array.from({length:w},((e,t)=>t))).map((e=>r(u).createElement("label",{className:"memori-auth-widget--token",key:e},r(u).createElement("input",{type:"password",className:"memori-auth-widget--input",placeholder:"Recovery token",required:!0,autoComplete:"off",...d(`tokens.${e}`,{required:!0})})))),r(u).createElement(Zd,{onClick:()=>g((e=>e+1)),className:"memori-auth-widget--token-add",icon:r(u).createElement(Lm,null)},c("auth.addToken")||"Add token"),r(u).createElement("hr",null),r(u).createElement(Zd,{outlined:!0,onClick:()=>t("password")},c("auth.usePassword")||"Password")),"minLength"===(null===(l=h.tokens)||void 0===l?void 0:l.type)&&r(u).createElement("div",{className:"memori-auth-widget--error"},c("auth.atLeast")||"At least"," ",o),r(u).createElement(Zd,{htmlType:"submit",primary:!0,className:"memori-auth-widget--submit"},c("confirm")||"Submit"));var w;return s?r(u).createElement(pp,{open:a||v,title:"Authentication",onClose:()=>t(null),closable:!1},y):y};u=a("85Hg2"),Xd=a("4IUwl"),u=a("85Hg2");const Dm=()=>{let e=!1;if("maxTouchPoints"in navigator)e=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)e=navigator.msMaxTouchPoints>0;else{const n=window&&"matchMedia"in window&&matchMedia("(pointer:coarse)");if(n&&"(pointer:coarse)"===n.media)e=!!n.matches;else if("orientation"in window)e=!0;else{var t=null===navigator||void 0===navigator?void 0:navigator.userAgent;e=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(t)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(t)}}return e};const jm=e=>e.slice(0,e.length/2).trim().toLowerCase()===e.slice(e.length/2+1).trim().toLowerCase()?e.slice(0,e.length/2):e,Fm=({type:e,resourceURI:t,sessionID:n,baseURL:r=""})=>{var o,i;let a="cover"===e?`${r}/images/memoriCover.png`:`${r}/images/memoriAvatar.png`;return t&&0!==t.length?t.includes("memoriai/memory")&&!t.includes("memori-ai-session-id")&&n?`${t}?memori-ai-session-id=${n}`:t.startsWith("https://")||t.startsWith("http://")?`${t}${n?`/${n}`:""}`:t.startsWith("cloud://")?`${o=void 0,(void 0===o?void 0:o.replace(/v2/,"v1"))||""}/CloudAsset/${t.replace("cloud://","")}`:t.startsWith("guid://")?`${i=void 0,(void 0===i?void 0:i.replace(/v2/,"v1"))||""}/GuidAsset/${t.replace("guid://","")}`:a:a};u=a("85Hg2"),Xd=a("4IUwl"),u=a("85Hg2");var zm=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}));var Um=({message:e,memori:t,tenant:n,baseUrl:o})=>r(u).createElement(r(u).Fragment,null,e.initial&&r(u).createElement("div",{className:"memori-chat--bubble-initial"}),r(u).createElement(dp,{show:!0,appear:!0,as:"div",className:r(Xd)("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!e.fromUser})},!e.fromUser&&r(u).createElement(dp.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15")},r(u).createElement("source",{src:Fm({type:"avatar",tenantID:null==n?void 0:n.id,resourceURI:t.avatarURL,baseURL:o})}),r(u).createElement("img",{className:"memori-chat--bubble-avatar-img",alt:t.name,src:t.avatarURL&&t.avatarURL.length>0?Fm({type:"avatar",tenantID:null==n?void 0:n.id,resourceURI:t.avatarURL,baseURL:o}):Fm({tenantID:null==n?void 0:n.id,type:"avatar",baseURL:o||"https://app.twincreator.com"})})),r(u).createElement(dp.Child,{as:"div",className:r(Xd)("memori-chat--bubble",{"memori-chat--user-bubble":!!e.fromUser}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30")},(e.translatedText||e.text).split(/\r\n|\r|\n/).map(((e,t)=>r(u).createElement("p",{key:t},e)))),e.fromUser&&r(u).createElement(dp.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15")},r(u).createElement(zm,null))));u=a("85Hg2"),u=a("85Hg2"),u=a("85Hg2");var Hm,Gm=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})),Wm=(Xd=a("4IUwl"),{});Hm=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function n(e,n){var r=e.el,o=e.elStyle,i=e.elHeight,a=e.rowsLimit,s=e.rowsWrapped,l=e.options,c=e.buffer,u=c;if(s===a+1)return t({},e);var d=c,f=s,h=i;return r.innerHTML=u=c.length?""+c+l.delimiter+n+l.replaceStr:""+n+l.replaceStr,parseFloat(o.height)>parseFloat(i)&&(f++,h=o.height,f===a+1)?(r.innerHTML=u="."===d[d.length-1]&&"..."===l.replaceStr?d+"..":""+d+l.replaceStr,t({},e,{elHeight:h,rowsWrapped:f})):(r.innerHTML=u=d.length?""+d+l.delimiter+n:""+n,t({},e,{buffer:u,elHeight:h,rowsWrapped:f}))}e.disableResponsive=function(e){window.removeEventListener("resize",e)},e.ellipsis=function e(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={replaceStr:"...",responsive:!1,debounceDelay:250,delimiter:" "},s=t({},a,i),l=r&&(r instanceof NodeList?r:1===r.nodeType?[r]:document.querySelectorAll(r)),c=[],u=0;u<l.length;u++){var d=l[u];c[u]=d.innerHTML;var f=d.innerHTML.split(s.delimiter);d.innerHTML="";var h=window.getComputedStyle(d);f.reduce(n,{el:d,buffer:d.innerHTML,elStyle:h,elHeight:0,rowsLimit:o,rowsWrapped:0,options:s})}if(s.responsive){var p=!1,m=window.innerWidth,g=function(){if(window.innerWidth!==m){m=window.innerWidth;for(var n=0;n<l.length;n++)l[n].innerHTML=c[n];e(r,o,t({},i,{responsive:!1}))}},v=function(){clearTimeout(p),p=setTimeout(g,s.debounceDelay)};return window.addEventListener("resize",v),v}}},"function"==typeof define&&define.amd?define(["exports"],Hm):Hm(Wm);u=a("85Hg2"),Xd=a("4IUwl");var Vm=({loading:e=!1,className:t,title:n,description:o,cover:i,hoverable:a=!1,children:s})=>r(u).createElement("div",{className:r(Xd)("memori-card",t,{"memori-card--loading":e,"memori-card--with-cover":i,"memori-card--hoverable":a})},r(u).createElement(fp,{spinning:e},i&&r(u).createElement("div",{className:"memori-card--cover"},i),r(u).createElement("div",{className:"memori-card--content"},n&&r(u).createElement("h3",{className:"memori-card--title"},n),o&&r(u).createElement("p",{className:"memori-card--description"},o),r(u).createElement("div",{className:"memori-card--children"},s))));const qm=({item:e,baseUrl:t,onLinkPreviewInfo:n,descriptionOneLine:o=!1})=>{var i,a,s,l;const[c,d]=(0,u.useState)(null),f=(null===(i=e.url)||void 0===i?void 0:i.startsWith("http"))||!e.url||0===(null===(a=e.url)||void 0===a?void 0:a.length)?e.url:`https://${e.url}`;(0,u.useEffect)((()=>{var r,o;let i=(null===(r=e.url)||void 0===r?void 0:r.startsWith("http"))||!e.url||0===(null===(o=e.url)||void 0===o?void 0:o.length)?e.url:`https://${e.url}`;i&&i!==(null==c?void 0:c.urlKey)&&(async(e,t)=>{try{const n=await fetch(`${t||"https://app.twincreator.com"}/api/linkpreview/${encodeURIComponent(e)}`);return await n.json()}catch(e){return console.error("getSiteInfo",e),null}})(i,t).then((e=>{d(e?{...e,urlKey:i}:null),n&&e&&n(e)}))}),[null==e?void 0:e.url,t,n]);const h=e.title&&e.title.length>0?e.title:null==c?void 0:c.title,p=null==c?void 0:c.description,m=null==c?void 0:c.video,g=null!==(s=null==c?void 0:c.image)&&void 0!==s?s:null===(l=null==c?void 0:c.images)||void 0===l?void 0:l[0];return(0,u.useEffect)((()=>{setTimeout((()=>{(0,Wm.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[p,e.mediumID]),r(u).createElement("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"memori-link-item--link"},r(u).createElement(Vm,{hoverable:!0,className:r(Xd)("memori-link-item--card",{"memori-link-item--card-description-oneline":o,"memori-link-item--card-has-image":g,"memori-link-item--card-has-video":m}),cover:m?r(u).createElement("iframe",{width:"100%",height:"100%",src:m,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):g?r(u).createElement("img",{className:"memori-link-item--card-cover-img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",srcSet:g.includes("data:image")?void 0:g,alt:e.title}):r(u).createElement("div",{className:"memori-link-item--card-cover-icon"},r(u).createElement(Gm,{className:"memori-link-item--icon"})),title:h,description:p}))};var Km=({items:e,baseUrl:t,descriptionOneLine:n=!1,onLinkPreviewInfo:o})=>r(u).createElement(dp,{appear:!0,show:!0,as:"div",className:"memori-link-items"},r(u).createElement("div",{className:"memori-link-items--grid"},e.map(((e,i)=>r(u).createElement(dp.Child,{as:"div",className:"memori-link-item",key:e.mediumID,enter:"ease-out duration-500 delay-"+100*i,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95"},r(u).createElement(qm,{item:e,baseUrl:t,descriptionOneLine:n,onLinkPreviewInfo:o}))))));u=a("85Hg2");const $m=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],Jm=async(e,t,n,r)=>{var o;const i=$m.indexOf(e.toLowerCase())>-1?"IT":null==n?void 0:n.toUpperCase(),a=await fetch(`${r||"https://app.twincreator.com"}/api/translate?text=${encodeURIComponent(e)}&target_lang=${t.toUpperCase()}${i?`&source_lang=${i}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),s=await a.json();return null===(o=null==s?void 0:s.translations)||void 0===o?void 0:o[0]},Xm=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"}],Qm=["image/jpeg","image/png","image/jpg","image/gif","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/pdf","video/mp4","video/avi","audio/mpeg3","audio/wav","audio/mpeg","video/mpeg","model/gltf-binary"],Ym="👤",Zm=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}];u=a("85Hg2");var eg=({src:e,poster:t,alt:n=""})=>((0,u.useEffect)((()=>{const e=document.createElement("script");return e.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",e.type="module",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),r(u).createElement("div",{className:"model-viewer"},r(u).createElement("model-viewer",{src:e,"ios-src":"",poster:t,alt:n,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})));u=a("85Hg2"),u=a("85Hg2");var tg=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})),ng={};function rg(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}(ng=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){rg(i,r,o,a,s,"next",e)}function s(e){rg(i,r,o,a,s,"throw",e)}a(void 0)}))}}).__esModule=!0,ng.default=ng;var og={};function ig(){return og=ig=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},og.__esModule=!0,og.default=og,ig.apply(this,arguments)}(og=ig).__esModule=!0,og.default=og;var ag={};(ag=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}).__esModule=!0,ag.default=ag;var sg={},lg={},cg=a("7h3ED").default,ug={},dg=a("7h3ED").default;function fg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lg(r.key),r)}}(ug=function(e,t){if("object"!==dg(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==dg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}).__esModule=!0,ug.default=ug,(lg=function(e){var t=ug(e,"string");return"symbol"===cg(t)?t:String(t)}).__esModule=!0,lg.default=lg,(sg=function(e,t,n){return t&&fg(e.prototype,t),n&&fg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}).__esModule=!0,sg.default=sg;var hg={},pg={};function mg(e,t){return pg=mg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pg.__esModule=!0,pg.default=pg,mg(e,t)}(pg=mg).__esModule=!0,pg.default=pg,(hg=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pg(e,t)}).__esModule=!0,hg.default=hg;var gg={},vg=a("7h3ED").default,bg={};(bg=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}).__esModule=!0,bg.default=bg,(gg=function(e,t){if(t&&("object"===vg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return bg(e)}).__esModule=!0,gg.default=gg;var yg={};function wg(e){return yg=wg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yg.__esModule=!0,yg.default=yg,wg(e)}(yg=wg).__esModule=!0,yg.default=yg;var xg={};(xg=function(e,t,n){return(t=lg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}).__esModule=!0,xg.default=xg;var Sg,Mg=a("6EIcq")();Sg=Mg;try{regeneratorRuntime=Mg}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=Mg:Function("r","regeneratorRuntime = r")(Mg)}u=a("85Hg2");var _g={},Eg={};(Eg=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}).__esModule=!0,Eg.default=Eg,(_g=function(e,t){if(null==e)return{};var n,r,o=Eg(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}).__esModule=!0,_g.default=_g;var Ag={},Cg={},kg={};(kg=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}).__esModule=!0,kg.default=kg,(Cg=function(e){if(Array.isArray(e))return kg(e)}).__esModule=!0,Cg.default=Cg;var Tg={};(Tg=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}).__esModule=!0,Tg.default=Tg;var Ig={};Ig=function(e,t){if(e){if("string"==typeof e)return kg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kg(e,t):void 0}},Ig.__esModule=!0,Ig.default=Ig;var Og={};(Og=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,Og.default=Og,(Ag=function(e){return Cg(e)||Tg(e)||Ig(e)||Og()}).__esModule=!0,Ag.default=Ag;u=a("85Hg2"),u=a("85Hg2");function Rg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rg(Object(n),!0).forEach((function(t){r(xg)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ng={};function Lg(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return Ng[r]||(Ng[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),Ng[r]}function Bg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),o=Lg(r);return o.reduce((function(e,t){return Pg(Pg({},e),n[t])}),t)}function Dg(e){return e.join(" ")}function jg(e){var t=e.node,n=e.stylesheet,o=e.style,i=void 0===o?{}:o,a=e.useInlineStyles,s=e.key,l=t.properties,c=t.type,d=t.tagName,f=t.value;if("text"===c)return f;if(d){var h,p=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,o){return jg({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(o)})}))}}(n,a);if(a){var m=Object.keys(n).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&g.concat(l.className.filter((function(e){return!m.includes(e)})));h=Pg(Pg({},l),{},{className:Dg(v)||void 0,style:Bg(l.className,Object.assign({},l.style,i),n)})}else h=Pg(Pg({},l),{},{className:Dg(l.className)});var b=p(t.children);return r(u).createElement(d,r(og)({key:s},h),b)}}var Fg=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function zg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ug(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zg(Object(n),!0).forEach((function(t){r(xg)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Hg=/\n/g;function Gg(e){var t=e.codeString,n=e.codeStyle,o=e.containerStyle,i=void 0===o?{float:"left",paddingRight:"10px"}:o,a=e.numberStyle,s=void 0===a?{}:a,l=e.startingLineNumber;return r(u).createElement("code",{style:Object.assign({},n,i)},function(e){var t=e.lines,n=e.startingLineNumber,o=e.style;return t.map((function(e,t){var i=t+n;return r(u).createElement("span",{key:"line-".concat(t),className:"react-syntax-highlighter-line-number",style:"function"==typeof o?o(i):o},"".concat(i,"\n"))}))}({lines:t.replace(/\n$/,"").split("\n"),style:s,startingLineNumber:l}))}function Wg(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Vg(e,t,n){var r,o={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},i="function"==typeof e?e(t):e;return Ug(Ug({},o),i)}function qg(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,o=e.largestLineNumber,i=e.showInlineLineNumbers,a=e.lineProps,s=void 0===a?{}:a,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,f="function"==typeof s?s(n):s;if(f.className=c,n&&i){var h=Vg(r,n,o);t.unshift(Wg(n,h))}return d&u&&(f.style=Ug(Ug({},f.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:f,children:t}}function Kg(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=0;o<e.length;o++){var i=e[o];if("text"===i.type)n.push(qg({children:[i],className:r(Ag)(new Set(t))}));else if(i.children){var a=t.concat(i.properties.className);Kg(i.children,a).forEach((function(e){return n.push(e)}))}}return n}function $g(e,t,n,r,o,i,a,s,l){var c,u=Kg(e.value),d=[],f=-1,h=0;function p(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return qg({children:e,lineNumber:t,lineNumberStyle:s,largestLineNumber:a,showInlineLineNumbers:o,lineProps:n,className:i,showLineNumbers:r,wrapLongLines:l})}function m(e,t){if(r&&t&&o){var n=Vg(s,t,a);e.unshift(Wg(t,n))}return e}function g(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?p(e,n,r):m(e,n)}for(var v=function(){var e=u[h],t=e.children[0].value;if(t.match(Hg)){var n=t.split("\n");n.forEach((function(t,o){var a=r&&d.length+i,s={type:"text",value:"".concat(t,"\n")};if(0===o){var l=g(u.slice(f+1,h).concat(qg({children:[s],className:e.properties.className})),a);d.push(l)}else if(o===n.length-1){var c=u[h+1]&&u[h+1].children&&u[h+1].children[0],p={type:"text",value:"".concat(t)};if(c){var m=qg({children:[p],className:e.properties.className});u.splice(h+1,0,m)}else{var v=g([p],a,e.properties.className);d.push(v)}}else{var b=g([s],a,e.properties.className);d.push(b)}})),f=h}h++};h<u.length;)v();if(f!==u.length-1){var b=u.slice(f+1,u.length);if(b&&b.length){var y=g(b,r&&d.length+i);d.push(y)}}return t?d:(c=[]).concat.apply(c,d)}function Jg(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return jg({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function Xg(e){return e&&void 0!==e.highlightAuto}function Qg(e,t){return function(n){var o=n.language,i=n.children,a=n.style,s=void 0===a?t:a,l=n.customStyle,c=void 0===l?{}:l,d=n.codeTagProps,f=void 0===d?{className:o?"language-".concat(o):void 0,style:Ug(Ug({},s['code[class*="language-"]']),s['code[class*="language-'.concat(o,'"]')])}:d,h=n.useInlineStyles,p=void 0===h||h,m=n.showLineNumbers,g=void 0!==m&&m,v=n.showInlineLineNumbers,b=void 0===v||v,y=n.startingLineNumber,w=void 0===y?1:y,x=n.lineNumberContainerStyle,S=n.lineNumberStyle,M=void 0===S?{}:S,_=n.wrapLines,E=n.wrapLongLines,A=void 0!==E&&E,C=n.lineProps,k=void 0===C?{}:C,T=n.renderer,I=n.PreTag,O=void 0===I?"pre":I,R=n.CodeTag,P=void 0===R?"code":R,N=n.code,L=void 0===N?(Array.isArray(i)?i[0]:i)||"":N,B=n.astGenerator,D=r(_g)(n,Fg);B=B||e;var j=g?r(u).createElement(Gg,{containerStyle:x,codeStyle:f.style||{},numberStyle:M,startingLineNumber:w,codeString:L}):null,F=s.hljs||s['pre[class*="language-"]']||{backgroundColor:"#fff"},z=Xg(B)?"hljs":"prismjs",U=p?Object.assign({},D,{style:Object.assign({},F,c)}):Object.assign({},D,{className:D.className?"".concat(z," ").concat(D.className):z,style:Object.assign({},c)});if(f.style=Ug(Ug({},f.style),{},A?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"}),!B)return r(u).createElement(O,U,j,r(u).createElement(P,f,L));(void 0===_&&T||A)&&(_=!0),T=T||Jg;var H=[{type:"text",value:L}],G=function(e){var t=e.astGenerator,n=e.language,r=e.code,o=e.defaultCodeValue;if(Xg(t)){var i=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:o,language:"text"}:i?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:o}}catch(e){return{value:o}}}({astGenerator:B,language:o,code:L,defaultCodeValue:H});null===G.language&&(G.value=H);var W=$g(G,_,k,g,b,w,G.value.length+w,M,A);return r(u).createElement(O,U,r(u).createElement(P,f,!b&&j,T({rows:W,stylesheet:s,useInlineStyles:p})))}}function Yg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=r(yg)(e);if(t){var i=r(yg)(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return r(gg)(this,n)}}var Zg,ev,tv,nv,rv,ov,iv,av=function(e,t){return function(){var n=r(ng)(r(Sg).mark((function n(o){var i;return r(Sg).wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t();case 2:i=n.sent,o(e,i.default||i);case 4:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()},sv={abap:av("abap",(function(){return a("bwHpE")})),abnf:av("abnf",(function(){return a("daD87")})),actionscript:av("actionscript",(function(){return a("lpEgO")})),ada:av("ada",(function(){return a("1sGW9")})),agda:av("agda",(function(){return a("e9VyR")})),al:av("al",(function(){return a("kMFSe")})),antlr4:av("antlr4",(function(){return a("8HlsP")})),apacheconf:av("apacheconf",(function(){return a("isFCh")})),apex:av("apex",(function(){return a("gUXVM")})),apl:av("apl",(function(){return a("2L15v")})),applescript:av("applescript",(function(){return a("8XyFT")})),aql:av("aql",(function(){return a("gFWTI")})),arduino:av("arduino",(function(){return a("jI3VB")})),arff:av("arff",(function(){return a("6uYTH")})),asciidoc:av("asciidoc",(function(){return a("gdYKH")})),asm6502:av("asm6502",(function(){return a("ahFLg")})),asmatmel:av("asmatmel",(function(){return a("4irIu")})),aspnet:av("aspnet",(function(){return a("yDC6n")})),autohotkey:av("autohotkey",(function(){return a("a4xpy")})),autoit:av("autoit",(function(){return a("iNSix")})),avisynth:av("avisynth",(function(){return a("kEBnk")})),avroIdl:av("avroIdl",(function(){return a("lzthi")})),bash:av("bash",(function(){return Promise.resolve(a("3aDLI"))})),basic:av("basic",(function(){return a("cxDu6")})),batch:av("batch",(function(){return a("6zDll")})),bbcode:av("bbcode",(function(){return a("bPS87")})),bicep:av("bicep",(function(){return a("8dy5f")})),birb:av("birb",(function(){return a("3vHrY")})),bison:av("bison",(function(){return a("bCjBS")})),bnf:av("bnf",(function(){return a("4NqDW")})),brainfuck:av("brainfuck",(function(){return a("4s0KX")})),brightscript:av("brightscript",(function(){return a("jTsQ4")})),bro:av("bro",(function(){return a("5lMc2")})),bsl:av("bsl",(function(){return a("jBYxC")})),c:av("c",(function(){return Promise.resolve(a("lyZgY"))})),cfscript:av("cfscript",(function(){return a("coZDy")})),chaiscript:av("chaiscript",(function(){return a("e1zEN")})),cil:av("cil",(function(){return a("crKoM")})),clike:av("clike",(function(){return a("4kO9t")})),clojure:av("clojure",(function(){return a("01SpB")})),cmake:av("cmake",(function(){return a("9yG4p")})),cobol:av("cobol",(function(){return a("967Hn")})),coffeescript:av("coffeescript",(function(){return a("7Yi6H")})),concurnas:av("concurnas",(function(){return a("5tXmX")})),coq:av("coq",(function(){return a("ektdr")})),cpp:av("cpp",(function(){return Promise.resolve(a("lR39A"))})),crystal:av("crystal",(function(){return a("8gt4L")})),csharp:av("csharp",(function(){return a("7K6eJ")})),cshtml:av("cshtml",(function(){return a("cVu4i")})),csp:av("csp",(function(){return a("ecKo1")})),cssExtras:av("cssExtras",(function(){return a("gnpv8")})),css:av("css",(function(){return a("jx0H8")})),csv:av("csv",(function(){return a("f9kmW")})),cypher:av("cypher",(function(){return a("lojor")})),d:av("d",(function(){return a("6Qa0U")})),dart:av("dart",(function(){return a("74K1B")})),dataweave:av("dataweave",(function(){return a("93H6c")})),dax:av("dax",(function(){return a("cf9Y9")})),dhall:av("dhall",(function(){return a("f6UWv")})),diff:av("diff",(function(){return a("klPVo")})),django:av("django",(function(){return a("jfxe9")})),dnsZoneFile:av("dnsZoneFile",(function(){return a("5aMz5")})),docker:av("docker",(function(){return a("kOauC")})),dot:av("dot",(function(){return a("btE6k")})),ebnf:av("ebnf",(function(){return a("aT88c")})),editorconfig:av("editorconfig",(function(){return a("jWOl8")})),eiffel:av("eiffel",(function(){return a("kHJaX")})),ejs:av("ejs",(function(){return a("frfnA")})),elixir:av("elixir",(function(){return a("hcrJ2")})),elm:av("elm",(function(){return a("jd271")})),erb:av("erb",(function(){return a("gczXL")})),erlang:av("erlang",(function(){return a("FsabW")})),etlua:av("etlua",(function(){return a("9DI9l")})),excelFormula:av("excelFormula",(function(){return a("3QVue")})),factor:av("factor",(function(){return a("ltNCT")})),falselang:av("falselang",(function(){return a("g0Q6p")})),firestoreSecurityRules:av("firestoreSecurityRules",(function(){return a("ukA2V")})),flow:av("flow",(function(){return a("e5prn")})),fortran:av("fortran",(function(){return a("gIEL6")})),fsharp:av("fsharp",(function(){return a("3wQkt")})),ftl:av("ftl",(function(){return a("7ZVWs")})),gap:av("gap",(function(){return a("hOFj6")})),gcode:av("gcode",(function(){return a("95BzQ")})),gdscript:av("gdscript",(function(){return a("iul6t")})),gedcom:av("gedcom",(function(){return a("e0qJM")})),gherkin:av("gherkin",(function(){return a("2SHak")})),git:av("git",(function(){return a("l6VFH")})),glsl:av("glsl",(function(){return a("cEMfJ")})),gml:av("gml",(function(){return a("8UVTr")})),gn:av("gn",(function(){return a("kvibD")})),goModule:av("goModule",(function(){return a("icqjF")})),go:av("go",(function(){return a("jLkg8")})),graphql:av("graphql",(function(){return a("aYGNi")})),groovy:av("groovy",(function(){return a("4bTmH")})),haml:av("haml",(function(){return a("h2A6V")})),handlebars:av("handlebars",(function(){return a("79YVJ")})),haskell:av("haskell",(function(){return a("bsiLW")})),haxe:av("haxe",(function(){return a("94Kdj")})),hcl:av("hcl",(function(){return a("9CheR")})),hlsl:av("hlsl",(function(){return a("h3dqW")})),hoon:av("hoon",(function(){return a("9WbsW")})),hpkp:av("hpkp",(function(){return a("GiPN3")})),hsts:av("hsts",(function(){return a("eaSn9")})),http:av("http",(function(){return a("1uj7b")})),ichigojam:av("ichigojam",(function(){return a("ge562")})),icon:av("icon",(function(){return a("lVHUf")})),icuMessageFormat:av("icuMessageFormat",(function(){return a("aYoUL")})),idris:av("idris",(function(){return a("1RVAE")})),iecst:av("iecst",(function(){return a("bi7Dr")})),ignore:av("ignore",(function(){return a("cq0Pi")})),inform7:av("inform7",(function(){return a("31K4E")})),ini:av("ini",(function(){return a("l05OZ")})),io:av("io",(function(){return a("6bY1b")})),j:av("j",(function(){return a("1ebDS")})),java:av("java",(function(){return a("iEZZI")})),javadoc:av("javadoc",(function(){return a("aHy5a")})),javadoclike:av("javadoclike",(function(){return a("5f3rE")})),javascript:av("javascript",(function(){return a("7JDFI")})),javastacktrace:av("javastacktrace",(function(){return a("gdCGE")})),jexl:av("jexl",(function(){return a("cqMb9")})),jolie:av("jolie",(function(){return a("cEDX4")})),jq:av("jq",(function(){return a("kEWsh")})),jsExtras:av("jsExtras",(function(){return a("74PI8")})),jsTemplates:av("jsTemplates",(function(){return a("30TPr")})),jsdoc:av("jsdoc",(function(){return a("9DH5c")})),json:av("json",(function(){return Promise.resolve(a("l1Rj1"))})),json5:av("json5",(function(){return a("920rv")})),jsonp:av("jsonp",(function(){return a("9AwS1")})),jsstacktrace:av("jsstacktrace",(function(){return a("bYXMr")})),jsx:av("jsx",(function(){return Promise.resolve(a("6ho3O"))})),julia:av("julia",(function(){return a("g0ibH")})),keepalived:av("keepalived",(function(){return a("2hdnH")})),keyman:av("keyman",(function(){return a("cIufI")})),kotlin:av("kotlin",(function(){return a("c26dU")})),kumir:av("kumir",(function(){return a("iYAha")})),kusto:av("kusto",(function(){return a("9z1oX")})),latex:av("latex",(function(){return a("lCPLU")})),latte:av("latte",(function(){return a("c9oN0")})),less:av("less",(function(){return a("hA3V9")})),lilypond:av("lilypond",(function(){return a("hpHTA")})),liquid:av("liquid",(function(){return a("kpZTm")})),lisp:av("lisp",(function(){return a("chgK5")})),livescript:av("livescript",(function(){return a("2gdiv")})),llvm:av("llvm",(function(){return a("jUeFO")})),log:av("log",(function(){return a("3BFSQ")})),lolcode:av("lolcode",(function(){return a("lG9br")})),lua:av("lua",(function(){return a("cVGpd")})),magma:av("magma",(function(){return a("4LVzY")})),makefile:av("makefile",(function(){return a("2NviD")})),markdown:av("markdown",(function(){return a("jUFCF")})),markupTemplating:av("markupTemplating",(function(){return Promise.resolve(a("t3W0d"))})),markup:av("markup",(function(){return a("5hIXu")})),matlab:av("matlab",(function(){return a("kPAC0")})),maxscript:av("maxscript",(function(){return a("gHOJy")})),mel:av("mel",(function(){return a("9mj6e")})),mermaid:av("mermaid",(function(){return a("kozw5")})),mizar:av("mizar",(function(){return a("2bN6W")})),mongodb:av("mongodb",(function(){return a("eHKWX")})),monkey:av("monkey",(function(){return a("7Fh0C")})),moonscript:av("moonscript",(function(){return a("hDXwC")})),n1ql:av("n1ql",(function(){return a("j9bkC")})),n4js:av("n4js",(function(){return a("eTmBF")})),nand2tetrisHdl:av("nand2tetrisHdl",(function(){return a("ezjCf")})),naniscript:av("naniscript",(function(){return a("VxHk1")})),nasm:av("nasm",(function(){return a("ly95T")})),neon:av("neon",(function(){return a("7Fk34")})),nevod:av("nevod",(function(){return a("3U8Qv")})),nginx:av("nginx",(function(){return a("c6qVk")})),nim:av("nim",(function(){return a("1JdCk")})),nix:av("nix",(function(){return a("jcstS")})),nsis:av("nsis",(function(){return a("kEJqW")})),objectivec:av("objectivec",(function(){return a("lUP8A")})),ocaml:av("ocaml",(function(){return a("lhTAD")})),opencl:av("opencl",(function(){return a("8rxKO")})),openqasm:av("openqasm",(function(){return a("ib0uL")})),oz:av("oz",(function(){return a("csCUS")})),parigp:av("parigp",(function(){return a("2DkHE")})),parser:av("parser",(function(){return a("2cp75")})),pascal:av("pascal",(function(){return a("fViVl")})),pascaligo:av("pascaligo",(function(){return a("9Uuxa")})),pcaxis:av("pcaxis",(function(){return a("jUdnN")})),peoplecode:av("peoplecode",(function(){return a("l8w4e")})),perl:av("perl",(function(){return a("aX7dM")})),phpExtras:av("phpExtras",(function(){return a("3cMZl")})),php:av("php",(function(){return Promise.resolve(a("5li5P"))})),phpdoc:av("phpdoc",(function(){return a("bDyJN")})),plsql:av("plsql",(function(){return a("cPuMN")})),powerquery:av("powerquery",(function(){return a("jE1gU")})),powershell:av("powershell",(function(){return a("k7t0j")})),processing:av("processing",(function(){return a("jr8hV")})),prolog:av("prolog",(function(){return a("hpuat")})),promql:av("promql",(function(){return a("ckXC5")})),properties:av("properties",(function(){return a("fAh6P")})),protobuf:av("protobuf",(function(){return a("R6WqB")})),psl:av("psl",(function(){return a("Al65w")})),pug:av("pug",(function(){return a("dxbNS")})),puppet:av("puppet",(function(){return a("lrSuh")})),pure:av("pure",(function(){return a("6DKQK")})),purebasic:av("purebasic",(function(){return a("7ZkSb")})),purescript:av("purescript",(function(){return a("dBTYx")})),python:av("python",(function(){return Promise.resolve(a("kiy5M"))})),q:av("q",(function(){return a("4FXyy")})),qml:av("qml",(function(){return a("2zZFj")})),qore:av("qore",(function(){return a("iCK1Y")})),qsharp:av("qsharp",(function(){return a("dvH9H")})),r:av("r",(function(){return a("lQqRt")})),racket:av("racket",(function(){return a("eHKmq")})),reason:av("reason",(function(){return a("kkeLT")})),regex:av("regex",(function(){return a("llX50")})),rego:av("rego",(function(){return a("9hKdZ")})),renpy:av("renpy",(function(){return a("cJgw5")})),rest:av("rest",(function(){return a("867DK")})),rip:av("rip",(function(){return a("3Odjx")})),roboconf:av("roboconf",(function(){return a("gQ0Us")})),robotframework:av("robotframework",(function(){return a("bLCgx")})),ruby:av("ruby",(function(){return Promise.resolve(a("ch1PX"))})),rust:av("rust",(function(){return a("cInT8")})),sas:av("sas",(function(){return a("iz7eP")})),sass:av("sass",(function(){return a("hrDC3")})),scala:av("scala",(function(){return a("ub8Bf")})),scheme:av("scheme",(function(){return a("7NAAt")})),scss:av("scss",(function(){return Promise.resolve(a("fU6a0"))})),shellSession:av("shellSession",(function(){return a("7kKCv")})),smali:av("smali",(function(){return a("2lkCb")})),smalltalk:av("smalltalk",(function(){return a("4280y")})),smarty:av("smarty",(function(){return a("4hXYK")})),sml:av("sml",(function(){return a("jh2E8")})),solidity:av("solidity",(function(){return a("dTdF2")})),solutionFile:av("solutionFile",(function(){return a("iI5tm")})),soy:av("soy",(function(){return a("aoU5C")})),sparql:av("sparql",(function(){return a("ggrvb")})),splunkSpl:av("splunkSpl",(function(){return a("8LhCX")})),sqf:av("sqf",(function(){return a("3tDsu")})),sql:av("sql",(function(){return Promise.resolve(a("bnDV9"))})),squirrel:av("squirrel",(function(){return a("bxaUV")})),stan:av("stan",(function(){return a("dBqrq")})),stylus:av("stylus",(function(){return a("JlHVK")})),swift:av("swift",(function(){return a("c7NBs")})),systemd:av("systemd",(function(){return a("jprZl")})),t4Cs:av("t4Cs",(function(){return a("edsMI")})),t4Templating:av("t4Templating",(function(){return a("bS9Wa")})),t4Vb:av("t4Vb",(function(){return a("gYk20")})),tap:av("tap",(function(){return a("byv7d")})),tcl:av("tcl",(function(){return a("lUAIZ")})),textile:av("textile",(function(){return a("7J2LO")})),toml:av("toml",(function(){return a("eXtdM")})),tremor:av("tremor",(function(){return a("vyajH")})),tsx:av("tsx",(function(){return Promise.resolve(a("7cTnl"))})),tt2:av("tt2",(function(){return a("8XOOm")})),turtle:av("turtle",(function(){return a("1XvLQ")})),twig:av("twig",(function(){return a("i9Fpp")})),typescript:av("typescript",(function(){return Promise.resolve(a("fzL8k"))})),typoscript:av("typoscript",(function(){return a("kKk69")})),unrealscript:av("unrealscript",(function(){return a("jgq8Y")})),uorazor:av("uorazor",(function(){return a("dsZ00")})),uri:av("uri",(function(){return a("fqJRp")})),v:av("v",(function(){return a("bgfyB")})),vala:av("vala",(function(){return a("68x4q")})),vbnet:av("vbnet",(function(){return a("eUhQs")})),velocity:av("velocity",(function(){return a("fPNdV")})),verilog:av("verilog",(function(){return a("2fM1V")})),vhdl:av("vhdl",(function(){return a("hNF6q")})),vim:av("vim",(function(){return a("75TCr")})),visualBasic:av("visualBasic",(function(){return a("fc93z")})),warpscript:av("warpscript",(function(){return a("jgHlG")})),wasm:av("wasm",(function(){return a("dVZkI")})),webIdl:av("webIdl",(function(){return a("9Jnxv")})),wiki:av("wiki",(function(){return a("1Gimo")})),wolfram:av("wolfram",(function(){return a("4SyRT")})),wren:av("wren",(function(){return a("gaIVs")})),xeora:av("xeora",(function(){return a("lagad")})),xmlDoc:av("xmlDoc",(function(){return a("9DNYE")})),xojo:av("xojo",(function(){return a("ksF4f")})),xquery:av("xquery",(function(){return a("gXxHJ")})),yaml:av("yaml",(function(){return a("6rk3j")})),yang:av("yang",(function(){return a("kTyrQ")})),zig:av("zig",(function(){return a("d3mFC")}))},lv=(ev=(Zg={loader:function(){return a("bB2YF").then((function(e){return e.default||e}))},isLanguageRegistered:function(e,t){return e.registered(t)},languageLoaders:sv,registerLanguage:function(e,t,n){return e.register(n)}}).loader,tv=Zg.isLanguageRegistered,nv=Zg.registerLanguage,rv=Zg.languageLoaders,ov=Zg.noAsyncLoadingLanguages,iv=function(e){r(hg)(o,e);var t,n=Yg(o);function o(){return r(ag)(this,o),n.apply(this,arguments)}return r(sg)(o,[{key:"componentDidUpdate",value:function(){!o.isRegistered(this.props.language)&&rv&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var e=this;o.astGeneratorPromise||o.loadAstGenerator(),o.astGenerator||o.astGeneratorPromise.then((function(){e.forceUpdate()})),!o.isRegistered(this.props.language)&&rv&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var e=this,t=this.props.language;"text"!==t&&o.loadLanguage(t).then((function(){return e.forceUpdate()})).catch((function(){}))}},{key:"normalizeLanguage",value:function(e){return o.isSupportedLanguage(e)?e:"text"}},{key:"render",value:function(){return r(u).createElement(o.highlightInstance,r(og)({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:o.astGenerator}))}}],[{key:"preload",value:function(){return o.loadAstGenerator()}},{key:"loadLanguage",value:(t=r(ng)(r(Sg).mark((function e(t){var n;return r(Sg).wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(n=rv[t])){e.next=5;break}return e.abrupt("return",n(o.registerLanguage));case 5:throw new Error("Language ".concat(t," not supported"));case 6:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"isSupportedLanguage",value:function(e){return o.isRegistered(e)||"function"==typeof rv[e]}},{key:"loadAstGenerator",value:function(){return o.astGeneratorPromise=ev().then((function(e){o.astGenerator=e,nv&&o.languages.forEach((function(t,n){return nv(e,n,t)}))})),o.astGeneratorPromise}}]),o}(r(u).PureComponent),r(xg)(iv,"astGenerator",null),r(xg)(iv,"highlightInstance",Qg(null,{})),r(xg)(iv,"astGeneratorPromise",null),r(xg)(iv,"languages",new Map),r(xg)(iv,"supportedLanguages",Zg.supportedLanguages||Object.keys(rv||{})),r(xg)(iv,"isRegistered",(function(e){if(ov)return!0;if(!nv)throw new Error("Current syntax highlighter doesn't support registration of languages");return iv.astGenerator?tv(iv.astGenerator,e):iv.languages.has(e)})),r(xg)(iv,"registerLanguage",(function(e,t){if(!nv)throw new Error("Current syntax highlighter doesn't support registration of languages");if(iv.astGenerator)return nv(iv.astGenerator,e,t);iv.languages.set(e,t)})),iv),cv={},uv={};(uv=function(e){return e&&e.__esModule?e:{default:e}}).__esModule=!0,uv.default=uv,Object.defineProperty(cv,"__esModule",{value:!0}),Object.defineProperty(cv,"a11yDark",{enumerable:!0,get:function(){return yv.default}}),Object.defineProperty(cv,"atomDark",{enumerable:!0,get:function(){return wv.default}}),Object.defineProperty(cv,"base16AteliersulphurpoolLight",{enumerable:!0,get:function(){return xv.default}}),Object.defineProperty(cv,"cb",{enumerable:!0,get:function(){return Sv.default}}),Object.defineProperty(cv,"coldarkCold",{enumerable:!0,get:function(){return Mv.default}}),Object.defineProperty(cv,"coldarkDark",{enumerable:!0,get:function(){return _v.default}}),Object.defineProperty(cv,"coy",{enumerable:!0,get:function(){return dv.default}}),Object.defineProperty(cv,"coyWithoutShadows",{enumerable:!0,get:function(){return Ev.default}}),Object.defineProperty(cv,"darcula",{enumerable:!0,get:function(){return Av.default}}),Object.defineProperty(cv,"dark",{enumerable:!0,get:function(){return fv.default}}),Object.defineProperty(cv,"dracula",{enumerable:!0,get:function(){return Cv.default}}),Object.defineProperty(cv,"duotoneDark",{enumerable:!0,get:function(){return kv.default}}),Object.defineProperty(cv,"duotoneEarth",{enumerable:!0,get:function(){return Tv.default}}),Object.defineProperty(cv,"duotoneForest",{enumerable:!0,get:function(){return Iv.default}}),Object.defineProperty(cv,"duotoneLight",{enumerable:!0,get:function(){return Ov.default}}),Object.defineProperty(cv,"duotoneSea",{enumerable:!0,get:function(){return Rv.default}}),Object.defineProperty(cv,"duotoneSpace",{enumerable:!0,get:function(){return Pv.default}}),Object.defineProperty(cv,"funky",{enumerable:!0,get:function(){return hv.default}}),Object.defineProperty(cv,"ghcolors",{enumerable:!0,get:function(){return Nv.default}}),Object.defineProperty(cv,"gruvboxDark",{enumerable:!0,get:function(){return Lv.default}}),Object.defineProperty(cv,"gruvboxLight",{enumerable:!0,get:function(){return Bv.default}}),Object.defineProperty(cv,"holiTheme",{enumerable:!0,get:function(){return Dv.default}}),Object.defineProperty(cv,"hopscotch",{enumerable:!0,get:function(){return jv.default}}),Object.defineProperty(cv,"lucario",{enumerable:!0,get:function(){return Fv.default}}),Object.defineProperty(cv,"materialDark",{enumerable:!0,get:function(){return zv.default}}),Object.defineProperty(cv,"materialLight",{enumerable:!0,get:function(){return Uv.default}}),Object.defineProperty(cv,"materialOceanic",{enumerable:!0,get:function(){return Hv.default}}),Object.defineProperty(cv,"nightOwl",{enumerable:!0,get:function(){return Gv.default}}),Object.defineProperty(cv,"nord",{enumerable:!0,get:function(){return Wv.default}}),Object.defineProperty(cv,"okaidia",{enumerable:!0,get:function(){return pv.default}}),Object.defineProperty(cv,"oneDark",{enumerable:!0,get:function(){return Vv.default}}),Object.defineProperty(cv,"oneLight",{enumerable:!0,get:function(){return qv.default}}),Object.defineProperty(cv,"pojoaque",{enumerable:!0,get:function(){return Kv.default}}),Object.defineProperty(cv,"prism",{enumerable:!0,get:function(){return bv.default}}),Object.defineProperty(cv,"shadesOfPurple",{enumerable:!0,get:function(){return $v.default}}),Object.defineProperty(cv,"solarizedDarkAtom",{enumerable:!0,get:function(){return Jv.default}}),Object.defineProperty(cv,"solarizedlight",{enumerable:!0,get:function(){return mv.default}}),Object.defineProperty(cv,"synthwave84",{enumerable:!0,get:function(){return Xv.default}}),Object.defineProperty(cv,"tomorrow",{enumerable:!0,get:function(){return gv.default}}),Object.defineProperty(cv,"twilight",{enumerable:!0,get:function(){return vv.default}}),Object.defineProperty(cv,"vs",{enumerable:!0,get:function(){return Qv.default}}),Object.defineProperty(cv,"vscDarkPlus",{enumerable:!0,get:function(){return Yv.default}}),Object.defineProperty(cv,"xonokai",{enumerable:!0,get:function(){return Zv.default}}),Object.defineProperty(cv,"zTouch",{enumerable:!0,get:function(){return eb.default}});var dv=uv(a("jcF8U")),fv=uv(a("3Tppx")),hv=uv(a("dBuK7")),pv=uv(a("eEjWK")),mv=uv(a("awG2g")),gv=uv(a("2oFzQ")),vv=uv(a("4Au6Q")),bv=uv(a("dAPqs")),yv=uv(a("8eAql")),wv=uv(a("cv2QE")),xv=uv(a("h5I9g")),Sv=uv(a("i4C5w")),Mv=uv(a("3kFKo")),_v=uv(a("17zK0")),Ev=uv(a("5Avqr")),Av=uv(a("1jHMv")),Cv=uv(a("7Q8CE")),kv=uv(a("jKUos")),Tv=uv(a("Uzm4J")),Iv=uv(a("7yfkN")),Ov=uv(a("lT2l1")),Rv=uv(a("fZ9um")),Pv=uv(a("1MoQL")),Nv=uv(a("4uys7")),Lv=uv(a("kaYsk")),Bv=uv(a("kN6Vu")),Dv=uv(a("2Z6pG")),jv=uv(a("4jQJK")),Fv=uv(a("bpXw0")),zv=uv(a("i4S8s")),Uv=uv(a("5bNr4")),Hv=uv(a("5ZYWT")),Gv=uv(a("ihJCU")),Wv=uv(a("8iIbg")),Vv=uv(a("424u7")),qv=uv(a("jPiNI")),Kv=uv(a("OHVOA")),$v=uv(a("2OKTL")),Jv=uv(a("2Mg8H")),Xv=uv(a("9Kud0")),Qv=uv(a("eCrmR")),Yv=uv(a("8UhcQ")),Zv=uv(a("dtU9z")),eb=uv(a("4xtLO")),tb={};Object.defineProperty(tb,"__esModule",{value:!0}),tb.default=void 0;var nb=uv(a("7cTnl")).default;tb.default=nb;var rb={};Object.defineProperty(rb,"__esModule",{value:!0}),rb.default=void 0;var ob=uv(a("l1Rj1")).default;rb.default=ob;var ib={};Object.defineProperty(ib,"__esModule",{value:!0}),ib.default=void 0;var ab=uv(a("fU6a0")).default;ib.default=ab;var sb={};Object.defineProperty(sb,"__esModule",{value:!0}),sb.default=void 0;var lb=uv(a("3aDLI")).default;sb.default=lb;var cb={};Object.defineProperty(cb,"__esModule",{value:!0}),cb.default=void 0;var ub=uv(a("kiy5M")).default;cb.default=ub;var db={};Object.defineProperty(db,"__esModule",{value:!0}),db.default=void 0;var fb=uv(a("lR39A")).default;db.default=fb;var hb={};Object.defineProperty(hb,"__esModule",{value:!0}),hb.default=void 0;var pb=uv(a("5li5P")).default;hb.default=pb;var mb={};Object.defineProperty(mb,"__esModule",{value:!0}),mb.default=void 0;var gb=uv(a("ch1PX")).default;mb.default=gb;var vb={};Object.defineProperty(vb,"__esModule",{value:!0}),vb.default=void 0;var bb=uv(a("bnDV9")).default;vb.default=bb,lv.registerLanguage("tsx",r(tb)),lv.registerLanguage("json",r(rb)),lv.registerLanguage("scss",r(ib)),lv.registerLanguage("bash",r(sb)),lv.registerLanguage("python",r(cb)),lv.registerLanguage("cpp",r(db)),lv.registerLanguage("php",r(hb)),lv.registerLanguage("ruby",r(mb)),lv.registerLanguage("sql",r(vb));var yb=({medium:e,className:t,preview:n=!1})=>{var o,i,a,s;const{t:l}=ea();return r(u).createElement("div",{className:"memori-snippet"},r(u).createElement("div",{className:"memori-snippet--content"},r(u).createElement(lv,{"aria-labelledby":`#snippet-${e.mediumID}`,className:t,style:cv.atomDark,showLineNumbers:!0,language:null!==(i=null===(o=Zm.find((t=>e.mimeType===t.mimeType)))||void 0===o?void 0:o.lang)&&void 0!==i?i:"text"},(null===(a=e.content)||void 0===a?void 0:a.length)&&e.content.length>200&&n?`${e.content.slice(0,200)}\n...`:`${e.content}`),r(u).createElement(Zd,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:l("copy")||"Copy",icon:r(u).createElement(tg,null),onClick:()=>{var t;return navigator.clipboard.writeText(null!==(t=e.content)&&void 0!==t?t:"")}})),!!(null===(s=e.title)||void 0===s?void 0:s.length)&&r(u).createElement("p",{id:`snippet-${e.mediumID}`,className:"memori-snippet--caption"},e.title))};u=a("85Hg2");var wb=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"}));u=a("85Hg2");var xb=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"}));u=a("85Hg2");var Sb=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"}));u=a("85Hg2");var Mb=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"}));const _b=({item:e,sessionID:t,tenantID:n,preview:o=!1,baseURL:i})=>{switch(e.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:r(u).createElement("picture",{className:"memori-media-item--figure"},!o&&r(u).createElement("source",{srcSet:[Fm({resourceURI:e.url,sessionID:t,tenantID:n,baseURL:i}),Fm({resourceURI:e.content,sessionID:t,tenantID:n,baseURL:i}),e.url,e.content].join(", "),type:e.mimeType}),r(u).createElement("img",{alt:e.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),e.title&&r(u).createElement("figcaption",{className:"memori-media-item--figure-caption"},e.title))}));case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,cover:r(u).createElement(Mb,{className:"memori-media-item--icon"}),title:e.title}));case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,cover:r(u).createElement(Sb,{className:"memori-media-item--icon"}),title:e.title}));case"application/pdf":return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,cover:r(u).createElement(xb,{className:"memori-media-item--icon"}),title:e.title}));case"video/mp4":case"video/avi":case"video/mpeg":return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,cover:r(u).createElement("video",{style:{width:"100%",height:"100%"},controls:!0,src:e.url,title:e.title}),title:e.title}));case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,cover:r(u).createElement("audio",{style:{width:"100%",height:"100%"},controls:!0,src:e.url}),title:e.title}));case"model/gltf-binary":return r(u).createElement(eg,{src:e.url,alt:"",poster:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="});default:return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,cover:r(u).createElement(wb,{className:"memori-media-item--icon"}),title:e.title}))}};var Eb=({items:e,sessionID:t,tenantID:n,translateTo:o,baseURL:i})=>{const[a,s]=(0,u.useState)(e),l=(0,u.useCallback)((async()=>{if(!o)return;const t=await Promise.all((null!=e?e:[]).map((async e=>{var t;if(!e.title)return e;try{const n=await Jm(e.title,o);return{...e,title:null!==(t=n.text)&&void 0!==t?t:e.title}}catch(t){return console.error(t),e}})));s(t)}),[o,e]);return(0,u.useEffect)((()=>{o&&l()}),[o,l]),(0,u.useEffect)((()=>{e.filter((e=>{var t;return"text/javascript"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).forEach((e=>{var t;try{new Function(null!==(t=e.content)&&void 0!==t?t:"")()}catch(e){console.error(e)}}))}),[]),r(u).createElement(dp,{appear:!0,show:!0,as:"div",className:"memori-media-items"},r(u).createElement("div",{className:"memori-media-items--grid"},a.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&!Zm.map((e=>e.mimeType)).includes(e.mimeType)})).sort(((e,t)=>e.creationTimestamp>t.creationTimestamp?1:e.creationTimestamp<t.creationTimestamp?-1:0)).map(((e,o)=>r(u).createElement(dp.Child,{as:"div",className:"memori-media-item",key:e.url+"&index="+o,enter:"ease-out duration-500 delay-"+100*o,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95"},r(u).createElement(_b,{sessionID:t,tenantID:n,baseURL:i,item:{...e,title:e.title,url:e.url,content:e.content}}))))),a.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&Zm.map((e=>e.mimeType)).includes(e.mimeType)})).map((e=>r(u).createElement(dp.Child,{as:"div",className:"memori-media-item--snippet",key:e.mediumID,enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0"},r(u).createElement(yb,{key:e.mediumID,medium:e})))),a.filter((e=>{var t;return"text/css"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).map((e=>r(u).createElement("style",{key:e.mediumID,dangerouslySetInnerHTML:{__html:e.content||""}}))))};Xd=a("4IUwl");var Ab=({hints:e=[],links:t=[],media:n=[],simulateUserPrompt:o=(()=>{}),sessionID:i,baseUrl:a,translateTo:s})=>{const[l,c]=(0,u.useState)(!0);return(0,u.useEffect)((()=>{c(!0)}),[e]),r(u).createElement("div",{className:"memori-media-widget"},(null==n?void 0:n.length)>0&&r(u).createElement(Eb,{items:n,sessionID:i,translateTo:s,baseURL:a}),(null==t?void 0:t.length)>0&&r(u).createElement(Km,{items:t,baseUrl:a}),(null==e?void 0:e.length)>0&&l&&r(u).createElement(dp,{appear:!0,show:!0,as:"ul",className:"memori-media--hints"},e.map(((e,t)=>r(u).createElement(dp.Child,{as:"li",key:e.text+t,enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0"},r(u).createElement(Zd,{key:e.text+t,className:r(Xd)("memori-media--hint"),primary:!0,onClick:()=>{o(e.originalText,e.text),c(!1)},onTouchEnd:()=>{o(e.originalText,e.text),c(!1)}},e.text))))))};u=a("85Hg2"),u=a("85Hg2"),u=a("85Hg2");var Cb=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Cb||{});function kb(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=null!=r?r:-1,i=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==o&&r.length-n-1>=o)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=o)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===i?r:i}u=a("85Hg2");function Tb({container:e,accept:t,walk:n,enabled:r=!0}){let o=(0,u.useRef)(t),i=(0,u.useRef)(n);(0,u.useEffect)((()=>{o.current=t,i.current=n}),[t,n]),hf((()=>{if(!e||!r)return;let t=Rf(e);if(!t)return;let n=o.current,a=i.current,s=Object.assign((e=>n(e)),{acceptNode:n}),l=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,s,!1);for(;l.nextNode();)a(l.currentNode)}),[e,r,o,i])}u=a("85Hg2");function Ib(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function Ob(e,t){let[n,r]=(0,u.useState)((()=>Ib(e)));return hf((()=>{r(Ib(e))}),[e.type,e.as]),hf((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")}),[n,t]),n}var Rb=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Rb||{}),Pb=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Pb||{}),Nb=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(Nb||{});function Lb(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=Vf(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),o=n?r.indexOf(n):null;return-1===o&&(o=null),{items:r,activeItemIndex:o}}let Bb={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=Lb(e),o=kb(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:o,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),i=o?e.items.indexOf(o):-1;return-1===i||i===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:i,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=Lb(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=Lb(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},Db=(0,u.createContext)(null);function jb(e){let t=(0,u.useContext)(Db);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,jb),t}return t}function Fb(e,t){return ef(t.type,Bb,e,t)}Db.displayName="MenuContext";let zb=u.Fragment,Ub=cf((function(e,t){let n=(0,u.useReducer)(Fb,{menuState:1,buttonRef:(0,u.createRef)(),itemsRef:(0,u.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:o,itemsRef:i,buttonRef:a},s]=n,l=bf(t);Th([a,i],((e,t)=>{var n;s({type:1}),Uf(t,zf.Loose)||(e.preventDefault(),null==(n=a.current)||n.focus())}),0===o);let c=mf((()=>{s({type:1})})),d=(0,u.useMemo)((()=>({open:0===o,close:c})),[o,c]),f=e,h={ref:l};return r(u).createElement(Db.Provider,{value:n},r(u).createElement(_h,{value:ef(o,{0:Sh.Open,1:Sh.Closed})},af({ourProps:h,theirProps:f,slot:d,defaultTag:zb,name:"Menu"})))})),Hb=cf((function(e,t){var n;let[r,o]=jb("Menu.Button"),i=bf(r.buttonRef,t),a=`headlessui-menu-button-${Cf()}`,s=Jh(),l=mf((e=>{switch(e.key){case wf.Space:case wf.Enter:case wf.ArrowDown:e.preventDefault(),e.stopPropagation(),o({type:0}),s.nextFrame((()=>o({type:2,focus:Cb.First})));break;case wf.ArrowUp:e.preventDefault(),e.stopPropagation(),o({type:0}),s.nextFrame((()=>o({type:2,focus:Cb.Last})))}})),c=mf((e=>{if(e.key===wf.Space)e.preventDefault()})),d=mf((t=>{if(xf(t.currentTarget))return t.preventDefault();e.disabled||(0===r.menuState?(o({type:1}),s.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),o({type:0})))})),f=(0,u.useMemo)((()=>({open:0===r.menuState})),[r]),h=e;return af({ourProps:{ref:i,id:a,type:Ob(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===r.menuState,onKeyDown:l,onKeyUp:c,onClick:d},theirProps:h,slot:f,defaultTag:"button",name:"Menu.Button"})})),Gb=rf.RenderStrategy|rf.Static,Wb=cf((function(e,t){var n,r;let[o,i]=jb("Menu.Items"),a=bf(o.itemsRef,t),s=Yf(o.itemsRef),l=`headlessui-menu-items-${Cf()}`,c=Jh(),d=Mh(),f=null!==d?d===Sh.Open:0===o.menuState;(0,u.useEffect)((()=>{let e=o.itemsRef.current;!e||0===o.menuState&&e!==(null==s?void 0:s.activeElement)&&e.focus({preventScroll:!0})}),[o.menuState,o.itemsRef,s]),Tb({container:o.itemsRef.current,enabled:0===o.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let h=mf((e=>{var t,n;switch(c.dispose(),e.key){case wf.Space:if(""!==o.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:3,value:e.key});case wf.Enter:if(e.preventDefault(),e.stopPropagation(),i({type:1}),null!==o.activeItemIndex){let{dataRef:e}=o.items[o.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}Hf(o.buttonRef.current);break;case wf.ArrowDown:return e.preventDefault(),e.stopPropagation(),i({type:2,focus:Cb.Next});case wf.ArrowUp:return e.preventDefault(),e.stopPropagation(),i({type:2,focus:Cb.Previous});case wf.Home:case wf.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:2,focus:Cb.First});case wf.End:case wf.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:2,focus:Cb.Last});case wf.Escape:e.preventDefault(),e.stopPropagation(),i({type:1}),Of().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case wf.Tab:e.preventDefault(),e.stopPropagation(),i({type:1}),Of().nextFrame((()=>{qf(o.buttonRef.current,e.shiftKey?Bf.Previous:Bf.Next)}));break;default:1===e.key.length&&(i({type:3,value:e.key}),c.setTimeout((()=>i({type:4})),350))}})),p=mf((e=>{if(e.key===wf.Space)e.preventDefault()})),m=(0,u.useMemo)((()=>({open:0===o.menuState})),[o]),g=e;return af({ourProps:{"aria-activedescendant":null===o.activeItemIndex||null==(n=o.items[o.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(r=o.buttonRef.current)?void 0:r.id,id:l,onKeyDown:h,onKeyUp:p,role:"menu",tabIndex:0,ref:a},theirProps:g,slot:m,defaultTag:"div",features:Gb,visible:f,name:"Menu.Items"})})),Vb=u.Fragment,qb=cf((function(e,t){let{disabled:n=!1,...r}=e,[o,i]=jb("Menu.Item"),a=`headlessui-menu-item-${Cf()}`,s=null!==o.activeItemIndex&&o.items[o.activeItemIndex].id===a,l=(0,u.useRef)(null),c=bf(t,l);hf((()=>{if(0!==o.menuState||!s||0===o.activationTrigger)return;let e=Of();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=l.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[l,s,o.menuState,o.activationTrigger,o.activeItemIndex]);let d=(0,u.useRef)({disabled:n,domRef:l});hf((()=>{d.current.disabled=n}),[d,n]),hf((()=>{var e,t;d.current.textValue=null==(t=null==(e=l.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,l]),hf((()=>(i({type:5,id:a,dataRef:d}),()=>i({type:6,id:a}))),[d,a]);let f=mf((()=>{i({type:1})})),h=mf((e=>{if(n)return e.preventDefault();i({type:1}),Hf(o.buttonRef.current)})),p=mf((()=>{if(n)return i({type:2,focus:Cb.Nothing});i({type:2,focus:Cb.Specific,id:a})})),m=mf((()=>{n||s||i({type:2,focus:Cb.Specific,id:a,trigger:0})})),g=mf((()=>{n||!s||i({type:2,focus:Cb.Nothing})})),v=(0,u.useMemo)((()=>({active:s,disabled:n,close:f})),[s,n,f]);return af({ourProps:{id:a,ref:c,role:"menuitem",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,disabled:void 0,onClick:h,onFocus:p,onPointerMove:m,onMouseMove:m,onPointerLeave:g,onMouseLeave:g},theirProps:r,slot:v,defaultTag:Vb,name:"Menu.Item"})})),Kb=Object.assign(Ub,{Button:Hb,Items:Wb,Item:qb});Xd=a("4IUwl"),u=a("85Hg2");var $b=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 1 0 0-176 88 88 0 0 0 0 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}));u=a("85Hg2");var Jb=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0 0 12.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0 0 12.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 0 0 174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}));var Xb=({attachmentsMenuOpen:e,setAttachmentsMenuOpen:t,disabled:n=!1,authToken:o})=>r(u).createElement(Kb,{as:"div",className:"memori-upload-menu"},r(u).createElement(Kb.Button,{disabled:n,className:r(Xd)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button")},r(u).createElement("div",{className:"memori-button--icon"},r(u).createElement(Jb,null))),r(u).createElement(Kb.Items,{as:"ul",className:"memori-menu--overlay"},r(u).createElement(Kb.Item,{as:"li",className:"memori-menu--li"},r(u).createElement(Zd,{className:"memori-menu--button",ghost:!0,icon:r(u).createElement(Gm,null),outlined:"link"===e,onClick:()=>t("link")},"Link")),!!(null==o?void 0:o.length)&&r(u).createElement(Kb.Item,null,r(u).createElement(Zd,{className:"memori-menu--button",ghost:!0,icon:r(u).createElement($b,null),outlined:"media"===e,onClick:()=>t("media")},"Media"))));u=a("85Hg2"),u=a("85Hg2"),u=a("85Hg2");function Qb(e=0){let[t,n]=(0,u.useState)(e),r=(0,u.useCallback)((e=>n((t=>t|e))),[t]),o=(0,u.useCallback)((e=>Boolean(t&e)),[t]),i=(0,u.useCallback)((e=>n((t=>t&~e))),[n]),a=(0,u.useCallback)((e=>n((t=>t^e))),[n]);return{addFlag:r,hasFlag:o,removeFlag:i,toggleFlag:a}}let Yb=(0,(u=a("85Hg2")).createContext)(null);function Zb(){let e=(0,u.useContext)(Yb);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Zb),e}return e}function ey(){let[e,t]=(0,u.useState)([]);return[e.length>0?e.join(" "):void 0,(0,u.useMemo)((()=>function(e){let n=mf((e=>(t((t=>[...t,e])),()=>t((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),o=(0,u.useMemo)((()=>({register:n,slot:e.slot,name:e.name,props:e.props})),[n,e.slot,e.name,e.props]);return r(u).createElement(Yb.Provider,{value:o},e.children)}),[t])]}let ty=cf((function(e,t){let{passive:n=!1,...r}=e,o=Zb(),i=`headlessui-label-${Cf()}`,a=bf(t);hf((()=>o.register(i)),[i,o.register]);let s={ref:a,...o.props,id:i};return n&&("onClick"in s&&delete s.onClick,"onClick"in r&&delete r.onClick),af({ourProps:s,theirProps:r,slot:o.slot||{},defaultTag:"label",name:o.name||"Label"})}));function ny(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))oy(n,ry(t,r),o);return n}function ry(e,t){return e?e+"["+t+"]":t}function oy(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())oy(e,ry(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):ny(n,t,e)}function iy(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n)for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type)return void e.click()}u=a("85Hg2");function ay(e,t,n){let[r,o]=(0,u.useState)(n),i=void 0!==e,a=(0,u.useRef)(i),s=(0,u.useRef)(!1),l=(0,u.useRef)(!1);return!i||a.current||s.current?!i&&a.current&&!l.current&&(l.current=!0,a.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(s.current=!0,a.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[i?e:r,mf((e=>(i||o(e),null==t?void 0:t(e))))]}var sy,ly=((sy=ly||{})[sy.RegisterOption=0]="RegisterOption",sy[sy.UnregisterOption=1]="UnregisterOption",sy);let cy={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Vf(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},uy=(0,u.createContext)(null);function dy(e){let t=(0,u.useContext)(uy);if(null===t){let t=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,dy),t}return t}function fy(e,t){return ef(t.type,cy,e,t)}uy.displayName="RadioGroupContext";let hy=cf((function(e,t){let{value:n,defaultValue:o,name:i,onChange:a,by:s=((e,t)=>e===t),disabled:l=!1,...c}=e,d=mf("string"==typeof s?(e,t)=>{let n=s;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:s),[f,h]=(0,u.useReducer)(fy,{options:[]}),p=f.options,[m,g]=ey(),[v,b]=yh(),y=`headlessui-radiogroup-${Cf()}`,w=(0,u.useRef)(null),x=bf(w,t),[S,M]=ay(n,a,o),_=(0,u.useMemo)((()=>p.find((e=>!e.propsRef.current.disabled))),[p]),E=(0,u.useMemo)((()=>p.some((e=>d(e.propsRef.current.value,S)))),[p,S]),A=mf((e=>{var t;if(l||d(e,S))return!1;let n=null==(t=p.find((t=>d(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==M||M(e),!0)}));Tb({container:w.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let C=mf((e=>{let t=w.current;if(!t)return;let n=Rf(t),r=p.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case wf.Enter:iy(e.currentTarget);break;case wf.ArrowLeft:case wf.ArrowUp:if(e.preventDefault(),e.stopPropagation(),Kf(r,Bf.Previous|Bf.WrapAround)===Df.Success){let e=p.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&A(e.propsRef.current.value)}break;case wf.ArrowRight:case wf.ArrowDown:if(e.preventDefault(),e.stopPropagation(),Kf(r,Bf.Next|Bf.WrapAround)===Df.Success){let e=p.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&A(e.propsRef.current.value)}break;case wf.Space:{e.preventDefault(),e.stopPropagation();let t=p.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&A(t.propsRef.current.value)}}})),k=mf((e=>(h({type:0,...e}),()=>h({type:1,id:e.id})))),T=(0,u.useMemo)((()=>({registerOption:k,firstOption:_,containsCheckedOption:E,change:A,disabled:l,value:S,compare:d})),[k,_,E,A,l,S,d]),I={ref:x,id:y,role:"radiogroup","aria-labelledby":m,"aria-describedby":v,onKeyDown:C},O=(0,u.useMemo)((()=>({value:S})),[S]);return r(u).createElement(b,{name:"RadioGroup.Description"},r(u).createElement(g,{name:"RadioGroup.Label"},r(u).createElement(uy.Provider,{value:T},null!=i&&null!=S&&ny({[i]:S}).map((([e,t])=>r(u).createElement(Tf,{features:kf.Hidden,...uf({key:e,as:"input",type:"radio",checked:null!=t,hidden:!0,readOnly:!0,name:e,value:t})}))),af({ourProps:I,theirProps:c,slot:O,defaultTag:"div",name:"RadioGroup"}))))}));var py=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(py||{});let my=cf((function(e,t){let n=(0,u.useRef)(null),o=bf(n,t),i=`headlessui-radiogroup-option-${Cf()}`,[a,s]=ey(),[l,c]=yh(),{addFlag:d,removeFlag:f,hasFlag:h}=Qb(1),{value:p,disabled:m=!1,...g}=e,v=(0,u.useRef)({value:p,disabled:m});hf((()=>{v.current.value=p}),[p,v]),hf((()=>{v.current.disabled=m}),[m,v]);let{registerOption:b,disabled:y,change:w,firstOption:x,containsCheckedOption:S,value:M,compare:_}=dy("RadioGroup.Option");hf((()=>b({id:i,element:n,propsRef:v})),[i,b,n,e]);let E=mf((e=>{var t;if(xf(e.currentTarget))return e.preventDefault();!w(p)||(d(2),null==(t=n.current)||t.focus())})),A=mf((e=>{if(xf(e.currentTarget))return e.preventDefault();d(2)})),C=mf((()=>f(2))),k=(null==x?void 0:x.id)===i,T=y||m,I=_(M,p),O={ref:o,id:i,role:"radio","aria-checked":I?"true":"false","aria-labelledby":a,"aria-describedby":l,"aria-disabled":!!T||void 0,tabIndex:T?-1:I||!S&&k?0:-1,onClick:T?void 0:E,onFocus:T?void 0:A,onBlur:T?void 0:C},R=(0,u.useMemo)((()=>({checked:I,disabled:T,active:h(2)})),[I,T,h]);return r(u).createElement(c,{name:"RadioGroup.Description"},r(u).createElement(s,{name:"RadioGroup.Label"},af({ourProps:O,theirProps:g,slot:R,defaultTag:"div",name:"RadioGroup.Option"})))})),gy=Object.assign(hy,{Option:my,Label:ty,Description:wh});Xd=a("4IUwl");var vy=({sendOnEnter:e,setSendOnEnter:t})=>{const{t:n}=ea();return r(u).createElement(Kb,{as:"div",className:"memori-send-on-enter-menu"},r(u).createElement(Kb.Button,{className:r(Xd)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button")},r(u).createElement("div",{className:"memori-button--icon"},r(u).createElement("span",{style:{display:"block",width:"1rem",height:"1rem"}},"…"))),r(u).createElement(Kb.Items,{className:"memori-menu--overlay"},r(u).createElement(gy,{value:e,onChange:t},r(u).createElement(gy.Option,{value:"keypress",className:"memori-menu--option"},(({checked:e})=>r(u).createElement(Kb.Item,null,r(u).createElement(Zd,{className:"memori-menu--button",ghost:!0,outlined:e,icon:r(u).createElement("span",{className:"memori-menu--icon"},e?"✓":"")},n("widget.sendOnKeypress"))))),r(u).createElement(gy.Option,{value:"click",className:"memori-menu--option"},(({checked:e})=>r(u).createElement(Kb.Item,null,r(u).createElement(Zd,{className:"memori-menu--button",ghost:!0,outlined:e,icon:r(u).createElement("span",{className:"memori-menu--icon"},e?"✓":"")},n("widget.sendOnClick"))))))))};u=a("85Hg2"),Xd=a("4IUwl"),u=a("85Hg2");var by=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"}));u=a("85Hg2");var yy=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}));var wy=({disabled:e=!1,value:t,onChange:n,onPressEnter:o,onFocus:i,onBlur:a})=>{const[s,l]=(0,u.useState)(!1);return r(u).createElement("div",{"data-testid":"chat-textarea",className:r(Xd)("memori-chat-textarea",{"memori-chat-textarea--expanded":s,"memori-chat-textarea--disabled":e})},r(u).createElement("div",{className:"memori-chat-textarea--inner"},r(u).createElement("textarea",{className:"memori-chat-textarea--input",disabled:e,value:t,onChange:e=>{n(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&o&&o(e)},onFocus:i,onBlur:a}),r(u).createElement("div",{className:"memori-chat-textarea--expand"},r(u).createElement(Zd,{className:r(Xd)("memori-chat-textarea--expand-button"),onClick:()=>l(!s),padded:!1,ghost:!0,icon:s?r(u).createElement(yy,null):r(u).createElement(by,null)}))))};Xd=a("4IUwl"),u=a("85Hg2");var xy=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}));u=a("85Hg2");var Sy=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"}));var My=({dialogState:e,instruct:t=!1,sendOnEnter:n="click",setSendOnEnter:o,attachmentsMenuOpen:i,setAttachmentsMenuOpen:a,userMessage:s="",onChangeUserMessage:l,sendMessage:c,onTextareaFocus:d,onTextareaBlur:f,onTextareaPressEnter:h,showMicrophone:p=!1,listening:m=!1,isPlayingAudio:g=!1,stopAudio:v,startListening:b,stopListening:y,authToken:w})=>{const{t:x}=ea();return r(u).createElement("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===(null==e?void 0:e.state)||"X3"===(null==e?void 0:e.state)},(t||(null==e?void 0:e.acceptsMedia))&&r(u).createElement(Xb,{attachmentsMenuOpen:i,setAttachmentsMenuOpen:a,authToken:w,disabled:!(null==e?void 0:e.acceptsMedia)}),r(u).createElement(vy,{sendOnEnter:n,setSendOnEnter:o}),r(u).createElement(wy,{value:s,onChange:l,onPressEnter:h,onFocus:d,onBlur:f,disabled:["R2","R3","R4","G3","X3"].includes((null==e?void 0:e.state)||"")}),r(u).createElement(Zd,{shape:"circle",primary:!!(null==s?void 0:s.length),disabled:!s||0===s.length,className:"memori-chat-inputs--send",onClick:()=>c(s),title:x("send")||"Send",icon:r(u).createElement(xy,null)}),p&&r(u).createElement(Zd,{className:r(Xd)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":m}),title:m?x("write_and_speak.micButtonPopoverListening")||"Listening":x("write_and_speak.micButtonPopover")||"Start listening",disabled:g,onClick:e=>{console.log("mic button",m,e),m?y():(v(),b())},shape:"circle",icon:r(u).createElement(Sy,null)}))};var _y=({memori:e,tenant:t,sessionID:n,baseUrl:o,translateTo:i,memoriTyping:a,history:s=[],authToken:l,dialogState:c,simulateUserPrompt:d,showDates:f=!1,showContextPerLine:h=!1,selectReceiverTag:p,preview:m=!1,instruct:g=!1,showInputs:v=!0,showMicrophone:b=!1,sendOnEnter:y,setSendOnEnter:w,attachmentsMenuOpen:x,setAttachmentsMenuOpen:S,userMessage:M="",onChangeUserMessage:_,sendMessage:E,listening:A,isPlayingAudio:C,stopAudio:k,startListening:T,stopListening:I,resetTranscript:O})=>{var R,P,N,L,B;const D=()=>{setTimeout((()=>{var e,t,n,r,o;document.body.classList.contains("chat-focused")?(null===(e=document.querySelector(".ant-tabs-nav"))||void 0===e||e.scrollIntoView(),null===(t=document.querySelector(".memori-chat--content"))||void 0===t||t.scrollTo(0,null!==(r=null===(n=document.querySelector(".memori-chat--content"))||void 0===n?void 0:n.scrollHeight)&&void 0!==r?r:0)):null===(o=document.querySelector("#end-messages-ref"))||void 0===o||o.scrollIntoView({behavior:"smooth"})}),200)};(0,u.useEffect)((()=>{!m&&D()}),[s,m]);return r(u).createElement("div",{className:r(Xd)("memori-chat--wrapper",{"memori-chat-wrapper--translate":i}),id:"chat-wrapper",lang:null==i?void 0:i.toUpperCase(),"data-memori-lang":null!==(L=null===(N=null===(P=null===(R=e.culture)||void 0===R?void 0:R.split("-"))||void 0===P?void 0:P[0])||void 0===N?void 0:N.toUpperCase())&&void 0!==L?L:"EN"},r(u).createElement("div",{className:r(Xd)("memori-chat--history",{"memori-chat--history-touch":Dm()})},r(u).createElement("div",{className:r(Xd)("memori-chat--content",{"memori-chat--content-touch":Dm()})},r(u).createElement("div",{className:r(Xd)("memori-chat--cover"),style:{backgroundImage:`url("${Fm({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:o})}"), url("${Fm({type:"cover",tenantID:null==t?void 0:t.id,baseURL:o||"https://app.twincreator.com"})}")`}}),s.map(((a,s)=>{var l,c,p,m;return r(u).createElement(r(u).Fragment,{key:s},r(u).createElement(Um,{message:a,memori:e,tenant:t,baseUrl:o}),f&&!!a.timestamp&&r(u).createElement("small",{className:"memori-chat--timestamp "+(a.fromUser?"text-right":"text-left")},new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(a.timestamp.endsWith("Z")?a.timestamp:`${a.timestamp}Z`))),h&&!!Object.keys(null!==(l=a.contextVars)&&void 0!==l?l:{}).length&&r(u).createElement("div",{className:"memori-chat--context-vars"},Object.keys(null!==(c=a.contextVars)&&void 0!==c?c:{}).map((e=>{var t,n,o;return"-"===(null===(t=a.contextVars)||void 0===t?void 0:t[e])?r(u).createElement("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",key:e},r(u).createElement("span",{className:"memori-chat--context-tag-text"},e)):"✔️"===(null===(n=a.contextVars)||void 0===n?void 0:n[e])?r(u).createElement("div",{className:"memori-chat--context-tag",key:e},r(u).createElement("span",{className:"memori-chat--context-tag-text"},e)):r(u).createElement("div",{className:"memori-chat--context-tag",key:e},r(u).createElement("span",{className:"memori-chat--context-tag-text"},e,": ",null===(o=a.contextVars)||void 0===o?void 0:o[e]))}))),r(u).createElement(Ab,{simulateUserPrompt:d,media:null===(p=null==a?void 0:a.media)||void 0===p?void 0:p.filter((e=>"text/html"!==e.mimeType&&"text/plain"!==e.mimeType)),links:null===(m=null==a?void 0:a.media)||void 0===m?void 0:m.filter((e=>"text/html"===e.mimeType)),sessionID:n,baseUrl:o,translateTo:i}))})),a&&r(u).createElement("div",{className:"memori-chat--bubble"},r(u).createElement("div",{id:"wave"},r(u).createElement("span",{className:"dot"}),r(u).createElement("span",{className:"dot"}),r(u).createElement("span",{className:"dot"}))),(null==c?void 0:c.hints)&&c.hints.length>0&&r(u).createElement(Ab,{simulateUserPrompt:d,hints:c.translatedHints?c.translatedHints:c.hints.map((e=>({text:e,originalText:e})))}),r(u).createElement("div",{id:"end-messages-ref"}))),"X3"===(null==c?void 0:c.state)&&n&&r(u).createElement("div",{className:"memori-chat--known-tags"},Object.keys(null!==(B=c.knownTags)&&void 0!==B?B:{}).filter((t=>t!==e.giverTag)).map((e=>{var t;return r(u).createElement(Zd,{key:e,icon:r(u).createElement("span",{className:"memori-chat--known-tag-icon"},e),className:"memori-chat--known-tag",onClick:()=>p(e)},null===(t=c.knownTags)||void 0===t?void 0:t[e])}))),v&&r(u).createElement(My,{userMessage:M,onChangeUserMessage:_,dialogState:c,instruct:g,authToken:l,sendMessage:E,sendOnEnter:y,setSendOnEnter:w,attachmentsMenuOpen:x,setAttachmentsMenuOpen:S,onTextareaPressEnter:()=>{"keypress"===y&&(null==M?void 0:M.length)>0&&(I(),E(M),_(""),O())},onTextareaFocus:()=>{var e,t;I(),Dm()&&window.innerWidth<=768&&(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t||t.add("chat-focused"),setTimeout((()=>{D()}),300))},onTextareaBlur:()=>{var e,t,n;(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("chat-focused"))&&(null===(n=document.getElementById("chat-wrapper"))||void 0===n||n.classList.remove("chat-focused"),D())},startListening:T,stopListening:I,stopAudio:k,listening:A,isPlayingAudio:C,showMicrophone:b}))};u=a("85Hg2"),u=a("85Hg2"),Xd=a("4IUwl");var Ey=({content:e,className:t,alignLeft:n=!1,disabled:o=!1,visible:i=!1,children:a})=>r(u).createElement("div",{className:r(Xd)("memori-tooltip",t,{"memori-tooltip--align-left":n,"memori-tooltip--disabled":o,"memori-tooltip--visible":i})},r(u).createElement("div",{className:"memori-tooltip--content"},e),r(u).createElement("div",{className:"memori-tooltip--trigger"},a));u=a("85Hg2");var Ay=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),r(u).createElement("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"}));u=a("85Hg2"),u=a("85Hg2");var Cy=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}));var ky=({memoriName:e,blockedUntil:t,showGiverInfo:n=!1,showTitle:o=!1,marginLeft:i=!1})=>{const{t:a}=ea(),s=new Date(t);return s>new Date?r(u).createElement(Ey,{className:"blocked-memori-badge--tooltip",content:r(u).createElement(r(u).Fragment,null,!n&&a("memoriBlockedAnon",{name:e,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(s)}),n&&a("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(s)}),n&&` ${a("memoriBlockedReasonExceedChats")}`,n&&r(u).createElement("br",null),n&&`\n${a("memoriBlockedGiverHelper")}`)},r(u).createElement("div",{className:"blocked-memori-badge--wrapper"},r(u).createElement("div",{className:"blocked-memori-badge "+(i?" margin-left":"")},r(u).createElement(Cy,{className:"blocked-memori-badge--icon"})),o&&r(u).createElement("span",{className:"blocked-memori-badge--title"},a("memoriBlockedTitle")))):null};var Ty=({memori:e,tenant:t,gamificationLevel:n,language:o,userLang:i,setUserLang:a,baseUrl:s,position:l,openPositionDrawer:c,integrationConfig:d,instruct:f=!1,clickedStart:h,onClickStart:p,initializeTTS:m})=>{var g,v;const{t:b,i18n:y}=ea(),[w,x]=(0,u.useState)(e.description),[S,M]=(0,u.useState)(!0);return(0,u.useEffect)((()=>{var t,n,r,i,a,l;(null!==(n=null===(t=y.language)||void 0===t?void 0:t.toUpperCase())&&void 0!==n?n:"IT")!==(null!==(r=null==o?void 0:o.toUpperCase())&&void 0!==r?r:"IT")&&(null===(i=e.description)||void 0===i?void 0:i.length)&&Jm(e.description,null!==(l=null===(a=y.language)||void 0===a?void 0:a.toUpperCase())&&void 0!==l?l:"IT",o,s).then((e=>{x(e.text)})).catch(console.error)}),[y.language,o,e.description,s]),r(u).createElement("div",{className:"memori--start-panel"},r(u).createElement("div",{className:"memori--cover",style:{backgroundImage:`url("${Fm({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:s})}"), url("${Fm({type:"cover",tenantID:null==t?void 0:t.id,baseURL:s})}")`}},!!(null===(g=null==n?void 0:n.badge)||void 0===g?void 0:g.length)&&r(u).createElement("div",{className:"memori--gamification-badge"},r(u).createElement(Ey,{alignLeft:!0,content:`${b("gamification.level")} ${n.badge}, ${n.points} ${b("gamification.points")}`},r(u).createElement("span",{"aria-label":`${b("gamification.level")} ${n.badge}, ${n.points} ${b("gamification.points")}`},n.badge)))),r(u).createElement("picture",{className:"memori--avatar"},r(u).createElement("source",{src:null!==(v=e.avatarURL)&&void 0!==v?v:Fm({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:s})}),r(u).createElement("img",{alt:e.name,src:e.avatarURL&&e.avatarURL.length>0?Fm({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:s}):Fm({type:"avatar",tenantID:null==t?void 0:t.id,baseURL:s})})),r(u).createElement("h2",{className:"memori--title"},e.name),e.needsPosition&&!l&&r(u).createElement("div",{className:"memori--needsPosition"},r(u).createElement("p",null,b("write_and_speak.requirePosition")),r(u).createElement(Zd,{primary:!0,onClick:()=>c(),className:"memori--start-button"},b("widget.position"))),(e.needsPosition&&l||!e.needsPosition)&&r(u).createElement("div",{className:"memori--description"},r(u).createElement("p",null,r(u).createElement("span",{className:"memori--description-text"},w&&S?w:e.description),w!==e.description&&r(u).createElement(Zd,{ghost:!0,className:"memori--translation-toggle",icon:r(u).createElement(Ay,null),onClick:()=>{M((e=>!e))}},b(S?"showOriginalText":"showTranslatedText"))),(null==d?void 0:d.multilanguage)&&!f&&r(u).createElement("div",{className:"memori--language-chooser"},r(u).createElement("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref"},b("write_and_speak.iWantToTalkToIn",{name:e.name})),r(u).createElement("select",{id:"user-lang-pref",value:(null!=i?i:y.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{a(e.target.value)}},Xm.map((e=>r(u).createElement("option",{key:e.value,value:e.value,"aria-label":e.label},e.label))))),r(u).createElement(Zd,{primary:!0,disabled:!!e.blockedUntil&&!e.isGiver,loading:h,onClick:e=>{m&&m(),p&&p()},className:"memori--start-button"},b("write_and_speak."+(f?"instructButton":"tryMeButton"))),r(u).createElement("p",{className:"memori--start-description"},b(f?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")),!!e.blockedUntil&&r(u).createElement(ky,{memoriName:e.name,blockedUntil:e.blockedUntil,showGiverInfo:e.isGiver,showTitle:!0,marginLeft:!0})))},Iy=(u=a("85Hg2"),u=a("85Hg2"),u=a("85Hg2"),{}),Oy={};(Oy=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}).__esModule=!0,Oy.default=Oy,(Iy=function(e,t){if(null==e)return{};var n,r,o=Oy(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}).__esModule=!0,Iy.default=Iy;u=a("85Hg2");var Ry=["forwardedRef"];function Py(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ny(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Py(Object(n),!0).forEach((function(t){r(Si)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Py(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}class Ly extends u.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:r(u).createElement("div",{style:{background:"rgba(255, 255, 255, 0.4)",color:"#000",padding:"2rem",borderRadius:"10px"}},r(u).createElement("h2",null,this.props.t("error.generic")),r(u).createElement(Zd,{primary:!0,onClick:()=>this.setState({hasError:!1})},this.props.t("error.tryAgain")||"Try again")):this.props.children}}var By=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){function o(o){var i=o.forwardedRef,a=r(Iy)(o,Ry),s=ea(e,Ny(Ny({},a),{},{keyPrefix:t.keyPrefix})),l=r(gi)(s,3),c=l[0],d=l[1],f=l[2],h=Ny(Ny({},a),{},{t:c,i18n:d,tReady:f});return t.withRef&&i?h.ref=i:!t.withRef&&i&&(h.forwardedRef=i),(0,u.createElement)(n,h)}o.displayName="withI18nextTranslation(".concat(Xi(n),")"),o.WrappedComponent=n;return t.withRef?(0,u.forwardRef)((function(e,t){return(0,u.createElement)(o,Object.assign({},e,{forwardedRef:t}))})):o}}(["common"])(Ly),Dy=(u=a("85Hg2"),u=a("85Hg2"),{});e(Dy,"REVISION",(()=>jy)),e(Dy,"MOUSE",(()=>Fy)),e(Dy,"TOUCH",(()=>zy)),e(Dy,"CullFaceNone",(()=>Uy)),e(Dy,"CullFaceBack",(()=>Hy)),e(Dy,"CullFaceFront",(()=>Gy)),e(Dy,"CullFaceFrontBack",(()=>Wy)),e(Dy,"BasicShadowMap",(()=>Vy)),e(Dy,"PCFShadowMap",(()=>qy)),e(Dy,"PCFSoftShadowMap",(()=>Ky)),e(Dy,"VSMShadowMap",(()=>$y)),e(Dy,"FrontSide",(()=>Jy)),e(Dy,"BackSide",(()=>Xy)),e(Dy,"DoubleSide",(()=>Qy)),e(Dy,"NoBlending",(()=>Yy)),e(Dy,"NormalBlending",(()=>Zy)),e(Dy,"AdditiveBlending",(()=>ew)),e(Dy,"SubtractiveBlending",(()=>tw)),e(Dy,"MultiplyBlending",(()=>nw)),e(Dy,"CustomBlending",(()=>rw)),e(Dy,"AddEquation",(()=>ow)),e(Dy,"SubtractEquation",(()=>iw)),e(Dy,"ReverseSubtractEquation",(()=>aw)),e(Dy,"MinEquation",(()=>sw)),e(Dy,"MaxEquation",(()=>lw)),e(Dy,"ZeroFactor",(()=>cw)),e(Dy,"OneFactor",(()=>uw)),e(Dy,"SrcColorFactor",(()=>dw)),e(Dy,"OneMinusSrcColorFactor",(()=>fw)),e(Dy,"SrcAlphaFactor",(()=>hw)),e(Dy,"OneMinusSrcAlphaFactor",(()=>pw)),e(Dy,"DstAlphaFactor",(()=>mw)),e(Dy,"OneMinusDstAlphaFactor",(()=>gw)),e(Dy,"DstColorFactor",(()=>vw)),e(Dy,"OneMinusDstColorFactor",(()=>bw)),e(Dy,"SrcAlphaSaturateFactor",(()=>yw)),e(Dy,"NeverDepth",(()=>ww)),e(Dy,"AlwaysDepth",(()=>xw)),e(Dy,"LessDepth",(()=>Sw)),e(Dy,"LessEqualDepth",(()=>Mw)),e(Dy,"EqualDepth",(()=>_w)),e(Dy,"GreaterEqualDepth",(()=>Ew)),e(Dy,"GreaterDepth",(()=>Aw)),e(Dy,"NotEqualDepth",(()=>Cw)),e(Dy,"MultiplyOperation",(()=>kw)),e(Dy,"MixOperation",(()=>Tw)),e(Dy,"AddOperation",(()=>Iw)),e(Dy,"NoToneMapping",(()=>Ow)),e(Dy,"LinearToneMapping",(()=>Rw)),e(Dy,"ReinhardToneMapping",(()=>Pw)),e(Dy,"CineonToneMapping",(()=>Nw)),e(Dy,"ACESFilmicToneMapping",(()=>Lw)),e(Dy,"CustomToneMapping",(()=>Bw)),e(Dy,"UVMapping",(()=>Dw)),e(Dy,"CubeReflectionMapping",(()=>jw)),e(Dy,"CubeRefractionMapping",(()=>Fw)),e(Dy,"EquirectangularReflectionMapping",(()=>zw)),e(Dy,"EquirectangularRefractionMapping",(()=>Uw)),e(Dy,"CubeUVReflectionMapping",(()=>Hw)),e(Dy,"RepeatWrapping",(()=>Gw)),e(Dy,"ClampToEdgeWrapping",(()=>Ww)),e(Dy,"MirroredRepeatWrapping",(()=>Vw)),e(Dy,"NearestFilter",(()=>qw)),e(Dy,"NearestMipmapNearestFilter",(()=>Kw)),e(Dy,"NearestMipMapNearestFilter",(()=>$w)),e(Dy,"NearestMipmapLinearFilter",(()=>Jw)),e(Dy,"NearestMipMapLinearFilter",(()=>Xw)),e(Dy,"LinearFilter",(()=>Qw)),e(Dy,"LinearMipmapNearestFilter",(()=>Yw)),e(Dy,"LinearMipMapNearestFilter",(()=>Zw)),e(Dy,"LinearMipmapLinearFilter",(()=>ex)),e(Dy,"LinearMipMapLinearFilter",(()=>tx)),e(Dy,"UnsignedByteType",(()=>nx)),e(Dy,"ByteType",(()=>rx)),e(Dy,"ShortType",(()=>ox)),e(Dy,"UnsignedShortType",(()=>ix)),e(Dy,"IntType",(()=>ax)),e(Dy,"UnsignedIntType",(()=>sx)),e(Dy,"FloatType",(()=>lx)),e(Dy,"HalfFloatType",(()=>cx)),e(Dy,"UnsignedShort4444Type",(()=>ux)),e(Dy,"UnsignedShort5551Type",(()=>dx)),e(Dy,"UnsignedInt248Type",(()=>fx)),e(Dy,"AlphaFormat",(()=>hx)),e(Dy,"RGBFormat",(()=>px)),e(Dy,"RGBAFormat",(()=>mx)),e(Dy,"LuminanceFormat",(()=>gx)),e(Dy,"LuminanceAlphaFormat",(()=>vx)),e(Dy,"DepthFormat",(()=>bx)),e(Dy,"DepthStencilFormat",(()=>yx)),e(Dy,"RedFormat",(()=>wx)),e(Dy,"RedIntegerFormat",(()=>xx)),e(Dy,"RGFormat",(()=>Sx)),e(Dy,"RGIntegerFormat",(()=>Mx)),e(Dy,"RGBAIntegerFormat",(()=>_x)),e(Dy,"RGB_S3TC_DXT1_Format",(()=>Ex)),e(Dy,"RGBA_S3TC_DXT1_Format",(()=>Ax)),e(Dy,"RGBA_S3TC_DXT3_Format",(()=>Cx)),e(Dy,"RGBA_S3TC_DXT5_Format",(()=>kx)),e(Dy,"RGB_PVRTC_4BPPV1_Format",(()=>Tx)),e(Dy,"RGB_PVRTC_2BPPV1_Format",(()=>Ix)),e(Dy,"RGBA_PVRTC_4BPPV1_Format",(()=>Ox)),e(Dy,"RGBA_PVRTC_2BPPV1_Format",(()=>Rx)),e(Dy,"RGB_ETC1_Format",(()=>Px)),e(Dy,"RGB_ETC2_Format",(()=>Nx)),e(Dy,"RGBA_ETC2_EAC_Format",(()=>Lx)),e(Dy,"RGBA_ASTC_4x4_Format",(()=>Bx)),e(Dy,"RGBA_ASTC_5x4_Format",(()=>Dx)),e(Dy,"RGBA_ASTC_5x5_Format",(()=>jx)),e(Dy,"RGBA_ASTC_6x5_Format",(()=>Fx)),e(Dy,"RGBA_ASTC_6x6_Format",(()=>zx)),e(Dy,"RGBA_ASTC_8x5_Format",(()=>Ux)),e(Dy,"RGBA_ASTC_8x6_Format",(()=>Hx)),e(Dy,"RGBA_ASTC_8x8_Format",(()=>Gx)),e(Dy,"RGBA_ASTC_10x5_Format",(()=>Wx)),e(Dy,"RGBA_ASTC_10x6_Format",(()=>Vx)),e(Dy,"RGBA_ASTC_10x8_Format",(()=>qx)),e(Dy,"RGBA_ASTC_10x10_Format",(()=>Kx)),e(Dy,"RGBA_ASTC_12x10_Format",(()=>$x)),e(Dy,"RGBA_ASTC_12x12_Format",(()=>Jx)),e(Dy,"RGBA_BPTC_Format",(()=>Xx)),e(Dy,"LoopOnce",(()=>Qx)),e(Dy,"LoopRepeat",(()=>Yx)),e(Dy,"LoopPingPong",(()=>Zx)),e(Dy,"InterpolateDiscrete",(()=>eS)),e(Dy,"InterpolateLinear",(()=>tS)),e(Dy,"InterpolateSmooth",(()=>nS)),e(Dy,"ZeroCurvatureEnding",(()=>rS)),e(Dy,"ZeroSlopeEnding",(()=>oS)),e(Dy,"WrapAroundEnding",(()=>iS)),e(Dy,"NormalAnimationBlendMode",(()=>aS)),e(Dy,"AdditiveAnimationBlendMode",(()=>sS)),e(Dy,"TrianglesDrawMode",(()=>lS)),e(Dy,"TriangleStripDrawMode",(()=>cS)),e(Dy,"TriangleFanDrawMode",(()=>uS)),e(Dy,"LinearEncoding",(()=>dS)),e(Dy,"sRGBEncoding",(()=>fS)),e(Dy,"BasicDepthPacking",(()=>hS)),e(Dy,"RGBADepthPacking",(()=>pS)),e(Dy,"TangentSpaceNormalMap",(()=>mS)),e(Dy,"ObjectSpaceNormalMap",(()=>gS)),e(Dy,"NoColorSpace",(()=>vS)),e(Dy,"SRGBColorSpace",(()=>bS)),e(Dy,"LinearSRGBColorSpace",(()=>yS)),e(Dy,"ZeroStencilOp",(()=>wS)),e(Dy,"KeepStencilOp",(()=>xS)),e(Dy,"ReplaceStencilOp",(()=>SS)),e(Dy,"IncrementStencilOp",(()=>MS)),e(Dy,"DecrementStencilOp",(()=>_S)),e(Dy,"IncrementWrapStencilOp",(()=>ES)),e(Dy,"DecrementWrapStencilOp",(()=>AS)),e(Dy,"InvertStencilOp",(()=>CS)),e(Dy,"NeverStencilFunc",(()=>kS)),e(Dy,"LessStencilFunc",(()=>TS)),e(Dy,"EqualStencilFunc",(()=>IS)),e(Dy,"LessEqualStencilFunc",(()=>OS)),e(Dy,"GreaterStencilFunc",(()=>RS)),e(Dy,"NotEqualStencilFunc",(()=>PS)),e(Dy,"GreaterEqualStencilFunc",(()=>NS)),e(Dy,"AlwaysStencilFunc",(()=>LS)),e(Dy,"StaticDrawUsage",(()=>BS)),e(Dy,"DynamicDrawUsage",(()=>DS)),e(Dy,"StreamDrawUsage",(()=>jS)),e(Dy,"StaticReadUsage",(()=>FS)),e(Dy,"DynamicReadUsage",(()=>zS)),e(Dy,"StreamReadUsage",(()=>US)),e(Dy,"StaticCopyUsage",(()=>HS)),e(Dy,"DynamicCopyUsage",(()=>GS)),e(Dy,"StreamCopyUsage",(()=>WS)),e(Dy,"GLSL1",(()=>VS)),e(Dy,"GLSL3",(()=>qS)),e(Dy,"_SRGBAFormat",(()=>KS)),e(Dy,"EventDispatcher",(()=>$S)),e(Dy,"MathUtils",(()=>lM)),e(Dy,"Vector2",(()=>cM)),e(Dy,"Matrix3",(()=>uM)),e(Dy,"ColorManagement",(()=>bM)),e(Dy,"Color",(()=>EM)),e(Dy,"ImageUtils",(()=>CM)),e(Dy,"Source",(()=>kM)),e(Dy,"Texture",(()=>OM)),e(Dy,"Vector4",(()=>RM)),e(Dy,"WebGLRenderTarget",(()=>PM)),e(Dy,"DataArrayTexture",(()=>NM)),e(Dy,"WebGLArrayRenderTarget",(()=>LM)),e(Dy,"Data3DTexture",(()=>BM)),e(Dy,"WebGL3DRenderTarget",(()=>DM)),e(Dy,"WebGLMultipleRenderTargets",(()=>jM)),e(Dy,"Quaternion",(()=>FM)),e(Dy,"Vector3",(()=>zM)),e(Dy,"Box3",(()=>GM)),e(Dy,"Sphere",(()=>l_)),e(Dy,"Ray",(()=>g_)),e(Dy,"Matrix4",(()=>v_)),e(Dy,"Euler",(()=>C_)),e(Dy,"Layers",(()=>k_)),e(Dy,"Object3D",(()=>H_)),e(Dy,"Triangle",(()=>Z_)),e(Dy,"Material",(()=>tE)),e(Dy,"MeshBasicMaterial",(()=>nE)),e(Dy,"BufferAttribute",(()=>iE)),e(Dy,"Int8BufferAttribute",(()=>aE)),e(Dy,"Uint8BufferAttribute",(()=>sE)),e(Dy,"Uint8ClampedBufferAttribute",(()=>lE)),e(Dy,"Int16BufferAttribute",(()=>cE)),e(Dy,"Uint16BufferAttribute",(()=>uE)),e(Dy,"Int32BufferAttribute",(()=>dE)),e(Dy,"Uint32BufferAttribute",(()=>fE)),e(Dy,"Float16BufferAttribute",(()=>hE)),e(Dy,"Float32BufferAttribute",(()=>pE)),e(Dy,"Float64BufferAttribute",(()=>mE)),e(Dy,"BufferGeometry",(()=>ME)),e(Dy,"Mesh",(()=>UE)),e(Dy,"BoxGeometry",(()=>GE)),e(Dy,"UniformsUtils",(()=>qE)),e(Dy,"ShaderMaterial",(()=>KE)),e(Dy,"Camera",(()=>$E)),e(Dy,"PerspectiveCamera",(()=>JE)),e(Dy,"CubeCamera",(()=>QE)),e(Dy,"CubeTexture",(()=>YE)),e(Dy,"WebGLCubeRenderTarget",(()=>ZE)),e(Dy,"Plane",(()=>rA)),e(Dy,"Frustum",(()=>aA)),e(Dy,"PlaneGeometry",(()=>cA)),e(Dy,"ShaderChunk",(()=>uA)),e(Dy,"UniformsLib",(()=>dA)),e(Dy,"ShaderLib",(()=>fA)),e(Dy,"OrthographicCamera",(()=>yA)),e(Dy,"PMREMGenerator",(()=>kA)),e(Dy,"MeshDepthMaterial",(()=>_k)),e(Dy,"MeshDistanceMaterial",(()=>Ek)),e(Dy,"WebGLUtils",(()=>Tk)),e(Dy,"ArrayCamera",(()=>Ik)),e(Dy,"Group",(()=>Ok)),e(Dy,"DepthTexture",(()=>Nk)),e(Dy,"WebGLRenderer",(()=>jk)),e(Dy,"WebGL1Renderer",(()=>Fk)),e(Dy,"FogExp2",(()=>zk)),e(Dy,"Fog",(()=>Uk)),e(Dy,"Scene",(()=>Hk)),e(Dy,"InterleavedBuffer",(()=>Gk)),e(Dy,"InterleavedBufferAttribute",(()=>Vk)),e(Dy,"SpriteMaterial",(()=>qk)),e(Dy,"Sprite",(()=>aT)),e(Dy,"LOD",(()=>uT)),e(Dy,"SkinnedMesh",(()=>gT)),e(Dy,"Bone",(()=>vT)),e(Dy,"DataTexture",(()=>bT)),e(Dy,"Skeleton",(()=>xT)),e(Dy,"InstancedBufferAttribute",(()=>ST)),e(Dy,"InstancedMesh",(()=>CT)),e(Dy,"LineBasicMaterial",(()=>kT)),e(Dy,"Line",(()=>NT)),e(Dy,"LineSegments",(()=>DT)),e(Dy,"LineLoop",(()=>jT)),e(Dy,"PointsMaterial",(()=>FT)),e(Dy,"Points",(()=>WT)),e(Dy,"VideoTexture",(()=>qT)),e(Dy,"FramebufferTexture",(()=>KT)),e(Dy,"CompressedTexture",(()=>$T)),e(Dy,"CanvasTexture",(()=>JT)),e(Dy,"Curve",(()=>XT)),e(Dy,"EllipseCurve",(()=>QT)),e(Dy,"ArcCurve",(()=>YT)),e(Dy,"CatmullRomCurve3",(()=>oI)),e(Dy,"CubicBezierCurve",(()=>lI)),e(Dy,"CubicBezierCurve3",(()=>cI)),e(Dy,"LineCurve",(()=>uI)),e(Dy,"LineCurve3",(()=>dI)),e(Dy,"QuadraticBezierCurve",(()=>fI)),e(Dy,"QuadraticBezierCurve3",(()=>hI)),e(Dy,"SplineCurve",(()=>pI)),e(Dy,"CurvePath",(()=>gI)),e(Dy,"Path",(()=>vI)),e(Dy,"LatheGeometry",(()=>bI)),e(Dy,"CapsuleGeometry",(()=>yI)),e(Dy,"CircleGeometry",(()=>wI)),e(Dy,"CylinderGeometry",(()=>xI)),e(Dy,"ConeGeometry",(()=>SI)),e(Dy,"PolyhedronGeometry",(()=>MI)),e(Dy,"DodecahedronGeometry",(()=>_I)),e(Dy,"EdgesGeometry",(()=>TI)),e(Dy,"Shape",(()=>II)),e(Dy,"ShapeUtils",(()=>nO)),e(Dy,"ExtrudeGeometry",(()=>iO)),e(Dy,"IcosahedronGeometry",(()=>sO)),e(Dy,"OctahedronGeometry",(()=>lO)),e(Dy,"RingGeometry",(()=>cO)),e(Dy,"ShapeGeometry",(()=>uO)),e(Dy,"SphereGeometry",(()=>dO)),e(Dy,"TetrahedronGeometry",(()=>fO)),e(Dy,"TorusGeometry",(()=>hO)),e(Dy,"TorusKnotGeometry",(()=>pO)),e(Dy,"TubeGeometry",(()=>mO)),e(Dy,"WireframeGeometry",(()=>gO)),e(Dy,"ShadowMaterial",(()=>yO)),e(Dy,"RawShaderMaterial",(()=>wO)),e(Dy,"MeshStandardMaterial",(()=>xO)),e(Dy,"MeshPhysicalMaterial",(()=>SO)),e(Dy,"MeshPhongMaterial",(()=>MO)),e(Dy,"MeshToonMaterial",(()=>_O)),e(Dy,"MeshNormalMaterial",(()=>EO)),e(Dy,"MeshLambertMaterial",(()=>AO)),e(Dy,"MeshMatcapMaterial",(()=>CO)),e(Dy,"LineDashedMaterial",(()=>kO)),e(Dy,"AnimationUtils",(()=>LO)),e(Dy,"Interpolant",(()=>BO)),e(Dy,"CubicInterpolant",(()=>DO)),e(Dy,"LinearInterpolant",(()=>jO)),e(Dy,"DiscreteInterpolant",(()=>FO)),e(Dy,"KeyframeTrack",(()=>zO)),e(Dy,"BooleanKeyframeTrack",(()=>UO)),e(Dy,"ColorKeyframeTrack",(()=>HO)),e(Dy,"NumberKeyframeTrack",(()=>GO)),e(Dy,"QuaternionLinearInterpolant",(()=>WO)),e(Dy,"QuaternionKeyframeTrack",(()=>VO)),e(Dy,"StringKeyframeTrack",(()=>qO)),e(Dy,"VectorKeyframeTrack",(()=>KO)),e(Dy,"AnimationClip",(()=>$O)),e(Dy,"Cache",(()=>XO)),e(Dy,"LoadingManager",(()=>QO)),e(Dy,"DefaultLoadingManager",(()=>YO)),e(Dy,"Loader",(()=>ZO)),e(Dy,"FileLoader",(()=>nR)),e(Dy,"AnimationLoader",(()=>rR)),e(Dy,"CompressedTextureLoader",(()=>oR)),e(Dy,"ImageLoader",(()=>iR)),e(Dy,"CubeTextureLoader",(()=>aR)),e(Dy,"DataTextureLoader",(()=>sR)),e(Dy,"TextureLoader",(()=>lR)),e(Dy,"Light",(()=>cR)),e(Dy,"HemisphereLight",(()=>uR)),e(Dy,"SpotLight",(()=>gR)),e(Dy,"PointLight",(()=>xR)),e(Dy,"DirectionalLight",(()=>MR)),e(Dy,"AmbientLight",(()=>_R)),e(Dy,"RectAreaLight",(()=>ER)),e(Dy,"SphericalHarmonics3",(()=>AR)),e(Dy,"LightProbe",(()=>CR)),e(Dy,"MaterialLoader",(()=>kR)),e(Dy,"LoaderUtils",(()=>TR)),e(Dy,"InstancedBufferGeometry",(()=>IR)),e(Dy,"BufferGeometryLoader",(()=>OR)),e(Dy,"ObjectLoader",(()=>RR)),e(Dy,"ImageBitmapLoader",(()=>BR)),e(Dy,"AudioContext",(()=>jR)),e(Dy,"AudioLoader",(()=>FR)),e(Dy,"HemisphereLightProbe",(()=>zR)),e(Dy,"AmbientLightProbe",(()=>UR)),e(Dy,"StereoCamera",(()=>VR)),e(Dy,"Clock",(()=>qR)),e(Dy,"AudioListener",(()=>YR)),e(Dy,"Audio",(()=>ZR)),e(Dy,"PositionalAudio",(()=>oP)),e(Dy,"AudioAnalyser",(()=>iP)),e(Dy,"PropertyMixer",(()=>aP)),e(Dy,"PropertyBinding",(()=>hP)),e(Dy,"AnimationObjectGroup",(()=>pP)),e(Dy,"AnimationMixer",(()=>vP)),e(Dy,"Uniform",(()=>bP)),e(Dy,"UniformsGroup",(()=>wP)),e(Dy,"InstancedInterleavedBuffer",(()=>xP)),e(Dy,"GLBufferAttribute",(()=>SP)),e(Dy,"Raycaster",(()=>MP)),e(Dy,"Spherical",(()=>AP)),e(Dy,"Cylindrical",(()=>CP)),e(Dy,"Box2",(()=>TP)),e(Dy,"Line3",(()=>RP)),e(Dy,"SpotLightHelper",(()=>NP)),e(Dy,"SkeletonHelper",(()=>jP)),e(Dy,"PointLightHelper",(()=>zP)),e(Dy,"HemisphereLightHelper",(()=>WP)),e(Dy,"GridHelper",(()=>VP)),e(Dy,"PolarGridHelper",(()=>qP)),e(Dy,"DirectionalLightHelper",(()=>XP)),e(Dy,"CameraHelper",(()=>ZP)),e(Dy,"BoxHelper",(()=>nN)),e(Dy,"Box3Helper",(()=>rN)),e(Dy,"PlaneHelper",(()=>oN)),e(Dy,"ArrowHelper",(()=>lN)),e(Dy,"AxesHelper",(()=>cN)),e(Dy,"ShapePath",(()=>uN)),e(Dy,"DataUtils",(()=>hN)),e(Dy,"ImmediateRenderObject",(()=>pN)),e(Dy,"WebGLMultisampleRenderTarget",(()=>mN)),e(Dy,"DataTexture2DArray",(()=>gN)),e(Dy,"DataTexture3D",(()=>vN)),e(Dy,"BoxBufferGeometry",(()=>bN)),e(Dy,"CapsuleBufferGeometry",(()=>yN)),e(Dy,"CircleBufferGeometry",(()=>wN)),e(Dy,"ConeBufferGeometry",(()=>xN)),e(Dy,"CylinderBufferGeometry",(()=>SN)),e(Dy,"DodecahedronBufferGeometry",(()=>MN)),e(Dy,"ExtrudeBufferGeometry",(()=>_N)),e(Dy,"IcosahedronBufferGeometry",(()=>EN)),e(Dy,"LatheBufferGeometry",(()=>AN)),e(Dy,"OctahedronBufferGeometry",(()=>CN)),e(Dy,"PlaneBufferGeometry",(()=>kN)),e(Dy,"PolyhedronBufferGeometry",(()=>TN)),e(Dy,"RingBufferGeometry",(()=>IN)),e(Dy,"ShapeBufferGeometry",(()=>ON)),e(Dy,"SphereBufferGeometry",(()=>RN)),e(Dy,"TetrahedronBufferGeometry",(()=>PN)),e(Dy,"TorusBufferGeometry",(()=>NN)),e(Dy,"TorusKnotBufferGeometry",(()=>LN)),e(Dy,"TubeBufferGeometry",(()=>BN));
90
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Bo=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof d?t:d,i=Object.create(o.prototype),a=new M(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return E()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function d(){}function f(){}function h(){}var p={};s(p,o,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(_([])));g&&g!==t&&n.call(g,o)&&(p=g);var v=h.prototype=d.prototype=Object.create(p);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function r(o,i,a,s){var l=c(e[o],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function _(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:E}}function E(){return{value:void 0,done:!0}}return f.prototype=h,s(v,"constructor",h),s(h,"constructor",f),f.displayName=s(h,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(y.prototype),s(y.prototype,i,(function(){return this})),e.AsyncIterator=y,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new y(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(v),s(v,a,"Generator"),s(v,o,(function(){return this})),s(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=_,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:_(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Do(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function jo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Do(i,r,o,a,s,"next",e)}function s(e){Do(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Fo(){return Fo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fo.apply(this,arguments)}var zo=function(e,t){return r(f)(""+t.apiUrl+e,Fo({},t,{body:null!=t&&t.body?JSON.stringify(t.body):void 0,mode:"cors",credentials:"include",headers:Fo({"Content-Type":"application/json"},null==t?void 0:t.headers)})).then((function(e){return null!=t&&t.text?e.text():e.json()}))},Uo=function(e){return{getTenantPublicMemoriList:function(t){return zo("/TenantPublicMemori/"+encodeURI(t),{apiUrl:e})},getTenantMetaverseMemoriList:function(t){return zo("/TenantMetaverseMemori/"+encodeURI(t),{apiUrl:e})},getPublicMemoriList:function(t){return zo("/PublicMemori/"+t,{apiUrl:e})},getAllMemori:function(t){return zo("/AllMemori/"+t,{apiUrl:e})},getUserMemoriList:function(t){return zo("/Memori/"+t,{apiUrl:e})},getSharedMemoriList:function(t){return zo("/SharedMemori/"+t,{apiUrl:e})},getTenantCategories:function(t){return zo("/TenantMemoriCategories/"+encodeURI(t),{apiUrl:e})},getMemoriConfigs:function(t){return zo("/MemoriConfigs/"+t,{apiUrl:e})},createMemori:function(t,n){return zo("/Memori/"+t,{apiUrl:e,body:n,method:"POST"})},updateMemori:function(t,n){return zo("/Memori/"+t+"/"+n.memoriID,{apiUrl:e,body:n,method:"PATCH"})},deleteMemori:function(t,n){return zo("/Memori/"+t,{apiUrl:e,body:n,method:"DELETE"})},getMemoriById:function(t,n){return zo("/Memori/"+t+"/"+n,{apiUrl:e})},getMemoriByUserAndId:function(t,n,r,o){return zo("/MemoriById/"+t+"/"+n+"/"+r+(o?"/"+o:""),{apiUrl:e})},getMemori:function(t,n,r,o){return zo("/Memori/"+encodeURI(t)+"/"+encodeURI(n)+"/"+encodeURI(r)+"/"+(null!=o?o:""),{apiUrl:e})},getMemoriSessions:function(t,n,r,o){return zo("/MemoriSessions/"+t+"/"+n+(r?"/"+r:"")+(r&&o?"/"+o:""),{apiUrl:e})},transferMemori:function(t,n){return zo("/TransferMemori/"+t,{apiUrl:e,body:n,method:"POST"})},memoriContentUpdated:function(t,n){return zo("/MemoriContentUpdated/"+t+"/"+n,{apiUrl:e,method:"POST"})}}},Ho=function(e){return{userSignIn:function(t){return zo("/User",{apiUrl:e,body:t,method:"POST"})},userConfirmSignIn:function(t){return zo("/UserConfirm",{apiUrl:e,body:t,method:"POST"})},userLogin:function(t){return zo("/Login",{apiUrl:e,body:t,method:"POST"})},userLogout:function(t){return zo("/Logout/"+t,{apiUrl:e,method:"POST"})},getUser:function(t,n){return zo("/User/"+t+"/"+n,{apiUrl:e})},getUsersList:function(t){return zo("/Users/"+t,{apiUrl:e})},deleteUser:function(t,n){return zo("/User/"+t+"/"+n,{apiUrl:e,method:"DELETE"})},updateUser:function(t,n,r){return zo("/User/"+t+"/"+n,{apiUrl:e,method:"PATCH",body:r})},resetPassword:function(t){return zo("/ResetPassword",{apiUrl:e,body:t,method:"POST"})},resetConfirm:function(t){return zo("/ResetConfirm",{apiUrl:e,body:t,method:"POST"})},recoverUsername:function(t){return zo("/RecoverUsername",{apiUrl:e,body:t,method:"POST"})},getTenantConfig:function(t){return zo("/Tenant/"+t,{apiUrl:e})},resendVerificationCode:function(t){return zo("/ResendVerificationCode",{apiUrl:e,body:t,method:"POST"})},createUser:function(t,n){return zo("/User/"+t,{apiUrl:e,body:n,method:"POST"})}}},Go=function(e){return{getMemoriIntegrationsList:function(t,n){return zo("/Integrations/"+t+"/"+n,{apiUrl:e})},getAllIntegrationsList:function(t){return zo("/AllIntegrations/"+t,{apiUrl:e})},getIntegration:function(t,n){return zo("/Integration/"+t+"/"+n,{apiUrl:e})},deleteIntegration:function(t,n){return zo("/Integration/"+t+"/"+n,{apiUrl:e,method:"DELETE"})},createIntegration:function(t,n){return zo("/Integration/"+t,{apiUrl:e,method:"POST",body:n})},updateIntegration:function(t,n,r){return zo("/Integration/"+t+"/"+n,{apiUrl:e,method:"PATCH",body:r})}}},Wo=function(e){return{getUploadAssetURL:function(t,n,r){return e+"/Asset/"+t+"/"+n+(r?"/"+r:"")},uploadAsset:(t=jo(Bo().mark((function t(n,r,o,i,a){var s,l,c,u;return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=new FormData,t.next=3,fetch(r);case 3:return l=t.sent,t.next=6,l.blob();case 6:return c=t.sent,s.append(n,c,n),t.next=10,fetch(e+"/Asset/"+o+"/"+i+(a?"/"+a:""),{method:"POST",body:s});case 10:return u=t.sent,t.next=13,u.json();case 13:return t.abrupt("return",t.sent);case 14:case"end":return t.stop()}}),t)}))),function(e,n,r,o,i){return t.apply(this,arguments)}),getAsset:function(t,n){return zo("/Asset/"+t+"/"+n,{apiUrl:e,method:"GET"})},updateAsset:function(t,n,r){return zo("/Asset/"+t+"/"+n.split("/").reverse()[0],{apiUrl:e,method:"PATCH",body:r})},deleteAsset:function(t,n){return zo("/Asset/"+t+"/"+n.split("/").reverse()[0],{apiUrl:e,method:"DELETE"})}};var t},Vo=function(e){return{getSentInvitations:function(t){return zo("/SentInvitations/"+t,{apiUrl:e})},getMemoriInvitations:function(t,n){return zo("/MemoriInvitations/"+t+"/"+n,{apiUrl:e})},getReceivedInvitations:function(t){return zo("/ReceivedInvitations/"+t,{apiUrl:e})},getAllInvitations:function(t){return zo("/AllInvitations/"+t,{apiUrl:e})},getInvitation:function(t,n){return zo("/Invitation/"+t+"/"+n,{apiUrl:e})},updateInvitation:function(t,n){return zo("/Invitation/"+t+"/"+n.invitationID,{apiUrl:e,method:"PATCH",body:n})},deleteInvitation:function(t,n){return zo("/Invitation/"+t+"/"+n,{apiUrl:e,method:"DELETE"})},acceptInvitation:function(t,n){return zo("/AcceptInvitation/"+t+"/"+n,{apiUrl:e,method:"POST"})},rejectInvitation:function(t,n){return zo("/RejectInvitation/"+t+"/"+n,{apiUrl:e,method:"POST"})},sendInvitation:function(t,n){return zo("/SendInvitation/"+t,{apiUrl:e,method:"POST",body:n})}}},qo=function(e){return{getTenantConsumptionLogs:function(t,n,r,o,i){return zo("/TenantConsumptionLogs/"+t+"/"+n+"/"+r+(o?"/"+o:"")+(o&&i?"/"+i:""),{apiUrl:e})},getUserConsumptionLogs:function(t,n,r,o,i){return zo("/UserConsumptionLogs/"+t+"/"+n+"/"+r+(o?"/"+o:"")+(o&&i?"/"+i:""),{apiUrl:e})},getMemoriConsumptionLogs:function(t,n,r,o,i){return zo("/MemoriConsumptionLogs/"+t+"/"+n+"/"+r+(o?"/"+o:"")+(o&&i?"/"+i:""),{apiUrl:e})}}},Ko=function(e){return{getTenantNotifications:function(t){return zo("/TenantNotifications/"+t,{apiUrl:e})},getUserNotifications:function(t){return zo("/UserNotifications/"+t,{apiUrl:e})}}},$o=function(e){return Fo({asset:Wo(e),memori:Uo(e),user:Ho(e),integration:Go(e),invitation:Vo(e),consumptionLogs:qo(e),notifications:Ko(e)},Wo(e),Uo(e),Ho(e),Go(e),Vo(e),qo(e),Ko(e))},Jo=function(e){return{getCorrelationPairs:(n=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CorrelationPairs/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),deleteCorrelationPair:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CorrelationPair/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n},Xo=function(e){return{postTextEnteredEvent:(c=jo(Bo().mark((function t(n){var r,o;return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.sessionId,o=n.text,t.abrupt("return",zo("/TextEnteredEvent/"+r,{method:"POST",apiUrl:e,body:{text:o}}));case 2:case"end":return t.stop()}}),t)}))),function(e){return c.apply(this,arguments)}),postPlaceChangedEvent:(l=jo(Bo().mark((function t(n){var r,o,i,a,s;return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.sessionId,o=n.placeName,i=n.latitude,a=n.longitude,s=n.uncertaintyKm,t.abrupt("return",zo("/PlaceChangedEvent/"+r,{method:"POST",apiUrl:e,body:{placeName:o,latitude:i,longitude:a,uncertaintyKm:s}}));case 2:case"end":return t.stop()}}),t)}))),function(e){return l.apply(this,arguments)}),postDateChangedEvent:(s=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/DateChangedEvent/"+n,{method:"POST",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return s.apply(this,arguments)}),postTagChangedEvent:(a=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/TagChangedEvent/"+n,{method:"POST",apiUrl:e,body:{tag:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return a.apply(this,arguments)}),postTimeoutEvent:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/TimeoutEvent/"+n,{method:"POST",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),postMediumSelectedEvent:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/MediumSelectedEvent/"+n,{method:"POST",apiUrl:e,body:{medium:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),postDateSelectedEvent:(r=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/DateSelectedEvent/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),postPlaceSelectedEvent:(n=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/PlaceSelectedEvent/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),postTagSelectedEvent:(t=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/TagSelectedEvent/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r,o,i,a,s,l,c},Qo=function(e){return{importCSV:(n=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ImportExport/ImportCSV/"+n,{method:"POST",apiUrl:e,body:Fo({csvRows:r},o)}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),exportCSV:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ImportExport/ExportCSV/"+n,{method:"POST",apiUrl:e,body:r,text:!0}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n},Yo=function(e){return{getIntents:(u=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Intents/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return u.apply(this,arguments)}),getIntent:(c=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Intent/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return c.apply(this,arguments)}),patchIntent:(l=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Intent/"+n+"/"+r.intentID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return l.apply(this,arguments)}),deleteIntent:(s=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Intent/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return s.apply(this,arguments)}),createIntent:(a=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Intent/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return a.apply(this,arguments)}),getIntentSlots:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/IntentSlots/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getIntentSlot:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/IntentSlot/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),patchIntentSlot:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/IntentSlot/"+n+"/"+r.intentSlotID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),deleteIntentSlot:(n=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/IntentSlot/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),createIntentSlot:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/IntentSlot/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i,a,s,l,c,u},Zo=function(e){return{getLocalizationKeys:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/LocalizationKeys/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getLocalizationKey:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/LocalizationKey/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),deleteLocalizationKey:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/LocalizationKey/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postLocalizationKey:(n=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/LocalizationKey/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),patchLocalizationKey:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/LocalizationKey/"+n,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i},ei=function(e){return{getMedia:(i=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Media/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),deleteMedia:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Media/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),getMedium:(r=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Medium/"+n+"/"+r+"/"+o,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)}),patchMedium:(n=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Medium/"+n+"/"+r+"/"+o,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),deleteMedium:function(t,n,r){return zo("/Medium/"+t+"/"+n+"/"+r,{method:"GET",apiUrl:e})},postMedium:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Medium/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i},ti=function(e){return{getMemories:(s=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Memories/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return s.apply(this,arguments)}),getMemoriesPaginated:(a=jo(Bo().mark((function t(n,r,o,i){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Memories/"+n+"/"+r+"/"+o+(i?"/"+i:""),{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n,r){return a.apply(this,arguments)}),getMemory:(i=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Memory/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),patchMemory:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Memory/"+n+"/"+r.memoryID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),deleteMemory:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Memory/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postMemory:(n=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Memory/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),getMemoryAccess:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/MemoryAccess/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i,a,s},ni=function(e){return{getWordVector:(i=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/WordVector/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),getSimilarWords:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/SimilarWords/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),guessLanguage:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/GuessLanguage/"+n,{method:"POST",apiUrl:e,body:{text:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),computeSimilarity:(n=jo(Bo().mark((function t(n,r,o,i,a){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ComputeSimilarity/"+n,{method:"POST",apiUrl:e,body:{referenceText:r,referenceTextType:o,comparisonText:i,comparisonTextType:a}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r,o,i){return n.apply(this,arguments)}),checkWords:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CheckWords/"+n,{method:"POST",apiUrl:e,body:{text:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i},ri=function(e){return{getPeople:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/People/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getPerson:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Person/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),patchPerson:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Person/"+n+"/"+r.personID,{method:"PATCH",body:r,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),deletePerson:(n=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Person/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),postPerson:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Person/"+n,{method:"POST",body:r,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i},oi=function(e){return{getPromptedQuestions:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/PromptedQuestions/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getPromptedQuestion:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/PromptedQuestion/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),patchPromptedQuestion:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/PromptedQuestion/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),deletePromptedQuestion:(n=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/PromptedQuestion/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),postPromptedQuestion:(t=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/PromptedQuestion/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r,o,i},ii=function(e){return{searchMemory:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Search/"+n,{method:"POST",body:r,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postRandom:(n=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Random/"+n,{method:"POST",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),postHints:(t=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Hints/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r},ai=function(e){return{initSession:(r=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Session",{method:"POST",body:n,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),getSession:(n=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Session/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),deleteSession:(t=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Session/"+n,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r},si=function(e){return{getStatistics:(a=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/Statistics/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return a.apply(this,arguments)}),getContentQualityIndexes:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ContentQualityIndexes/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getTextQualityIndexes:(o=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/TextQualityIndexes/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getEventLogs:(r=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/EventLogs/"+n+"/"+r+"/"+o,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)}),getMemoryEventLogs:(n=jo(Bo().mark((function t(n,r,o,i){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/EventLogs/"+n+"/"+r+"/"+o+"/"+i,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r,o){return n.apply(this,arguments)}),getIntentEventLogs:(t=jo(Bo().mark((function t(n,r,o,i){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/EventLogs/"+n+"/"+r+"/"+o+"/"+i,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n,r,o){return t.apply(this,arguments)})};var t,n,r,o,i,a},li=function(e){return{getUnansweredQuestions:(r=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/UnansweredQuestions/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),getUnansweredQuestionsPaginated:(n=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/UnansweredQuestions/"+n+"/"+r+"/"+o,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),deleteUnansweredQuestion:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/UnansweredQuestion/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r},ci=function(e){return{getContextVars:(r=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ContextVars/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),getContextVarNames:(n=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ContextVarNames/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),getContextVarValues:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ContextVarValues/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r},ui=function(e){return{getCustomWords:(i=jo(Bo().mark((function t(n){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CustomWords/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getCustomWord:(o=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CustomWord/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),deleteCustomWord:(r=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CustomWord/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postCustomWord:(n=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CustomWord/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),patchCustomWord:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/CustomWord/"+n+"/"+r.customWordID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,o,i},di=function(e){return{getChatLogs:(r=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ChatLogs/"+n+(r?"/"+r:"")+(r&&o?"/"+o:""),{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)}),deleteChatLogs:(n=jo(Bo().mark((function t(n,r,o){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ChatLogs/"+n+(r?"/"+r:"")+(r&&o?"/"+o:""),{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),deleteChatLog:(t=jo(Bo().mark((function t(n,r){return Bo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",zo("/ChatLog/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r},fi={__proto__:null,allowedMediaTypes:["image/jpeg","image/png","image/jpg","image/gif","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/pdf","video/mp4","video/avi","audio/mpeg3","audio/wav","audio/mpeg","video/mpeg","model/gltf-binary"],anonTag:"👤"},hi=function(e,t){return void 0===t&&(t=!1),function(n,r){var o,i,a=hn.fromSubscription(e,"eastus");i=new(0,uo.SpeakerAudioDestination);var s=vo.fromSpeakerOutput(i);a.speechSynthesisVoiceName=function(e,t){var n="";switch(e.toUpperCase()){case"IT":n="MALE"===t?"it-IT-DiegoNeural":"it-IT-ElsaNeural";break;case"DE":n="MALE"===t?"de-DE-ConradNeural":"de-DE-KatjaNeural";break;case"EN":n="MALE"===t?"en-GB-RyanNeural":"en-GB-SoniaNeural";break;case"ES":n="MALE"===t?"es-ES-AlvaroNeural":"es-ES-ElviraNeural";break;case"FR":n="MALE"===t?"fr-FR-HenriNeural":"fr-FR-DeniseNeural";break;case"PT":n="MALE"===t?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural";break;default:n="MALE"===t?"it-IT-DiegoNeural":"it-IT-IsabellaNeural"}return n}(n,r);var l=function(e){var t="";switch(e.toUpperCase()){case"IT":default:t="it-IT";break;case"DE":t="de-DE";break;case"EN":t="en-US";break;case"ES":t="es-ES";break;case"FR":t="fr-FR";break;case"PT":t="pt-PT"}return t}(n);a.speechSynthesisLanguage=l,a.speechRecognitionLanguage=l;var c,u=function(){i&&i.pause(),o&&(o.close(),o=null)},d=vo.fromDefaultMicrophoneInput(),f=function(e){c&&(c.stopContinuousRecognitionAsync(),c.close(),c=null,e&&e())};return{speak:function(e,n){u(),o=new(0,Io.SpeechSynthesizer)(a,s),n&&(i.onAudioEnd=n),o.speakTextAsync(e,(function(n){if(n)try{t&&console.log("speak result",n),o&&(o.close(),o=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e))}else t&&console.log("speak no result",n)}),(function(t){console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e))}))},isSpeaking:function(){return!!o},stopSpeaking:u,recognize:function(e){(c=new(0,wo.SpeechRecognizer)(a,d)).recognizing=function(e,n){t&&console.log("RECOGNIZING: Text="+n.result.text)},c.recognized=function(n,r){var o;r.result.reason===bt.RecognizedSpeech?(t&&console.log("RECOGNIZED: Text="+r.result.text),e(null!=(o=r.result.text)?o:"")):r.result.reason===bt.NoMatch&&t&&console.log("NOMATCH: Speech could not be recognized.")},c.canceled=function(e,n){t&&console.log("CANCELED: Reason="+n.reason),n.reason===We.Error&&t&&(console.log('"CANCELED: ErrorCode='+n.errorCode),console.log('"CANCELED: ErrorDetails='+n.errorDetails),console.log("CANCELED: Did you set the speech resource key and region values?")),f()},c.sessionStopped=function(e,n){t&&console.log("\n Session stopped event."),c&&c.stopContinuousRecognitionAsync()},c.startContinuousRecognitionAsync()},isRecognizing:function(){return!!c},stopRecognizing:f}}},pi=function(e){return{getResourceUrl:function(t){var n=t.type,r=t.resourceURI,o=t.sessionID,i=t.baseURL,a=void 0===i?"https://app.twincreator.com":i,s="cover"===n?a+"/images/memoriCover.png":a+"/images/memoriAvatar.png";return r&&0!==r.length?r.includes("memoriai/memory")?r+"?memori-ai-session-id="+o:r.startsWith("https://")||r.startsWith("http://")?r+(o?"/"+o:""):r.startsWith("cloud://")?e.replace(/v2/,"v1")+"/CloudAsset/"+r.replace("cloud://",""):r.startsWith("guid://")?e.replace(/v2/,"v1")+"/GuidAsset/"+r.replace("guid://",""):s:s}}},mi=function(e){var t=function(e){return e?new URL(e.startsWith("http")?e:"https://"+e).origin.replace("http://","https://"):"https://backend.memori.ai"}(e);return Fo({backend:$o(t+"/api/v2")},function(e){return Fo({correlationPairs:Jo(e)},Jo(e),{dialog:Xo(e)},Xo(e),{importExport:Qo(e)},Qo(e),{intents:Yo(e)},Yo(e),{localizationKeys:Zo(e)},Zo(e),{media:ei(e)},ei(e),{memories:ti(e)},ti(e),{nlp:ni(e)},ni(e),{people:ri(e)},ri(e),{promptedQuestions:oi(e)},oi(e),{search:ii(e)},ii(e),{session:ai(e)},ai(e),{stats:si(e)},si(e),{unansweredQuestions:li(e)},li(e),{contextVars:ci(e)},ci(e),{customDictionary:ui(e)},ui(e),{chatLogs:di(e)},di(e))}(t+"/memori/v2"),{speech:hi,constants:fi,asset:pi(t+"/api/v2")})},gi=(u=a("85Hg2"),{}),vi={};(vi=function(e){if(Array.isArray(e))return e}).__esModule=!0,vi.default=vi;var bi={};(bi=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}).__esModule=!0,bi.default=bi;var yi={},wi={};(wi=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}).__esModule=!0,wi.default=wi,yi=function(e,t){if(e){if("string"==typeof e)return wi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wi(e,t):void 0}},yi.__esModule=!0,yi.default=yi;var xi={};(xi=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,xi.default=xi,(gi=function(e,t){return vi(e)||bi(e,t)||yi(e,t)||xi()}).__esModule=!0,gi.default=gi;var Si={},Mi={},_i={};function Ei(e){return _i=Ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_i.__esModule=!0,_i.default=_i,Ei(e)}(_i=Ei).__esModule=!0,_i.default=_i;var Ai=_i.default,Ci={},ki=_i.default;(Ci=function(e,t){if("object"!==ki(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ki(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}).__esModule=!0,Ci.default=Ci,(Mi=function(e){var t=Ci(e,"string");return"symbol"===Ai(t)?t:String(t)}).__esModule=!0,Mi.default=Mi,(Si=function(e,t,n){return(t=Mi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}).__esModule=!0,Si.default=Si;u=a("85Hg2");var Ti={};(Ti=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}).__esModule=!0,Ti.default=Ti;var Ii={};function Oi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mi(r.key),r)}}(Ii=function(e,t,n){return t&&Oi(e.prototype,t),n&&Oi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}).__esModule=!0,Ii.default=Ii;u=a("85Hg2");var Ri=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Pi={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Ni=function(e){return Pi[e]};function Li(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Li(Object(n),!0).forEach((function(t){r(Si)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Li(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Di,ji={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(Ri,Ni)}},Fi=(0,u.createContext)();function zi(){return ji}var Ui=function(){function e(){r(Ti)(this,e),this.usedNamespaces={}}return r(Ii)(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function Hi(){return Di}var Gi={type:"3rdParty",init:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ji=Bi(Bi({},ji),e)}(e.options.react),function(e){Di=e}(e)}};function Wi(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]="react-i18next:: ".concat(n[0])),(e=console).warn.apply(e,n)}}var Vi={};function qi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"==typeof t[0]&&Vi[t[0]]||("string"==typeof t[0]&&(Vi[t[0]]=new Date),Wi.apply(void 0,t))}function Ki(e,t,n){e.loadNamespaces(t,(function(){if(e.isInitialized)n();else{e.on("initialized",(function t(){setTimeout((function(){e.off("initialized",t)}),0),n()}))}}))}function $i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],o=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(r,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e))))}function Ji(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return qi("i18n.languages were undefined or empty",t.languages),!0;var r=void 0!==t.options.ignoreJSONStructure;return r?t.hasLoadedNamespace(e,{precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):$i(e,t,n)}function Xi(e){return e.displayName||e.name||("string"==typeof e&&e.length>0?e:"Unknown")}function Qi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qi(Object(n),!0).forEach((function(t){r(Si)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zi=function(e,t){var n=(0,u.useRef)();return(0,u.useEffect)((function(){n.current=t?n.current:e}),[e,t]),n.current};function ea(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,o=(0,u.useContext)(Fi)||{},i=o.i18n,a=o.defaultNS,s=n||i||Hi();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new Ui),!s){qi("You will need to pass in an i18next instance by using initReactI18next");var l=function(e){return Array.isArray(e)?e[e.length-1]:e},c=[l,{},!1];return c.t=l,c.i18n={},c.ready=!1,c}s.options.react&&void 0!==s.options.react.wait&&qi("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var d=Yi(Yi(Yi({},zi()),s.options.react),t),f=d.useSuspense,h=d.keyPrefix,p=e||a||s.options&&s.options.defaultNS;p="string"==typeof p?[p]:p||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(p);var m=(s.isInitialized||s.initializedStoreOnce)&&p.every((function(e){return Ji(e,s,d)}));function g(){return s.getFixedT(null,"fallback"===d.nsMode?p:p[0],h)}var v=(0,u.useState)(g),b=r(gi)(v,2),y=b[0],w=b[1],x=p.join(),S=Zi(x),M=(0,u.useRef)(!0);(0,u.useEffect)((function(){var e=d.bindI18n,t=d.bindI18nStore;function n(){M.current&&w(g)}return M.current=!0,m||f||Ki(s,p,(function(){M.current&&w(g)})),m&&S&&S!==x&&M.current&&w(g),e&&s&&s.on(e,n),t&&s&&s.store.on(t,n),function(){M.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,n)})),t&&s&&t.split(" ").forEach((function(e){return s.store.off(e,n)}))}}),[s,x]);var _=(0,u.useRef)(!0);(0,u.useEffect)((function(){M.current&&!_.current&&w(g),_.current=!1}),[s,h]);var E=[y,s,m];if(E.t=y,E.i18n=s,E.ready=m,m)return E;if(!m&&!f)return E;throw new Promise((function(e){Ki(s,p,(function(){e()}))}))}var ta={};!function(e,t,n,r){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(t),a=o(n),s=o(r),l=function(e,t,n){return{endTime:t,insertTime:n,type:"exponentialRampToValue",value:e}},c=function(e,t,n){return{endTime:t,insertTime:n,type:"linearRampToValue",value:e}},u=function(e,t){return{startTime:t,type:"setValue",value:e}},d=function(e,t,n){return{duration:n,startTime:t,type:"setValueCurve",values:e}},f=function(e,t,n){var r=n.startTime,o=n.target,i=n.timeConstant;return o+(t-o)*Math.exp((r-e)/i)},h=function(e){return"exponentialRampToValue"===e.type},p=function(e){return"linearRampToValue"===e.type},m=function(e){return h(e)||p(e)},g=function(e){return"setValue"===e.type},v=function(e){return"setValueCurve"===e.type},b=function e(t,n,r,o){var i=t[n];return void 0===i?o:m(i)||g(i)?i.value:v(i)?i.values[i.values.length-1]:f(r,e(t,n-1,i.startTime,o),i)},y=function(e,t,n,r,o){return void 0===n?[r.insertTime,o]:m(n)?[n.endTime,n.value]:g(n)?[n.startTime,n.value]:v(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,b(e,t-1,n.startTime,o)]},w=function(e){return"cancelAndHold"===e.type},x=function(e){return"cancelScheduledValues"===e.type},S=function(e){return w(e)||x(e)?e.cancelTime:h(e)||p(e)?e.endTime:e.startTime},M=function(e,t,n,r){var o=r.endTime,i=r.value;return n===i?i:0<n&&0<i||n<0&&i<0?n*Math.pow(i/n,(e-t)/(o-t)):0},_=function(e,t,n,r){return n+(e-t)/(r.endTime-t)*(r.value-n)},E=function(e,t){var n=Math.floor(t),r=Math.ceil(t);return n===r?e[n]:(1-(t-n))*e[n]+(1-(r-t))*e[r]},A=function(e,t){var n=t.duration,r=t.startTime,o=t.values,i=(e-r)/n*(o.length-1);return E(o,i)},C=function(e){return"setTarget"===e.type},k=function(e){function t(e){a.default(this,t),this._automationEvents=[],this._currenTime=0,this._defaultValue=e}return s.default(t,[{key:e,value:function(){return this._automationEvents[Symbol.iterator]()}},{key:"add",value:function(e){var t=S(e);if(w(e)||x(e)){var n=this._automationEvents.findIndex((function(n){return x(e)&&v(n)?n.startTime+n.duration>=t:S(n)>=t})),r=this._automationEvents[n];if(-1!==n&&(this._automationEvents=this._automationEvents.slice(0,n)),w(e)){var o=this._automationEvents[this._automationEvents.length-1];if(void 0!==r&&m(r)){if(C(o))throw new Error("The internal list is malformed.");var i=v(o)?o.startTime+o.duration:S(o),a=v(o)?o.values[o.values.length-1]:o.value,s=h(r)?M(t,i,a,r):_(t,i,a,r),f=h(r)?l(s,t,this._currenTime):c(s,t,this._currenTime);this._automationEvents.push(f)}void 0!==o&&C(o)&&this._automationEvents.push(u(this.getValue(t),t)),void 0!==o&&v(o)&&o.startTime+o.duration>t&&(this._automationEvents[this._automationEvents.length-1]=d(new Float32Array([6,7]),o.startTime,t-o.startTime))}}else{var g=this._automationEvents.findIndex((function(e){return S(e)>t})),b=-1===g?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[g-1];if(void 0!==b&&v(b)&&S(b)+b.duration>t)return!1;var y=h(e)?l(e.value,e.endTime,this._currenTime):p(e)?c(e.value,t,this._currenTime):e;if(-1===g)this._automationEvents.push(y);else{if(v(e)&&t+e.duration>S(this._automationEvents[g]))return!1;this._automationEvents.splice(g,0,y)}}return!0}},{key:"flush",value:function(e){var t=this._automationEvents.findIndex((function(t){return S(t)>e}));if(t>1){var n=this._automationEvents.slice(t-1),r=n[0];C(r)&&n.unshift(u(b(this._automationEvents,t-2,r.startTime,this._defaultValue),r.startTime)),this._automationEvents=n}}},{key:"getValue",value:function(e){if(0===this._automationEvents.length)return this._defaultValue;var t=this._automationEvents.findIndex((function(t){return S(t)>e})),n=this._automationEvents[t],r=(-1===t?this._automationEvents.length:t)-1,o=this._automationEvents[r];if(void 0!==o&&C(o)&&(void 0===n||!m(n)||n.insertTime>e))return f(e,b(this._automationEvents,r-1,o.startTime,this._defaultValue),o);if(void 0!==o&&g(o)&&(void 0===n||!m(n)))return o.value;if(void 0!==o&&v(o)&&(void 0===n||!m(n)||o.startTime+o.duration>e))return e<o.startTime+o.duration?A(e,o):o.values[o.values.length-1];if(void 0!==o&&m(o)&&(void 0===n||!m(n)))return o.value;if(void 0!==n&&h(n)){var a=y(this._automationEvents,r,o,n,this._defaultValue),s=i.default(a,2),l=s[0],c=s[1];return M(e,l,c,n)}if(void 0!==n&&p(n)){var u=y(this._automationEvents,r,o,n,this._defaultValue),d=i.default(u,2),w=d[0],x=d[1];return _(e,w,x,n)}return this._defaultValue}}]),t}(Symbol.iterator),T=function(e){return{cancelTime:e,type:"cancelAndHold"}},I=function(e){return{cancelTime:e,type:"cancelScheduledValues"}},O=function(e,t){return{endTime:t,type:"exponentialRampToValue",value:e}},R=function(e,t){return{endTime:t,type:"linearRampToValue",value:e}},P=function(e,t,n){return{startTime:t,target:e,timeConstant:n,type:"setTarget"}};e.AutomationEventList=k,e.createCancelAndHoldAutomationEvent=T,e.createCancelScheduledValuesAutomationEvent=I,e.createExponentialRampToValueAutomationEvent=O,e.createLinearRampToValueAutomationEvent=R,e.createSetTargetAutomationEvent=P,e.createSetValueAutomationEvent=u,e.createSetValueCurveAutomationEvent=d,Object.defineProperty(e,"__esModule",{value:!0})}(ta,a("kagof"),a("4qTFT"),a("9uC66"));const na=new WeakSet,ra=new WeakMap,oa=new WeakMap,ia=new WeakMap,aa=new WeakMap,sa=new WeakMap,la=new WeakMap,ca=new WeakMap,ua=new WeakMap,da=new WeakMap,fa={construct:()=>fa},ha=e=>{try{new new Proxy(e,fa)}catch{return!1}return!0},pa=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,ma=(e,t)=>{const n=[];let r=e.replace(/^[\s]+/,""),o=r.match(pa);for(;null!==o;){const e=o[1].slice(1,-1),i=o[0].replace(/([\s]+)?;?$/,"").replace(e,new URL(e,t).toString());n.push(i),r=r.slice(o[0].length).replace(/^[\s]+/,""),o=r.match(pa)}return[n.join(";"),r]},ga=e=>{if(void 0!==e&&!Array.isArray(e))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},va=e=>{if(!ha(e))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===e.prototype||"object"!=typeof e.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},ba=(e,t)=>{const n=e.get(t);if(void 0===n)throw new Error("A value with the given key could not be found.");return n},ya=(e,t)=>{const n=Array.from(e).filter(t);if(n.length>1)throw Error("More than one element was found.");if(0===n.length)throw Error("No element was found.");const[r]=n;return e.delete(r),r},wa=(e,t,n,r)=>{const o=ba(e,t),i=ya(o,(e=>e[0]===n&&e[1]===r));return 0===o.size&&e.delete(t),i},xa=e=>ba(la,e),Sa=e=>{if(na.has(e))throw new Error("The AudioNode is already stored.");na.add(e),xa(e).forEach((e=>e(!0)))},Ma=e=>"port"in e,_a=e=>{if(!na.has(e))throw new Error("The AudioNode is not stored.");na.delete(e),xa(e).forEach((e=>e(!1)))},Ea=(e,t)=>{!Ma(e)&&t.every((e=>0===e.size))&&_a(e)},Aa={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},Ca=(e,t)=>e.context===t,ka=e=>{try{e.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},Ta=()=>new DOMException("","IndexSizeError"),Ia=e=>{var t;e.getChannelData=(t=e.getChannelData,n=>{try{return t.call(e,n)}catch(e){if(12===e.code)throw Ta();throw e}})},Oa={numberOfChannels:1},Ra=-34028234663852886e22,Pa=34028234663852886e22,Na=e=>na.has(e),La={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},Ba=e=>"playbackRate"in e,Da=e=>"frequency"in e&&"gain"in e,ja=e=>"offset"in e,Fa=e=>!("frequency"in e)&&"gain"in e,za=e=>"detune"in e&&"frequency"in e,Ua=e=>"pan"in e,Ha=e=>ba(ra,e),Ga=e=>ba(ia,e),Wa=(e,t)=>{const{activeInputs:n}=Ha(e);n.forEach((n=>n.forEach((([n])=>{t.includes(e)||Wa(n,[...t,e])}))));const r=Ba(e)?[e.playbackRate]:Ma(e)?Array.from(e.parameters.values()):Da(e)?[e.Q,e.detune,e.frequency,e.gain]:ja(e)?[e.offset]:Fa(e)?[e.gain]:za(e)?[e.detune,e.frequency]:Ua(e)?[e.pan]:[];for(const e of r){const n=Ga(e);void 0!==n&&n.activeInputs.forEach((([e])=>Wa(e,t)))}Na(e)&&_a(e)},Va=e=>{Wa(e.destination,[])},qa=e=>void 0===e||"number"==typeof e||"string"==typeof e&&("balanced"===e||"interactive"===e||"playback"===e),Ka=e=>"context"in e,$a=e=>Ka(e[0]),Ja=(e,t,n,r)=>{for(const t of e)if(n(t)){if(r)return!1;throw Error("The set contains at least one similar element.")}return e.add(t),!0},Xa=(e,t,[n,r],o)=>{Ja(e,[t,n,r],(e=>e[0]===t&&e[1]===n),o)},Qa=(e,[t,n,r],o)=>{const i=e.get(t);void 0===i?e.set(t,new Set([[n,r]])):Ja(i,[n,r],(e=>e[0]===n),o)},Ya=e=>"inputs"in e,Za=(e,t,n,r)=>{if(Ya(t)){const o=t.inputs[r];return e.connect(o,n,0),[o,n,0]}return e.connect(t,n,r),[t,n,r]},es=(e,t,n)=>{for(const r of e)if(r[0]===t&&r[1]===n)return e.delete(r),r;return null},ts=(e,t,n)=>ya(e,(e=>e[0]===t&&e[1]===n)),ns=(e,t)=>{if(!xa(e).delete(t))throw new Error("Missing the expected event listener.")},rs=(e,t,n)=>{const r=ba(e,t),o=ya(r,(e=>e[0]===n));return 0===r.size&&e.delete(t),o},os=(e,t,n,r)=>{Ya(t)?e.disconnect(t.inputs[r],n,0):e.disconnect(t,n,r)},is=e=>ba(oa,e),as=e=>ba(aa,e),ss=e=>ca.has(e),ls=e=>!na.has(e),cs=(e,t)=>new Promise((n=>{if(null!==t)n(!0);else{const t=e.createScriptProcessor(256,1,1),r=e.createGain(),o=e.createBuffer(1,2,44100),i=o.getChannelData(0);i[0]=1,i[1]=1;const a=e.createBufferSource();a.buffer=o,a.loop=!0,a.connect(t).connect(e.destination),a.connect(r),a.disconnect(r),t.onaudioprocess=r=>{const o=r.inputBuffer.getChannelData(0);Array.prototype.some.call(o,(e=>1===e))?n(!0):n(!1),a.stop(),t.onaudioprocess=null,a.disconnect(t),t.disconnect(e.destination)},a.start()}})),us=(e,t)=>{const n=new Map;for(const t of e)for(const e of t){const t=n.get(e);n.set(e,void 0===t?1:t+1)}n.forEach(((e,n)=>t(n,e)))},ds=e=>"context"in e,fs=e=>{const t=new Map;var n,r;e.connect=(n=e.connect.bind(e),(e,r=0,o=0)=>{const i=ds(e)?n(e,r,o):n(e,r),a=t.get(e);return void 0===a?t.set(e,[{input:o,output:r}]):a.every((e=>e.input!==o||e.output!==r))&&a.push({input:o,output:r}),i}),e.disconnect=(r=e.disconnect,(n,o,i)=>{if(r.apply(e),void 0===n)t.clear();else if("number"==typeof n)for(const[e,r]of t){const o=r.filter((e=>e.output!==n));0===o.length?t.delete(e):t.set(e,o)}else if(t.has(n))if(void 0===o)t.delete(n);else{const e=t.get(n);if(void 0!==e){const r=e.filter((e=>e.output!==o&&(e.input!==i||void 0===i)));0===r.length?t.delete(n):t.set(n,r)}}for(const[n,r]of t)r.forEach((t=>{ds(n)?e.connect(n,t.output,t.input):e.connect(n,t.output)}))})},hs=(e,t,n,r)=>{const{activeInputs:o,passiveInputs:i}=Ga(t),{outputs:a}=Ha(e),s=xa(e),l=a=>{const s=is(e),l=as(t);if(a){const t=rs(i,e,n);Xa(o,e,t,!1),r||ss(e)||s.connect(l,n)}else{const t=ts(o,e,n);Qa(i,t,!1),r||ss(e)||s.disconnect(l,n)}};return!!Ja(a,[t,n],(e=>e[0]===t&&e[1]===n),!0)&&(s.add(l),Na(e)?Xa(o,e,[n,l],!0):Qa(i,[e,n,l],!0),!0)},ps=(e,t,n,r,o)=>{const[i,a]=((e,t,n,r)=>{const{activeInputs:o,passiveInputs:i}=Ha(t),a=es(o[r],e,n);if(null===a)return[wa(i,e,n,r)[2],!1];return[a[2],!0]})(e,n,r,o);if(null!==i&&(ns(e,i),!a||t||ss(e)||os(is(e),is(n),r,o)),Na(n)){const{activeInputs:e}=Ha(n);Ea(n,e)}},ms=(e,t,n,r)=>{const[o,i]=((e,t,n)=>{const{activeInputs:r,passiveInputs:o}=Ga(t),i=es(r,e,n);if(null===i)return[rs(o,e,n)[1],!1];return[i[2],!0]})(e,n,r);null!==o&&(ns(e,o),!i||t||ss(e)||is(e).disconnect(as(n),r))};class gs{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach(((n,r)=>e.call(t,n,r,this)))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}}const vs={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}};function bs(e,t,n,r,o){if("function"==typeof e.copyFromChannel)0===t[n].byteLength&&(t[n]=new Float32Array(128)),e.copyFromChannel(t[n],r,o);else{const i=e.getChannelData(r);if(0===t[n].byteLength)t[n]=i.slice(o,o+128);else{const e=new Float32Array(i.buffer,o*Float32Array.BYTES_PER_ELEMENT,128);t[n].set(e)}}}const ys=(e,t,n,r,o)=>{"function"==typeof e.copyToChannel?0!==t[n].byteLength&&e.copyToChannel(t[n],r,o):0!==t[n].byteLength&&e.getChannelData(r).set(t[n],o)},ws=(e,t)=>{const n=[];for(let r=0;r<e;r+=1){const e=[],o="number"==typeof t?t:t[r];for(let t=0;t<o;t+=1)e.push(new Float32Array(128));n.push(e)}return n},xs=(e,t)=>{const n=ba(da,e),r=is(t);return ba(n,r)},Ss=async(e,t,n,r,o,i,a)=>{const s=null===t?128*Math.ceil(e.context.length/128):t.length,l=r.channelCount*r.numberOfInputs,c=o.reduce(((e,t)=>e+t),0),u=0===c?null:n.createBuffer(c,s,n.sampleRate);if(void 0===i)throw new Error("Missing the processor constructor.");const d=Ha(e),f=await xs(n,e),h=ws(r.numberOfInputs,r.channelCount),p=ws(r.numberOfOutputs,o),m=Array.from(e.parameters.keys()).reduce(((e,t)=>({...e,[t]:new Float32Array(128)})),{});for(let c=0;c<s;c+=128){if(r.numberOfInputs>0&&null!==t)for(let e=0;e<r.numberOfInputs;e+=1)for(let n=0;n<r.channelCount;n+=1)bs(t,h[e],n,n,c);void 0!==i.parameterDescriptors&&null!==t&&i.parameterDescriptors.forEach((({name:e},n)=>{bs(t,m,e,l+n,c)}));for(let e=0;e<r.numberOfInputs;e+=1)for(let t=0;t<o[e];t+=1)0===p[e][t].byteLength&&(p[e][t]=new Float32Array(128));try{const e=h.map(((e,t)=>0===d.activeInputs[t].size?[]:e)),t=a(c/n.sampleRate,n.sampleRate,(()=>f.process(e,p,m)));if(null!==u)for(let e=0,t=0;e<r.numberOfOutputs;e+=1){for(let n=0;n<o[e];n+=1)ys(u,p[e],n,t+n,c);t+=o[e]}if(!t)break}catch(t){e.dispatchEvent(new ErrorEvent("processorerror",{colno:t.colno,filename:t.filename,lineno:t.lineno,message:t.message}));break}}return u},Ms={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},_s={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},Es={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},As={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},Cs={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},ks=e=>{const{port1:t,port2:n}=new MessageChannel;return new Promise((r=>{const o=()=>{n.onmessage=null,t.close(),n.close(),r()};n.onmessage=()=>o();try{t.postMessage(e,[e])}finally{o()}}))},Ts={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},Is=e=>"delayTime"in e,Os=(e,t,n)=>{const r=t[n];if(void 0===r)throw e();return r},Rs={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},Ps={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},Ns=()=>new DOMException("","InvalidStateError"),Ls=()=>new DOMException("","InvalidAccessError"),Bs=e=>{var t;e.getFrequencyResponse=(t=e.getFrequencyResponse,(n,r,o)=>{if(n.length!==r.length||r.length!==o.length)throw Ls();return t.call(e,n,r,o)})},Ds={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},js=(e,t,n,r,o,i,a,s,l,c,u)=>{const d=c.length;let f=s;for(let s=0;s<d;s+=1){let d=n[0]*c[s];for(let t=1;t<o;t+=1){const r=f-t&l-1;d+=n[t]*i[r],d-=e[t]*a[r]}for(let e=o;e<r;e+=1)d+=n[e]*i[f-e&l-1];for(let n=o;n<t;n+=1)d-=e[n]*a[f-n&l-1];i[f]=c[s],a[f]=d,f=f+1&l-1,u[s]=d}return f},Fs={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},zs=e=>{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const n=e.decodeAudioData(t.buffer,(()=>{}));return void 0!==n&&(n.catch((()=>{})),!0)}catch{}return!1},Us={numberOfChannels:1},Hs=(e,t,n)=>{const r=t[n];void 0!==r&&r!==e[n]&&(e[n]=r)},Gs=(e,t)=>{Hs(e,t,"channelCount"),Hs(e,t,"channelCountMode"),Hs(e,t,"channelInterpretation")},Ws=e=>"function"==typeof e.getFloatTimeDomainData,Vs=(e,t,n)=>{const r=t[n];void 0!==r&&r!==e[n].value&&(e[n].value=r)},qs=e=>{e.start=(t=>{let n=!1;return(r=0,o=0,i)=>{if(n)throw Ns();t.call(e,r,o,i),n=!0}})(e.start)},Ks=e=>{var t;e.start=(t=e.start,(n=0,r=0,o)=>{if("number"==typeof o&&o<0||r<0||n<0)throw new RangeError("The parameters can't be negative.");t.call(e,n,r,o)})},$s=e=>{var t;e.stop=(t=e.stop,(n=0)=>{if(n<0)throw new RangeError("The parameter can't be negative.");t.call(e,n)})},Js=e=>{const{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}},Xs=(e,t)=>null===e?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(e*t))))),Qs=e=>new Promise(((t,n)=>{const{port1:r,port2:o}=new MessageChannel;r.onmessage=({data:e})=>{r.close(),o.close(),t(e)},r.onmessageerror=({data:e})=>{r.close(),o.close(),n(e)},o.postMessage(e)})),Ys=async(e,t)=>new e(await Qs(t)),Zs=(e,t,n,r)=>{let o=da.get(e);void 0===o&&(o=new WeakMap,da.set(e,o));const i=Ys(n,r);return o.set(t,i),i},el=(e,t)=>{const n=e.createBiquadFilter();return Gs(n,t),Vs(n,t,"Q"),Vs(n,t,"detune"),Vs(n,t,"frequency"),Vs(n,t,"gain"),Hs(n,t,"type"),n},tl=e=>{const t=e.numberOfOutputs;Object.defineProperty(e,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw Ns()}}),Object.defineProperty(e,"channelCountMode",{get:()=>"explicit",set:e=>{if("explicit"!==e)throw Ns()}}),Object.defineProperty(e,"channelInterpretation",{get:()=>"discrete",set:e=>{if("discrete"!==e)throw Ns()}})},nl=(e,t)=>{const n=e.createChannelSplitter(t.numberOfOutputs);return Gs(n,t),tl(n),n},rl=(e,t)=>(e.connect=t.connect.bind(t),e.disconnect=t.disconnect.bind(t),e),ol=(e,t)=>{const n=e.createDelay(t.maxDelayTime);return Gs(n,t),Vs(n,t,"delayTime"),n},il=(e,t)=>{const n=e.createGain();return Gs(n,t),Vs(n,t,"gain"),n};function al(e,t){const n=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/n,(e[1]*t[0]-e[0]*t[1])/n]}function sl(e,t){let n=[0,0];for(let i=e.length-1;i>=0;i-=1)o=t,n=[(r=n)[0]*o[0]-r[1]*o[1],r[0]*o[1]+r[1]*o[0]],n[0]+=e[i];var r,o;return n}const ll=(e,t,n,r)=>e.createScriptProcessor(t,n,r),cl=()=>new DOMException("","NotSupportedError"),ul={numberOfChannels:1},dl={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},fl={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},hl={disableNormalization:!1},pl={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},ml=()=>new DOMException("","UnknownError"),gl={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},vl=(e,t,n)=>void 0===e.copyFromChannel?e.getChannelData(n)[0]:(e.copyFromChannel(t,n),t[0]),bl=e=>{if(null===e)return!1;const t=e.length;return t%2!=0?0!==e[Math.floor(t/2)]:e[t/2-1]+e[t/2]!==0},yl=(e,t,n,r)=>{let o=e;for(;!o.hasOwnProperty(t);)o=Object.getPrototypeOf(o);const{get:i,set:a}=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,{get:n(i),set:r(a)})},wl=(e,t,n)=>{try{e.setValueAtTime(t,n)}catch(r){if(9!==r.code)throw r;wl(e,t,n+1e-7)}},xl=e=>{const t=e.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},Sl=e=>{const t=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=t,n.start(),n.stop();try{return n.stop(),!0}catch{return!1}},Ml=e=>{const t=e.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},_l=(e,t)=>{const n=t.createGain();e.connect(n);const r=(o=e.disconnect,()=>{o.call(e,n),e.removeEventListener("ended",r)});var o;e.addEventListener("ended",r),rl(e,n),e.stop=(t=>{let r=!1;return(o=0)=>{if(r)try{t.call(e,o)}catch{n.gain.setValueAtTime(0,o)}else t.call(e,o),r=!0}})(e.stop)},El=(e,t)=>n=>{const r={value:e};return Object.defineProperties(n,{currentTarget:r,target:r}),"function"==typeof t?t.call(e,n):t.handleEvent.call(e,n)},Al=(Cl=Ja,(e,t,[n,r,o],i)=>{Cl(e[r],[t,n,o],(e=>e[0]===t&&e[1]===n),i)});var Cl;const kl=(e=>(t,n,[r,o,i],a)=>{const s=t.get(r);void 0===s?t.set(r,new Set([[o,n,i]])):e(s,[o,n,i],(e=>e[0]===o&&e[1]===n),a)})(Ja),Tl=(Il=ya,(e,t,n,r)=>Il(e[r],(e=>e[0]===t&&e[1]===n)));var Il;const Ol=new WeakMap,Rl=(Pl=Ol,e=>{var t;return null!==(t=Pl.get(e))&&void 0!==t?t:0});var Pl;const Nl=(Ll=new Map,Bl=new WeakMap,(e,t)=>{const n=Bl.get(e);if(void 0!==n)return n;const r=Ll.get(e);if(void 0!==r)return r;try{const n=t();return n instanceof Promise?(Ll.set(e,n),n.catch((()=>!1)).then((t=>(Ll.delete(e),Bl.set(e,t),t)))):(Bl.set(e,n),n)}catch{return Bl.set(e,!1),!1}});var Ll,Bl;const Dl="undefined"==typeof window?null:window,jl=(Fl=Nl,zl=Ta,(e,t)=>{const n=e.createAnalyser();if(Gs(n,t),!(t.maxDecibels>t.minDecibels))throw zl();return Hs(n,t,"fftSize"),Hs(n,t,"maxDecibels"),Hs(n,t,"minDecibels"),Hs(n,t,"smoothingTimeConstant"),Fl(Ws,(()=>Ws(n)))||(e=>{e.getFloatTimeDomainData=t=>{const n=new Uint8Array(t.length);e.getByteTimeDomainData(n);const r=Math.max(n.length,e.fftSize);for(let e=0;e<r;e+=1)t[e]=.0078125*(n[e]-128);return t}})(n),n});var Fl,zl;const Ul=(Hl=Ha,e=>{const t=Hl(e);if(null===t.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return t.renderer});var Hl;const Gl=((e,t,n)=>async(r,o,i)=>{const a=e(r);await Promise.all(a.activeInputs.map(((e,a)=>Array.from(e).map((async([e,s])=>{const l=t(e),c=await l.render(e,o),u=r.context.destination;n(e)||r===u&&n(r)||c.connect(i,s,a)})))).reduce(((e,t)=>[...e,...t]),[]))})(Ha,Ul,ss),Wl=(Vl=jl,ql=is,Kl=Gl,()=>{const e=new WeakMap;return{render(t,n){const r=e.get(n);return void 0!==r?Promise.resolve(r):(async(t,n)=>{let r=ql(t);if(!Ca(r,n)){const e={channelCount:r.channelCount,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,fftSize:r.fftSize,maxDecibels:r.maxDecibels,minDecibels:r.minDecibels,smoothingTimeConstant:r.smoothingTimeConstant};r=Vl(n,e)}return e.set(n,r),await Kl(t,n,r),r})(t,n)}}});var Vl,ql,Kl;const $l=(Jl=sa,e=>{const t=Jl.get(e);if(void 0===t)throw Ns();return t});var Jl;const Xl=(e=>null===e?null:e.hasOwnProperty("OfflineAudioContext")?e.OfflineAudioContext:e.hasOwnProperty("webkitOfflineAudioContext")?e.webkitOfflineAudioContext:null)(Dl),Ql=(Yl=Xl,e=>null!==Yl&&e instanceof Yl);var Yl;const Zl=new WeakMap,ec=(tc=El,class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(e,t,n){if(null!==t){let r=this._listeners.get(t);void 0===r&&(r=tc(this,t),"function"==typeof t&&this._listeners.set(t,r)),this._nativeEventTarget.addEventListener(e,r,n)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,t,n){const r=null===t?void 0:this._listeners.get(t);this._nativeEventTarget.removeEventListener(e,void 0===r?null:r,n)}});var tc;const nc=(e=>null===e?null:e.hasOwnProperty("AudioContext")?e.AudioContext:e.hasOwnProperty("webkitAudioContext")?e.webkitAudioContext:null)(Dl),rc=(oc=nc,e=>null!==oc&&e instanceof oc);var oc;const ic=(e=>t=>null!==e&&"function"==typeof e.AudioNode&&t instanceof e.AudioNode)(Dl),ac=(e=>t=>null!==e&&"function"==typeof e.AudioParam&&t instanceof e.AudioParam)(Dl),sc=(e=>null===e?null:e.hasOwnProperty("AudioWorkletNode")?e.AudioWorkletNode:null)(Dl),lc=((e,t,n,r,o,i,a,s,l,c,u,d,f,h,p,m)=>class extends c{constructor(t,r,o,i){super(o),this._context=t,this._nativeAudioNode=o;const a=u(t);d(a)&&!0!==n(cs,(()=>cs(a,m)))&&fs(o),oa.set(this,o),la.set(this,new Set),"closed"!==t.state&&r&&Sa(this),e(this,i,o)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(e){this._nativeAudioNode.channelCount=e}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(e){this._nativeAudioNode.channelCountMode=e}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(e){this._nativeAudioNode.channelInterpretation=e}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(e,n=0,s=0){if(n<0||n>=this._nativeAudioNode.numberOfOutputs)throw o();const c=u(this._context),d=p(c);if(f(e)||h(e))throw i();if(Ka(e)){const o=is(e);try{const t=Za(this._nativeAudioNode,o,n,s),r=ls(this);(d||r)&&this._nativeAudioNode.disconnect(...t),"closed"!==this.context.state&&!r&&ls(e)&&Sa(e)}catch(e){if(12===e.code)throw i();throw e}if(t(this,e,n,s,d)){const t=l([this],e);us(t,r(d))}return e}const m=as(e);if("playbackRate"===m.name&&1024===m.maxValue)throw a();try{this._nativeAudioNode.connect(m,n),(d||ls(this))&&this._nativeAudioNode.disconnect(m,n)}catch(e){if(12===e.code)throw i();throw e}if(hs(this,e,n,d)){const t=l([this],e);us(t,r(d))}}disconnect(e,t,n){let r;const a=u(this._context),c=p(a);if(void 0===e)r=((e,t)=>{const n=Ha(e),r=[];for(const o of n.outputs)$a(o)?ps(e,t,...o):ms(e,t,...o),r.push(o[0]);return n.outputs.clear(),r})(this,c);else if("number"==typeof e){if(e<0||e>=this.numberOfOutputs)throw o();r=((e,t,n)=>{const r=Ha(e),o=[];for(const i of r.outputs)i[1]===n&&($a(i)?ps(e,t,...i):ms(e,t,...i),o.push(i[0]),r.outputs.delete(i));return o})(this,c,e)}else{if(void 0!==t&&(t<0||t>=this.numberOfOutputs))throw o();if(Ka(e)&&void 0!==n&&(n<0||n>=e.numberOfInputs))throw o();if(r=((e,t,n,r,o)=>{const i=Ha(e);return Array.from(i.outputs).filter((e=>!(e[0]!==n||void 0!==r&&e[1]!==r||void 0!==o&&e[2]!==o))).map((n=>($a(n)?ps(e,t,...n):ms(e,t,...n),i.outputs.delete(n),n[0])))})(this,c,e,t,n),0===r.length)throw i()}for(const e of r){const t=l([this],e);us(t,s)}}})((cc=ra,(e,t,n)=>{const r=[];for(let e=0;e<n.numberOfInputs;e+=1)r.push(new Set);cc.set(e,{activeInputs:r,outputs:new Set,passiveInputs:new WeakMap,renderer:t})}),((e,t,n,r,o,i,a,s,l,c,u,d,f)=>{const h=new WeakMap;return(p,m,g,v,b)=>{const{activeInputs:y,passiveInputs:w}=i(m),{outputs:x}=i(p),S=s(p),M=i=>{const s=l(m),c=l(p);if(i){const t=wa(w,p,g,v);e(y,p,t,!1),b||d(p)||n(c,s,g,v),f(m)&&Sa(m)}else{const e=r(y,p,g,v);t(w,v,e,!1),b||d(p)||o(c,s,g,v);const n=a(m);if(0===n)u(m)&&Ea(m,y);else{const e=h.get(m);void 0!==e&&clearTimeout(e),h.set(m,setTimeout((()=>{u(m)&&Ea(m,y)}),1e3*n))}}};return!!c(x,[m,g,v],(e=>e[0]===m&&e[1]===g&&e[2]===v),!0)&&(S.add(M),u(p)?e(y,p,[g,v,M],!0):t(w,v,[p,g,M],!0),!0)}})(Al,kl,Za,Tl,os,Ha,Rl,xa,is,Ja,Na,ss,ls),Nl,((e,t,n,r,o,i)=>a=>(s,l)=>{const c=e.get(s);if(void 0===c){if(!a&&i(s)){const e=r(s),{outputs:i}=n(s);for(const n of i)if($a(n)){const o=r(n[0]);t(e,o,n[1],n[2])}else{const t=o(n[0]);e.disconnect(t,n[1])}}e.set(s,l)}else e.set(s,c+l)})(ca,os,Ha,is,as,Na),Ta,Ls,cl,((e,t,n,r,o,i,a,s)=>(l,c)=>{const u=t.get(l);if(void 0===u)throw new Error("Missing the expected cycle count.");const d=i(l.context),f=s(d);if(u===c){if(t.delete(l),!f&&a(l)){const t=r(l),{outputs:i}=n(l);for(const n of i)if($a(n)){const o=r(n[0]);e(t,o,n[1],n[2])}else{const e=o(n[0]);t.connect(e,n[1])}}}else t.set(l,u-c)})(Za,ca,Ha,is,as,$l,Na,Ql),((e,t,n)=>function r(o,i){const a=Ka(i)?i:n(e,i);if(Is(a))return[];if(o[0]===a)return[o];if(o.includes(a))return[];const{outputs:s}=t(a);return Array.from(s).map((e=>r([...o,a],e[0]))).reduce(((e,t)=>e.concat(t)),[])})(Zl,Ha,ba),ec,$l,rc,ic,ac,Ql,sc);var cc;const uc=((e,t,n,r,o,i)=>class extends e{constructor(e,n){const a=o(e),s={...Aa,...n},l=r(a,s);super(e,!1,l,i(a)?t():null),this._nativeAnalyserNode=l}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(e){this._nativeAnalyserNode.fftSize=e}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(e){const t=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=e,!(e>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=t,n()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(e){const t=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=e,!(this._nativeAnalyserNode.maxDecibels>e))throw this._nativeAnalyserNode.minDecibels=t,n()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(e){this._nativeAnalyserNode.smoothingTimeConstant=e}getByteFrequencyData(e){this._nativeAnalyserNode.getByteFrequencyData(e)}getByteTimeDomainData(e){this._nativeAnalyserNode.getByteTimeDomainData(e)}getFloatFrequencyData(e){this._nativeAnalyserNode.getFloatFrequencyData(e)}getFloatTimeDomainData(e){this._nativeAnalyserNode.getFloatTimeDomainData(e)}})(lc,Wl,Ta,jl,$l,Ql),dc=new WeakSet,fc=(e=>null===e?null:e.hasOwnProperty("AudioBuffer")?e.AudioBuffer:null)(Dl),hc=(pc=new Uint32Array(1),e=>(pc[0]=e,pc[0]));var pc;const mc=((e,t)=>n=>{n.copyFromChannel=(r,o,i=0)=>{const a=e(i),s=e(o);if(s>=n.numberOfChannels)throw t();const l=n.length,c=n.getChannelData(s),u=r.length;for(let e=a<0?-a:0;e+a<l&&e<u;e+=1)r[e]=c[e+a]},n.copyToChannel=(r,o,i=0)=>{const a=e(i),s=e(o);if(s>=n.numberOfChannels)throw t();const l=n.length,c=n.getChannelData(s),u=r.length;for(let e=a<0?-a:0;e+a<l&&e<u;e+=1)c[e+a]=r[e]}})(hc,Ta),gc=(vc=hc,e=>{var t,n;e.copyFromChannel=(t=e.copyFromChannel,(n,r,o=0)=>{const i=vc(o),a=vc(r);if(i<e.length)return t.call(e,n,a,i)}),e.copyToChannel=(n=e.copyToChannel,(t,r,o=0)=>{const i=vc(o),a=vc(r);if(i<e.length)return n.call(e,t,a,i)})});var vc;const bc=((e,t,n,r,o,i,a,s)=>{let l=null;return class c{constructor(c){if(null===o)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:u,numberOfChannels:d,sampleRate:f}={...Oa,...c};null===l&&(l=new o(1,1,44100));const h=null!==r&&t(i,i)?new r({length:u,numberOfChannels:d,sampleRate:f}):l.createBuffer(d,u,f);if(0===h.numberOfChannels)throw n();return"function"!=typeof h.copyFromChannel?(a(h),Ia(h)):t(ka,(()=>ka(h)))||s(h),e.add(h),h}static[Symbol.hasInstance](t){return null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===c.prototype||e.has(t)}}})(dc,Nl,cl,fc,Xl,(yc=fc,()=>{if(null===yc)return!1;try{new yc({length:1,sampleRate:44100})}catch{return!1}return!0}),mc,gc);var yc;const wc=(xc=il,(e,t)=>{const n=xc(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(n).connect(e.destination);const r=()=>{t.removeEventListener("ended",r),t.disconnect(n),n.disconnect()};t.addEventListener("ended",r)});var xc;const Sc=(Mc=Ul,_c=Ga,Ec=ss,async(e,t,n)=>{const r=_c(e);await Promise.all(Array.from(r.activeInputs).map((async([e,r])=>{const o=Mc(e),i=await o.render(e,t);Ec(e)||i.connect(n,r)})))});var Mc,_c,Ec;const Ac=(Cc=Sc,(e,t,n)=>Cc(t,e,n));var Cc;const kc=((e,t,n,r,o,i,a,s,l,c,u)=>(d,f)=>{const h=d.createBufferSource();return Gs(h,f),Vs(h,f,"playbackRate"),Hs(h,f,"buffer"),Hs(h,f,"loop"),Hs(h,f,"loopEnd"),Hs(h,f,"loopStart"),t(n,(()=>n(d)))||qs(h),t(r,(()=>r(d)))||l(h),t(o,(()=>o(d)))||c(h,d),t(i,(()=>i(d)))||Ks(h),t(a,(()=>a(d)))||u(h,d),t(s,(()=>s(d)))||$s(h),e(d,h),h})(wc,Nl,(e=>{const t=e.createBufferSource();t.start();try{t.start()}catch{return!0}return!1}),(e=>{const t=e.createBufferSource(),n=e.createBuffer(1,1,44100);t.buffer=n;try{t.start(0,1)}catch{return!1}return!0}),(e=>{const t=e.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0}),xl,Sl,Ml,(e=>{var t;e.start=(t=e.start,(n=0,r=0,o)=>{const i=e.buffer,a=null===i?r:Math.min(i.duration,r);null!==i&&a>i.duration-.5/e.context.sampleRate?t.call(e,n,0,0):t.call(e,n,a,o)})}),(Tc=yl,(e,t)=>{const n=t.createBuffer(1,1,44100);null===e.buffer&&(e.buffer=n),Tc(e,"buffer",(t=>()=>{const r=t.call(e);return r===n?null:r}),(t=>r=>t.call(e,null===r?n:r)))}),_l);var Tc;const Ic=((e,t)=>(n,r,o)=>(e(r).replay(o),t(r,n,o)))((e=>t=>{const n=e(t);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer})(Ga),Sc),Oc=((e,t,n,r,o)=>()=>{const i=new WeakMap;let a=null,s=null;return{set start(e){a=e},set stop(e){s=e},render(l,c){const u=i.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=n(l);const d=Ca(u,c);if(!d){const e={buffer:u.buffer,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,loop:u.loop,loopEnd:u.loopEnd,loopStart:u.loopStart,playbackRate:u.playbackRate.value};u=t(c,e),null!==a&&u.start(...a),null!==s&&u.stop(s)}return i.set(c,u),d?await e(c,l.playbackRate,u.playbackRate):await r(c,l.playbackRate,u.playbackRate),await o(l,c,u),u})(l,c)}}})(Ac,kc,is,Ic,Gl),Rc=((e,t,n,r,o,i,a,s,l,c,u,d,f)=>(h,p,m,g=null,v=null)=>{const b=new(0,ta.AutomationEventList)(m.defaultValue),y=p?r(b):null,w={get defaultValue(){return m.defaultValue},get maxValue(){return null===g?m.maxValue:g},get minValue(){return null===v?m.minValue:v},get value(){return m.value},set value(e){m.value=e,w.setValueAtTime(e,h.context.currentTime)},cancelAndHoldAtTime(e){if("function"==typeof m.cancelAndHoldAtTime)null===y&&b.flush(h.context.currentTime),b.add(o(e)),m.cancelAndHoldAtTime(e);else{const t=Array.from(b).pop();null===y&&b.flush(h.context.currentTime),b.add(o(e));const n=Array.from(b).pop();m.cancelScheduledValues(e),t!==n&&void 0!==n&&("exponentialRampToValue"===n.type?m.exponentialRampToValueAtTime(n.value,n.endTime):"linearRampToValue"===n.type?m.linearRampToValueAtTime(n.value,n.endTime):"setValue"===n.type?m.setValueAtTime(n.value,n.startTime):"setValueCurve"===n.type&&m.setValueCurveAtTime(n.values,n.startTime,n.duration))}return w},cancelScheduledValues:e=>(null===y&&b.flush(h.context.currentTime),b.add(i(e)),m.cancelScheduledValues(e),w),exponentialRampToValueAtTime(e,t){if(0===e)throw new RangeError;if(!Number.isFinite(t)||t<0)throw new RangeError;return null===y&&b.flush(h.context.currentTime),b.add(a(e,t)),m.exponentialRampToValueAtTime(e,t),w},linearRampToValueAtTime:(e,t)=>(null===y&&b.flush(h.context.currentTime),b.add(s(e,t)),m.linearRampToValueAtTime(e,t),w),setTargetAtTime:(e,t,n)=>(null===y&&b.flush(h.context.currentTime),b.add(l(e,t,n)),m.setTargetAtTime(e,t,n),w),setValueAtTime:(e,t)=>(null===y&&b.flush(h.context.currentTime),b.add(c(e,t)),m.setValueAtTime(e,t),w),setValueCurveAtTime(e,t,n){const r=e instanceof Float32Array?e:new Float32Array(e);if(null!==d&&"webkitAudioContext"===d.name){const e=t+n,o=h.context.sampleRate,i=Math.ceil(t*o),a=Math.floor(e*o),s=a-i,l=new Float32Array(s);for(let e=0;e<s;e+=1){const a=(r.length-1)/n*((i+e)/o-t),s=Math.floor(a),c=Math.ceil(a);l[e]=s===c?r[s]:(1-(a-s))*r[s]+(1-(c-a))*r[c]}null===y&&b.flush(h.context.currentTime),b.add(u(l,t,n)),m.setValueCurveAtTime(l,t,n);const c=a/o;c<e&&f(w,l[l.length-1],c),f(w,r[r.length-1],e)}else null===y&&b.flush(h.context.currentTime),b.add(u(r,t,n)),m.setValueCurveAtTime(r,t,n);return w}};return n.set(w,m),t.set(w,h),e(w,y),w})((Pc=ia,(e,t)=>{Pc.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:t})}),Zl,aa,(e=>({replay(t){for(const n of e)if("exponentialRampToValue"===n.type){const{endTime:e,value:r}=n;t.exponentialRampToValueAtTime(r,e)}else if("linearRampToValue"===n.type){const{endTime:e,value:r}=n;t.linearRampToValueAtTime(r,e)}else if("setTarget"===n.type){const{startTime:e,target:r,timeConstant:o}=n;t.setTargetAtTime(r,e,o)}else if("setValue"===n.type){const{startTime:e,value:r}=n;t.setValueAtTime(r,e)}else{if("setValueCurve"!==n.type)throw new Error("Can't apply an unknown automation.");{const{duration:e,startTime:r,values:o}=n;t.setValueCurveAtTime(o,r,e)}}}})),ta.createCancelAndHoldAutomationEvent,ta.createCancelScheduledValuesAutomationEvent,ta.createExponentialRampToValueAutomationEvent,ta.createLinearRampToValueAutomationEvent,ta.createSetTargetAutomationEvent,ta.createSetValueAutomationEvent,ta.createSetValueCurveAutomationEvent,nc,wl);var Pc;const Nc=((e,t,n,r,o,i,a,s)=>class extends e{constructor(e,r){const s=i(e),l={...La,...r},c=o(s,l),u=a(s),d=u?t():null;super(e,!1,c,d),this._audioBufferSourceNodeRenderer=d,this._isBufferNullified=!1,this._isBufferSet=null!==l.buffer,this._nativeAudioBufferSourceNode=c,this._onended=null,this._playbackRate=n(this,u,c.playbackRate,Pa,Ra)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(e){if(this._nativeAudioBufferSourceNode.buffer=e,null!==e){if(this._isBufferSet)throw r();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(e){this._nativeAudioBufferSourceNode.loop=e}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(e){this._nativeAudioBufferSourceNode.loopEnd=e}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(e){this._nativeAudioBufferSourceNode.loopStart=e}get onended(){return this._onended}set onended(e){const t="function"==typeof e?s(this,e):null;this._nativeAudioBufferSourceNode.onended=t;const n=this._nativeAudioBufferSourceNode.onended;this._onended=null!==n&&n===t?e:n}get playbackRate(){return this._playbackRate}start(e=0,t=0,n){if(this._nativeAudioBufferSourceNode.start(e,t,n),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.start=void 0===n?[e,t]:[e,t,n]),"closed"!==this.context.state){Sa(this);const e=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",e),Na(this)&&_a(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeAudioBufferSourceNode.stop(e),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=e)}})(lc,Oc,Rc,Ns,kc,$l,Ql,El),Lc=((e,t,n,r,o,i,a,s)=>class extends e{constructor(e,n){const r=i(e),l=a(r),c=o(r,n,l);super(e,!1,c,l?t(s):null),this._isNodeOfNativeOfflineAudioContext=l,this._nativeAudioDestinationNode=c}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(e){if(this._isNodeOfNativeOfflineAudioContext)throw r();if(e>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=e}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(e){if(this._isNodeOfNativeOfflineAudioContext)throw r();this._nativeAudioDestinationNode.channelCountMode=e}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}})(lc,(e=>{const t=new WeakMap;return{render(n,r){const o=t.get(r);return void 0!==o?Promise.resolve(o):(async(n,r)=>{const o=r.destination;return t.set(r,o),await e(n,r,o),o})(n,r)}}}),Ta,Ns,((e,t)=>(n,r,o)=>{const i=n.destination;if(i.channelCount!==r)try{i.channelCount=r}catch{}o&&"explicit"!==i.channelCountMode&&(i.channelCountMode="explicit"),0===i.maxChannelCount&&Object.defineProperty(i,"maxChannelCount",{value:r});const a=e(n,{channelCount:r,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,gain:1});return t(a,"channelCount",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t);try{i.channelCount=t}catch(e){if(t>i.maxChannelCount)throw e}})),t(a,"channelCountMode",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),i.channelCountMode=t})),t(a,"channelInterpretation",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),i.channelInterpretation=t})),Object.defineProperty(a,"maxChannelCount",{get:()=>i.maxChannelCount}),a.connect(i),a})(il,yl),$l,Ql,Gl),Bc=((e,t,n,r,o)=>()=>{const i=new WeakMap;return{render(a,s){const l=i.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=Ca(l,s);if(!c){const e={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=t(s,e)}return i.set(s,l),c?(await e(s,a.Q,l.Q),await e(s,a.detune,l.detune),await e(s,a.frequency,l.frequency),await e(s,a.gain,l.gain)):(await r(s,a.Q,l.Q),await r(s,a.detune,l.detune),await r(s,a.frequency,l.frequency),await r(s,a.gain,l.gain)),await o(a,s,l),l})(a,s)}}})(Ac,el,is,Ic,Gl),Dc=(e=>(t,n)=>e.set(t,n))(Ol),jc=(Fc=lc,zc=Rc,Uc=Bc,Hc=Ls,Gc=el,Wc=$l,Vc=Ql,qc=Dc,class extends Fc{constructor(e,t){const n=Wc(e),r={...Ms,...t},o=Gc(n,r),i=Vc(n);super(e,!1,o,i?Uc():null),this._Q=zc(this,i,o.Q,Pa,Ra),this._detune=zc(this,i,o.detune,1200*Math.log2(Pa),-1200*Math.log2(Pa)),this._frequency=zc(this,i,o.frequency,e.sampleRate/2,0),this._gain=zc(this,i,o.gain,40*Math.log10(Pa),Ra),this._nativeBiquadFilterNode=o,qc(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(e){this._nativeBiquadFilterNode.type=e}getFrequencyResponse(e,t,n){try{this._nativeBiquadFilterNode.getFrequencyResponse(e,t,n)}catch(e){if(11===e.code)throw Hc();throw e}if(e.length!==t.length||t.length!==n.length)throw Hc()}});var Fc,zc,Uc,Hc,Gc,Wc,Vc,qc;const Kc=((e,t)=>(n,r,o)=>{const i=new Set;var a,s;return n.connect=(a=n.connect,(o,s=0,l=0)=>{const c=0===i.size;if(t(o))return a.call(n,o,s,l),e(i,[o,s,l],(e=>e[0]===o&&e[1]===s&&e[2]===l),!0),c&&r(),o;a.call(n,o,s),e(i,[o,s],(e=>e[0]===o&&e[1]===s),!0),c&&r()}),n.disconnect=(s=n.disconnect,(e,r,a)=>{const l=i.size>0;if(void 0===e)s.apply(n),i.clear();else if("number"==typeof e){s.call(n,e);for(const t of i)t[1]===e&&i.delete(t)}else{t(e)?s.call(n,e,r,a):s.call(n,e,r);for(const t of i)t[0]!==e||void 0!==r&&t[1]!==r||void 0!==a&&t[2]!==a||i.delete(t)}const c=0===i.size;l&&c&&o()}),n})(Ja,ic),$c=(Jc=Ns,Xc=Kc,(e,t)=>{t.channelCount=1,t.channelCountMode="explicit",Object.defineProperty(t,"channelCount",{get:()=>1,set:()=>{throw Jc()}}),Object.defineProperty(t,"channelCountMode",{get:()=>"explicit",set:()=>{throw Jc()}});const n=e.createBufferSource();Xc(t,(()=>{const e=t.numberOfInputs;for(let r=0;r<e;r+=1)n.connect(t,0,r)}),(()=>n.disconnect(t)))});var Jc,Xc;const Qc=((e,t)=>(n,r)=>{const o=n.createChannelMerger(r.numberOfInputs);return null!==e&&"webkitAudioContext"===e.name&&t(n,o),Gs(o,r),o})(nc,$c),Yc=((e,t,n)=>()=>{const r=new WeakMap;return{render(o,i){const a=r.get(i);return void 0!==a?Promise.resolve(a):(async(o,i)=>{let a=t(o);if(!Ca(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=e(i,t)}return r.set(i,a),await n(o,i,a),a})(o,i)}}})(Qc,is,Gl),Zc=((e,t,n,r,o)=>class extends e{constructor(e,i){const a=r(e),s={..._s,...i};super(e,!1,n(a,s),o(a)?t():null)}})(lc,Yc,Qc,$l,Ql),eu=((e,t,n)=>()=>{const r=new WeakMap;return{render(o,i){const a=r.get(i);return void 0!==a?Promise.resolve(a):(async(o,i)=>{let a=t(o);if(!Ca(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=e(i,t)}return r.set(i,a),await n(o,i,a),a})(o,i)}}})(nl,is,Gl),tu=((e,t,n,r,o,i)=>class extends e{constructor(e,a){const s=r(e),l=i({...Es,...a});super(e,!1,n(s,l),o(s)?t():null)}})(lc,eu,nl,$l,Ql,(e=>({...e,channelCount:e.numberOfOutputs}))),nu=((e,t,n,r)=>(o,{offset:i,...a})=>{const s=o.createBuffer(1,2,44100),l=t(o,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),c=n(o,{...a,gain:i}),u=s.getChannelData(0);u[0]=1,u[1]=1,l.buffer=s,l.loop=!0;const d={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){c.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){c.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){c.channelInterpretation=e},get context(){return c.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get offset(){return c.gain},get onended(){return l.onended},set onended(e){l.onended=e},addEventListener:(...e)=>l.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>l.dispatchEvent(e[0]),removeEventListener:(...e)=>l.removeEventListener(e[0],e[1],e[2]),start(e=0){l.start.call(l,e)},stop(e=0){l.stop.call(l,e)}};return e(o,l),r(rl(d,c),(()=>l.connect(c)),(()=>l.disconnect(c)))})(wc,kc,il,Kc),ru=((e,t,n,r,o)=>(i,a)=>{if(void 0===i.createConstantSource)return n(i,a);const s=i.createConstantSource();return Gs(s,a),Vs(s,a,"offset"),t(r,(()=>r(i)))||Ks(s),t(o,(()=>o(i)))||$s(s),e(i,s),s})(wc,Nl,nu,xl,Ml),ou=((e,t,n,r,o)=>()=>{const i=new WeakMap;let a=null,s=null;return{set start(e){a=e},set stop(e){s=e},render(l,c){const u=i.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=n(l);const d=Ca(u,c);if(!d){const e={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,offset:u.offset.value};u=t(c,e),null!==a&&u.start(a),null!==s&&u.stop(s)}return i.set(c,u),d?await e(c,l.offset,u.offset):await r(c,l.offset,u.offset),await o(l,c,u),u})(l,c)}}})(Ac,ru,is,Ic,Gl),iu=((e,t,n,r,o,i,a)=>class extends e{constructor(e,a){const s=o(e),l={...As,...a},c=r(s,l),u=i(s),d=u?n():null;super(e,!1,c,d),this._constantSourceNodeRenderer=d,this._nativeConstantSourceNode=c,this._offset=t(this,u,c.offset,Pa,Ra),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(this,e):null;this._nativeConstantSourceNode.onended=t;const n=this._nativeConstantSourceNode.onended;this._onended=null!==n&&n===t?e:n}start(e=0){if(this._nativeConstantSourceNode.start(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=e),"closed"!==this.context.state){Sa(this);const e=()=>{this._nativeConstantSourceNode.removeEventListener("ended",e),Na(this)&&_a(this)};this._nativeConstantSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeConstantSourceNode.stop(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=e)}})(lc,Rc,ou,ru,$l,Ql,El),au=((e,t)=>(n,r)=>{const o=n.createConvolver();if(Gs(o,r),r.disableNormalization===o.normalize&&(o.normalize=!r.disableNormalization),Hs(o,r,"buffer"),r.channelCount>2)throw e();if(t(o,"channelCount",(e=>()=>e.call(o)),(t=>n=>{if(n>2)throw e();return t.call(o,n)})),"max"===r.channelCountMode)throw e();return t(o,"channelCountMode",(e=>()=>e.call(o)),(t=>n=>{if("max"===n)throw e();return t.call(o,n)})),o})(cl,yl),su=((e,t,n)=>()=>{const r=new WeakMap;return{render(o,i){const a=r.get(i);return void 0!==a?Promise.resolve(a):(async(o,i)=>{let a=t(o);if(!Ca(a,i)){const t={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=e(i,t)}return r.set(i,a),Ya(a)?await n(o,i,a.inputs[0]):await n(o,i,a),a})(o,i)}}})(au,is,Gl),lu=((e,t,n,r,o,i)=>class extends e{constructor(e,a){const s=r(e),l={...Cs,...a},c=n(s,l);super(e,!1,c,o(s)?t():null),this._isBufferNullified=!1,this._nativeConvolverNode=c,null!==l.buffer&&i(this,l.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(e){if(this._nativeConvolverNode.buffer=e,null===e&&null!==this._nativeConvolverNode.buffer){const e=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=e.createBuffer(1,1,e.sampleRate),this._isBufferNullified=!0,i(this,0)}else this._isBufferNullified=!1,i(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(e){this._nativeConvolverNode.normalize=e}})(lc,su,au,$l,Ql,Dc),cu=((e,t,n,r,o)=>i=>{const a=new WeakMap;return{render(s,l){const c=a.get(l);return void 0!==c?Promise.resolve(c):(async(s,l)=>{let c=n(s);const u=Ca(c,l);if(!u){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,delayTime:c.delayTime.value,maxDelayTime:i};c=t(l,e)}return a.set(l,c),u?await e(l,s.delayTime,c.delayTime):await r(l,s.delayTime,c.delayTime),await o(s,l,c),c})(s,l)}}})(Ac,ol,is,Ic,Gl),uu=((e,t,n,r,o,i,a)=>class extends e{constructor(e,s){const l=o(e),c={...Ts,...s},u=r(l,c),d=i(l);super(e,!1,u,d?n(c.maxDelayTime):null),this._delayTime=t(this,d,u.delayTime),a(this,c.maxDelayTime)}get delayTime(){return this._delayTime}})(lc,Rc,cu,ol,$l,Ql,Dc),du=(fu=cl,(e,t)=>{const n=e.createDynamicsCompressor();if(Gs(n,t),t.channelCount>2)throw fu();if("max"===t.channelCountMode)throw fu();return Vs(n,t,"attack"),Vs(n,t,"knee"),Vs(n,t,"ratio"),Vs(n,t,"release"),Vs(n,t,"threshold"),n});var fu;const hu=((e,t,n,r,o)=>()=>{const i=new WeakMap;return{render(a,s){const l=i.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=Ca(l,s);if(!c){const e={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=t(s,e)}return i.set(s,l),c?(await e(s,a.attack,l.attack),await e(s,a.knee,l.knee),await e(s,a.ratio,l.ratio),await e(s,a.release,l.release),await e(s,a.threshold,l.threshold)):(await r(s,a.attack,l.attack),await r(s,a.knee,l.knee),await r(s,a.ratio,l.ratio),await r(s,a.release,l.release),await r(s,a.threshold,l.threshold)),await o(a,s,l),l})(a,s)}}})(Ac,du,is,Ic,Gl),pu=((e,t,n,r,o,i,a,s)=>class extends e{constructor(e,o){const l=i(e),c={...Rs,...o},u=r(l,c),d=a(l);super(e,!1,u,d?n():null),this._attack=t(this,d,u.attack),this._knee=t(this,d,u.knee),this._nativeDynamicsCompressorNode=u,this._ratio=t(this,d,u.ratio),this._release=t(this,d,u.release),this._threshold=t(this,d,u.threshold),s(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(e){const t=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=e,e>2)throw this._nativeDynamicsCompressorNode.channelCount=t,o()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(e){const t=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=e,"max"===e)throw this._nativeDynamicsCompressorNode.channelCountMode=t,o()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"==typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}})(lc,Rc,hu,du,cl,$l,Ql,Dc),mu=((e,t,n,r,o)=>()=>{const i=new WeakMap;return{render(a,s){const l=i.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=Ca(l,s);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(s,e)}return i.set(s,l),c?await e(s,a.gain,l.gain):await r(s,a.gain,l.gain),await o(a,s,l),l})(a,s)}}})(Ac,il,is,Ic,Gl),gu=((e,t,n,r,o,i)=>class extends e{constructor(e,a){const s=o(e),l={...Ps,...a},c=r(s,l),u=i(s);super(e,!1,c,u?n():null),this._gain=t(this,u,c.gain,Pa,Ra)}get gain(){return this._gain}})(lc,Rc,mu,il,$l,Ql),vu=((e,t,n,r)=>(o,i,{channelCount:a,channelCountMode:s,channelInterpretation:l,feedback:c,feedforward:u})=>{const d=Xs(i,o.sampleRate),f=c instanceof Float64Array?c:new Float64Array(c),h=u instanceof Float64Array?u:new Float64Array(u),p=f.length,m=h.length,g=Math.min(p,m);if(0===p||p>20)throw r();if(0===f[0])throw t();if(0===m||m>20)throw r();if(0===h[0])throw t();if(1!==f[0]){for(let e=0;e<m;e+=1)h[e]/=f[0];for(let e=1;e<p;e+=1)f[e]/=f[0]}const v=n(o,d,a,a);v.channelCount=a,v.channelCountMode=s,v.channelInterpretation=l;const b=[],y=[],w=[];for(let e=0;e<a;e+=1){b.push(0);const e=new Float32Array(32),t=new Float32Array(32);e.fill(0),t.fill(0),y.push(e),w.push(t)}v.onaudioprocess=e=>{const t=e.inputBuffer,n=e.outputBuffer,r=t.numberOfChannels;for(let e=0;e<r;e+=1){const r=t.getChannelData(e),o=n.getChannelData(e);b[e]=js(f,p,h,m,g,y[e],w[e],b[e],32,r,o)}};const x=o.sampleRate/2;return rl({get bufferSize(){return d},get channelCount(){return v.channelCount},set channelCount(e){v.channelCount=e},get channelCountMode(){return v.channelCountMode},set channelCountMode(e){v.channelCountMode=e},get channelInterpretation(){return v.channelInterpretation},set channelInterpretation(e){v.channelInterpretation=e},get context(){return v.context},get inputs(){return[v]},get numberOfInputs(){return v.numberOfInputs},get numberOfOutputs(){return v.numberOfOutputs},addEventListener:(...e)=>v.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>v.dispatchEvent(e[0]),getFrequencyResponse(t,n,r){if(t.length!==n.length||n.length!==r.length)throw e();const o=t.length;for(let e=0;e<o;e+=1){const o=-Math.PI*(t[e]/x),i=[Math.cos(o),Math.sin(o)],a=al(sl(h,i),sl(f,i));n[e]=Math.sqrt(a[0]*a[0]+a[1]*a[1]),r[e]=Math.atan2(a[1],a[0])}},removeEventListener:(...e)=>v.removeEventListener(e[0],e[1],e[2])},v)})(Ls,Ns,ll,cl),bu=((e,t,n,r)=>o=>e(zs,(()=>zs(o)))?Promise.resolve(e(r,r)).then((e=>{if(!e){const e=n(o,512,0,1);o.oncomplete=()=>{e.onaudioprocess=null,e.disconnect()},e.onaudioprocess=()=>o.currentTime,e.connect(o.destination)}return o.startRendering()})):new Promise((e=>{const n=t(o,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});o.oncomplete=t=>{n.disconnect(),e(t.renderedBuffer)},n.connect(o.destination),o.startRendering()})))(Nl,il,ll,((e,t)=>()=>{if(null===t)return Promise.resolve(!1);const n=new t(1,1,44100),r=e(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise((e=>{n.oncomplete=()=>{r.disconnect(),e(0!==n.currentTime)},n.startRendering()}))})(il,Xl)),yu=((e,t,n,r,o)=>(i,a)=>{const s=new WeakMap;let l=null;const c=async(c,u)=>{let d=null,f=t(c);const h=Ca(f,u);if(void 0===u.createIIRFilter?d=e(u,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):h||(f=u.createIIRFilter(a,i)),s.set(u,null===d?f:d),null!==d){if(null===l){if(null===n)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new n(c.context.destination.channelCount,c.context.length,u.sampleRate);l=(async()=>{await r(c,e,e.destination);return((e,t,n,r)=>{const o=n instanceof Float64Array?n:new Float64Array(n),i=r instanceof Float64Array?r:new Float64Array(r),a=o.length,s=i.length,l=Math.min(a,s);if(1!==o[0]){for(let e=0;e<a;e+=1)i[e]/=o[0];for(let e=1;e<s;e+=1)o[e]/=o[0]}const c=new Float32Array(32),u=new Float32Array(32),d=t.createBuffer(e.numberOfChannels,e.length,e.sampleRate),f=e.numberOfChannels;for(let t=0;t<f;t+=1){const n=e.getChannelData(t),r=d.getChannelData(t);c.fill(0),u.fill(0),js(o,a,i,s,l,c,u,0,32,n,r)}return d})(await o(e),u,i,a)})()}const e=await l;return d.buffer=e,d.start(0),d}return await r(c,u,f),f};return{render(e,t){const n=s.get(t);return void 0!==n?Promise.resolve(n):c(e,t)}}})(kc,is,Xl,Gl,bu),wu=(xu=vu,(e,t,n)=>{if(void 0===e.createIIRFilter)return xu(e,t,n);const r=e.createIIRFilter(n.feedforward,n.feedback);return Gs(r,n),r});var xu;const Su=((e,t,n,r,o,i)=>class extends e{constructor(e,a){const s=r(e),l=o(s),c={...Ds,...a},u=t(s,l?null:e.baseLatency,c);super(e,!1,u,l?n(c.feedback,c.feedforward):null),Bs(u),this._nativeIIRFilterNode=u,i(this,1)}getFrequencyResponse(e,t,n){return this._nativeIIRFilterNode.getFrequencyResponse(e,t,n)}})(lc,wu,yu,$l,Ql,Dc),Mu=((e,t,n,r,o,i,a,s)=>(l,c)=>{const u=c.listener,{forwardX:d,forwardY:f,forwardZ:h,positionX:p,positionY:m,positionZ:g,upX:v,upY:b,upZ:y}=void 0===u.forwardX?(()=>{const d=new Float32Array(1),f=t(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),h=a(c);let p=!1,m=[0,0,-1,0,1,0],g=[0,0,0];const v=()=>{if(p)return;p=!0;const e=r(c,256,9,0);e.onaudioprocess=({inputBuffer:e})=>{const t=[i(e,d,0),i(e,d,1),i(e,d,2),i(e,d,3),i(e,d,4),i(e,d,5)];t.some(((e,t)=>e!==m[t]))&&(u.setOrientation(...t),m=t);const n=[i(e,d,6),i(e,d,7),i(e,d,8)];n.some(((e,t)=>e!==g[t]))&&(u.setPosition(...n),g=n)},f.connect(e)},b=e=>t=>{t!==m[e]&&(m[e]=t,u.setOrientation(...m))},y=e=>t=>{t!==g[e]&&(g[e]=t,u.setPosition(...g))},w=(t,r,i)=>{const a=n(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:r});a.connect(f,0,t),a.start(),Object.defineProperty(a.offset,"defaultValue",{get:()=>r});const u=e({context:l},h,a.offset,Pa,Ra);var d,p,m,g,b,y,w;return s(u,"value",(e=>()=>e.call(u)),(e=>t=>{try{e.call(u,t)}catch(e){if(9!==e.code)throw e}v(),h&&i(t)})),u.cancelAndHoldAtTime=(d=u.cancelAndHoldAtTime,h?()=>{throw o()}:(...e)=>{const t=d.apply(u,e);return v(),t}),u.cancelScheduledValues=(p=u.cancelScheduledValues,h?()=>{throw o()}:(...e)=>{const t=p.apply(u,e);return v(),t}),u.exponentialRampToValueAtTime=(m=u.exponentialRampToValueAtTime,h?()=>{throw o()}:(...e)=>{const t=m.apply(u,e);return v(),t}),u.linearRampToValueAtTime=(g=u.linearRampToValueAtTime,h?()=>{throw o()}:(...e)=>{const t=g.apply(u,e);return v(),t}),u.setTargetAtTime=(b=u.setTargetAtTime,h?()=>{throw o()}:(...e)=>{const t=b.apply(u,e);return v(),t}),u.setValueAtTime=(y=u.setValueAtTime,h?()=>{throw o()}:(...e)=>{const t=y.apply(u,e);return v(),t}),u.setValueCurveAtTime=(w=u.setValueCurveAtTime,h?()=>{throw o()}:(...e)=>{const t=w.apply(u,e);return v(),t}),u};return{forwardX:w(0,0,b(0)),forwardY:w(1,0,b(1)),forwardZ:w(2,-1,b(2)),positionX:w(6,0,y(0)),positionY:w(7,0,y(1)),positionZ:w(8,0,y(2)),upX:w(3,0,b(3)),upY:w(4,1,b(4)),upZ:w(5,0,b(5))}})():u;return{get forwardX(){return d},get forwardY(){return f},get forwardZ(){return h},get positionX(){return p},get positionY(){return m},get positionZ(){return g},get upX(){return v},get upY(){return b},get upZ(){return y}}})(Rc,Qc,ru,ll,cl,vl,Ql,yl),_u=new WeakMap,Eu=((e,t,n,r,o,i)=>class extends n{constructor(n,i){super(n),this._nativeContext=n,sa.set(this,n),r(n)&&o.set(n,new Set),this._destination=new e(this,i),this._listener=t(this,n),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(e){const t="function"==typeof e?i(this,e):null;this._nativeContext.onstatechange=t;const n=this._nativeContext.onstatechange;this._onstatechange=null!==n&&n===t?e:n}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}})(Lc,Mu,ec,Ql,_u,El),Au=((e,t,n,r,o,i)=>(a,s)=>{const l=a.createOscillator();return Gs(l,s),Vs(l,s,"detune"),Vs(l,s,"frequency"),void 0!==s.periodicWave?l.setPeriodicWave(s.periodicWave):Hs(l,s,"type"),t(n,(()=>n(a)))||Ks(l),t(r,(()=>r(a)))||i(l,a),t(o,(()=>o(a)))||$s(l),e(a,l),l})(wc,Nl,xl,Sl,Ml,_l),Cu=((e,t,n,r,o)=>()=>{const i=new WeakMap;let a=null,s=null,l=null;return{set periodicWave(e){a=e},set start(e){s=e},set stop(e){l=e},render(c,u){const d=i.get(u);return void 0!==d?Promise.resolve(d):(async(c,u)=>{let d=n(c);const f=Ca(d,u);if(!f){const e={channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,detune:d.detune.value,frequency:d.frequency.value,periodicWave:null===a?void 0:a,type:d.type};d=t(u,e),null!==s&&d.start(s),null!==l&&d.stop(l)}return i.set(u,d),f?(await e(u,c.detune,d.detune),await e(u,c.frequency,d.frequency)):(await r(u,c.detune,d.detune),await r(u,c.frequency,d.frequency)),await o(c,u,d),d})(c,u)}}})(Ac,Au,is,Ic,Gl),ku=((e,t,n,r,o,i,a)=>class extends e{constructor(e,a){const s=o(e),l={...dl,...a},c=n(s,l),u=i(s),d=u?r():null,f=e.sampleRate/2;super(e,!1,c,d),this._detune=t(this,u,c.detune,153600,-153600),this._frequency=t(this,u,c.frequency,f,-f),this._nativeOscillatorNode=c,this._onended=null,this._oscillatorNodeRenderer=d,null!==this._oscillatorNodeRenderer&&void 0!==l.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=l.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(this,e):null;this._nativeOscillatorNode.onended=t;const n=this._nativeOscillatorNode.onended;this._onended=null!==n&&n===t?e:n}get type(){return this._nativeOscillatorNode.type}set type(e){this._nativeOscillatorNode.type=e,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(e){this._nativeOscillatorNode.setPeriodicWave(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=e)}start(e=0){if(this._nativeOscillatorNode.start(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=e),"closed"!==this.context.state){Sa(this);const e=()=>{this._nativeOscillatorNode.removeEventListener("ended",e),Na(this)&&_a(this)};this._nativeOscillatorNode.addEventListener("ended",e)}}stop(e=0){this._nativeOscillatorNode.stop(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=e)}})(lc,Rc,Au,Cu,$l,Ql,El),Tu=(Iu=kc,(e,t)=>{const n=Iu(e,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),r=e.createBuffer(1,2,44100);return n.buffer=r,n.loop=!0,n.connect(t),n.start(),()=>{n.stop(),n.disconnect(t)}});var Iu;const Ou=((e,t,n,r,o)=>(i,{curve:a,oversample:s,...l})=>{const c=i.createWaveShaper(),u=i.createWaveShaper();Gs(c,l),Gs(u,l);const d=n(i,{...l,gain:1}),f=n(i,{...l,gain:-1}),h=n(i,{...l,gain:1}),p=n(i,{...l,gain:-1});let m=null,g=!1,v=null;const b={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){d.channelCount=e,f.channelCount=e,c.channelCount=e,h.channelCount=e,u.channelCount=e,p.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){d.channelCountMode=e,f.channelCountMode=e,c.channelCountMode=e,h.channelCountMode=e,u.channelCountMode=e,p.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){d.channelInterpretation=e,f.channelInterpretation=e,c.channelInterpretation=e,h.channelInterpretation=e,u.channelInterpretation=e,p.channelInterpretation=e},get context(){return c.context},get curve(){return v},set curve(n){if(null!==n&&n.length<2)throw t();if(null===n)c.curve=n,u.curve=n;else{const e=n.length,t=new Float32Array(e+2-e%2),r=new Float32Array(e+2-e%2);t[0]=n[0],r[0]=-n[e-1];const o=Math.ceil((e+1)/2),i=(e+1)/2-1;for(let a=1;a<o;a+=1){const s=a/o*i,l=Math.floor(s),c=Math.ceil(s);t[a]=l===c?n[l]:(1-(s-l))*n[l]+(1-(c-s))*n[c],r[a]=l===c?-n[e-1-l]:-(1-(s-l))*n[e-1-l]-(1-(c-s))*n[e-1-c]}t[o]=e%2==1?n[o-1]:(n[o-2]+n[o-1])/2,c.curve=t,u.curve=r}v=n,g&&(r(v)&&null===m?m=e(i,d):null!==m&&(m(),m=null))},get inputs(){return[d]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get oversample(){return c.oversample},set oversample(e){c.oversample=e,u.oversample=e},addEventListener:(...e)=>d.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>d.dispatchEvent(e[0]),removeEventListener:(...e)=>d.removeEventListener(e[0],e[1],e[2])};null!==a&&(b.curve=a instanceof Float32Array?a:new Float32Array(a)),s!==b.oversample&&(b.oversample=s);return o(rl(b,h),(()=>{d.connect(c).connect(h),d.connect(f).connect(u).connect(p).connect(h),g=!0,r(v)&&(m=e(i,d))}),(()=>{d.disconnect(c),c.disconnect(h),d.disconnect(f),f.disconnect(u),u.disconnect(p),p.disconnect(h),g=!1,null!==m&&(m(),m=null)}))})(Tu,Ns,il,bl,Kc),Ru=((e,t,n,r,o,i,a)=>(s,l)=>{const c=s.createWaveShaper();if(null!==i&&"webkitAudioContext"===i.name&&void 0===s.createGain().gain.automationRate)return n(s,l);Gs(c,l);const u=null===l.curve||l.curve instanceof Float32Array?l.curve:new Float32Array(l.curve);if(null!==u&&u.length<2)throw t();Hs(c,{curve:u},"curve"),Hs(c,l,"oversample");let d=null,f=!1;a(c,"curve",(e=>()=>e.call(c)),(t=>n=>(t.call(c,n),f&&(r(n)&&null===d?d=e(s,c):r(n)||null===d||(d(),d=null)),n)));return o(c,(()=>{f=!0,r(c.curve)&&(d=e(s,c))}),(()=>{f=!1,null!==d&&(d(),d=null)}))})(Tu,Ns,Ou,bl,Kc,nc,yl),Pu=((e,t,n,r,o,i,a,s,l,c)=>(u,{coneInnerAngle:d,coneOuterAngle:f,coneOuterGain:h,distanceModel:p,maxDistance:m,orientationX:g,orientationY:v,orientationZ:b,panningModel:y,positionX:w,positionY:x,positionZ:S,refDistance:M,rolloffFactor:_,...E})=>{const A=u.createPanner();if(E.channelCount>2)throw a();if("max"===E.channelCountMode)throw a();Gs(A,E);const C={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},k=n(u,{...C,channelInterpretation:"speakers",numberOfInputs:6}),T=r(u,{...E,gain:1}),I=r(u,{...C,gain:1}),O=r(u,{...C,gain:0}),R=r(u,{...C,gain:0}),P=r(u,{...C,gain:0}),N=r(u,{...C,gain:0}),L=r(u,{...C,gain:0}),B=o(u,256,6,1),D=i(u,{...C,curve:new Float32Array([1,1]),oversample:"none"});let j=[g,v,b],F=[w,x,S];const z=new Float32Array(1);B.onaudioprocess=({inputBuffer:e})=>{const t=[l(e,z,0),l(e,z,1),l(e,z,2)];t.some(((e,t)=>e!==j[t]))&&(A.setOrientation(...t),j=t);const n=[l(e,z,3),l(e,z,4),l(e,z,5)];n.some(((e,t)=>e!==F[t]))&&(A.setPosition(...n),F=n)},Object.defineProperty(O.gain,"defaultValue",{get:()=>0}),Object.defineProperty(R.gain,"defaultValue",{get:()=>0}),Object.defineProperty(P.gain,"defaultValue",{get:()=>0}),Object.defineProperty(N.gain,"defaultValue",{get:()=>0}),Object.defineProperty(L.gain,"defaultValue",{get:()=>0});const U={get bufferSize(){},get channelCount(){return A.channelCount},set channelCount(e){if(e>2)throw a();T.channelCount=e,A.channelCount=e},get channelCountMode(){return A.channelCountMode},set channelCountMode(e){if("max"===e)throw a();T.channelCountMode=e,A.channelCountMode=e},get channelInterpretation(){return A.channelInterpretation},set channelInterpretation(e){T.channelInterpretation=e,A.channelInterpretation=e},get coneInnerAngle(){return A.coneInnerAngle},set coneInnerAngle(e){A.coneInnerAngle=e},get coneOuterAngle(){return A.coneOuterAngle},set coneOuterAngle(e){A.coneOuterAngle=e},get coneOuterGain(){return A.coneOuterGain},set coneOuterGain(e){if(e<0||e>1)throw t();A.coneOuterGain=e},get context(){return A.context},get distanceModel(){return A.distanceModel},set distanceModel(e){A.distanceModel=e},get inputs(){return[T]},get maxDistance(){return A.maxDistance},set maxDistance(e){if(e<0)throw new RangeError;A.maxDistance=e},get numberOfInputs(){return A.numberOfInputs},get numberOfOutputs(){return A.numberOfOutputs},get orientationX(){return I.gain},get orientationY(){return O.gain},get orientationZ(){return R.gain},get panningModel(){return A.panningModel},set panningModel(e){A.panningModel=e},get positionX(){return P.gain},get positionY(){return N.gain},get positionZ(){return L.gain},get refDistance(){return A.refDistance},set refDistance(e){if(e<0)throw new RangeError;A.refDistance=e},get rolloffFactor(){return A.rolloffFactor},set rolloffFactor(e){if(e<0)throw new RangeError;A.rolloffFactor=e},addEventListener:(...e)=>T.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>T.dispatchEvent(e[0]),removeEventListener:(...e)=>T.removeEventListener(e[0],e[1],e[2])};d!==U.coneInnerAngle&&(U.coneInnerAngle=d),f!==U.coneOuterAngle&&(U.coneOuterAngle=f),h!==U.coneOuterGain&&(U.coneOuterGain=h),p!==U.distanceModel&&(U.distanceModel=p),m!==U.maxDistance&&(U.maxDistance=m),g!==U.orientationX.value&&(U.orientationX.value=g),v!==U.orientationY.value&&(U.orientationY.value=v),b!==U.orientationZ.value&&(U.orientationZ.value=b),y!==U.panningModel&&(U.panningModel=y),w!==U.positionX.value&&(U.positionX.value=w),x!==U.positionY.value&&(U.positionY.value=x),S!==U.positionZ.value&&(U.positionZ.value=S),M!==U.refDistance&&(U.refDistance=M),_!==U.rolloffFactor&&(U.rolloffFactor=_),1===j[0]&&0===j[1]&&0===j[2]||A.setOrientation(...j),0===F[0]&&0===F[1]&&0===F[2]||A.setPosition(...F);return c(rl(U,A),(()=>{T.connect(A),e(T,D,0,0),D.connect(I).connect(k,0,0),D.connect(O).connect(k,0,1),D.connect(R).connect(k,0,2),D.connect(P).connect(k,0,3),D.connect(N).connect(k,0,4),D.connect(L).connect(k,0,5),k.connect(B).connect(u.destination)}),(()=>{T.disconnect(A),s(T,D,0,0),D.disconnect(I),I.disconnect(k),D.disconnect(O),O.disconnect(k),D.disconnect(R),R.disconnect(k),D.disconnect(P),P.disconnect(k),D.disconnect(N),N.disconnect(k),D.disconnect(L),L.disconnect(k),k.disconnect(B),B.disconnect(u.destination)}))})(Za,Ns,Qc,il,ll,Ru,cl,os,vl,Kc),Nu=(Lu=Pu,(e,t)=>{const n=e.createPanner();return void 0===n.orientationX?Lu(e,t):(Gs(n,t),Vs(n,t,"orientationX"),Vs(n,t,"orientationY"),Vs(n,t,"orientationZ"),Vs(n,t,"positionX"),Vs(n,t,"positionY"),Vs(n,t,"positionZ"),Hs(n,t,"coneInnerAngle"),Hs(n,t,"coneOuterAngle"),Hs(n,t,"coneOuterGain"),Hs(n,t,"distanceModel"),Hs(n,t,"maxDistance"),Hs(n,t,"panningModel"),Hs(n,t,"refDistance"),Hs(n,t,"rolloffFactor"),n)});var Lu;const Bu=((e,t,n,r,o,i,a,s,l,c)=>()=>{const u=new WeakMap;let d=null;return{render(f,h){const p=u.get(h);return void 0!==p?Promise.resolve(p):(async(f,h)=>{let p=null,m=i(f);const g={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},v={...g,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},b=Ca(m,h);if("bufferSize"in m)p=r(h,{...g,gain:1});else if(!b){const e={...v,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=o(h,e)}if(u.set(h,null===p?m:p),null!==p){if(null===d){if(null===a)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new a(6,f.context.length,h.sampleRate),r=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});r.connect(e.destination),d=(async()=>{const t=await Promise.all([f.orientationX,f.orientationY,f.orientationZ,f.positionX,f.positionY,f.positionZ].map((async(t,r)=>{const o=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===r?1:0});return await s(e,t,o.offset),o})));for(let e=0;e<6;e+=1)t[e].connect(r,0,e),t[e].start(0);return c(e)})()}const e=await d,i=r(h,{...g,gain:1});await l(f,h,i);const u=[];for(let t=0;t<e.numberOfChannels;t+=1)u.push(e.getChannelData(t));let m=[u[0][0],u[1][0],u[2][0]],b=[u[3][0],u[4][0],u[5][0]],y=r(h,{...g,gain:1}),w=o(h,{...v,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:b[0],positionY:b[1],positionZ:b[2]});i.connect(y).connect(w.inputs[0]),w.connect(p);for(let t=128;t<e.length;t+=128){const e=[u[0][t],u[1][t],u[2][t]],n=[u[3][t],u[4][t],u[5][t]];if(e.some(((e,t)=>e!==m[t]))||n.some(((e,t)=>e!==b[t]))){m=e,b=n;const a=t/h.sampleRate;y.gain.setValueAtTime(0,a),y=r(h,{...g,gain:0}),w=o(h,{...v,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:b[0],positionY:b[1],positionZ:b[2]}),y.gain.setValueAtTime(1,a),i.connect(y).connect(w.inputs[0]),w.connect(p)}}return p}return b?(await e(h,f.orientationX,m.orientationX),await e(h,f.orientationY,m.orientationY),await e(h,f.orientationZ,m.orientationZ),await e(h,f.positionX,m.positionX),await e(h,f.positionY,m.positionY),await e(h,f.positionZ,m.positionZ)):(await s(h,f.orientationX,m.orientationX),await s(h,f.orientationY,m.orientationY),await s(h,f.orientationZ,m.orientationZ),await s(h,f.positionX,m.positionX),await s(h,f.positionY,m.positionY),await s(h,f.positionZ,m.positionZ)),Ya(m)?await l(f,h,m.inputs[0]):await l(f,h,m),m})(f,h)}}})(Ac,Qc,ru,il,Nu,is,Xl,Ic,Gl,bu),Du=((e,t,n,r,o,i,a)=>class extends e{constructor(e,s){const l=o(e),c={...fl,...s},u=n(l,c),d=i(l);super(e,!1,u,d?r():null),this._nativePannerNode=u,this._orientationX=t(this,d,u.orientationX,Pa,Ra),this._orientationY=t(this,d,u.orientationY,Pa,Ra),this._orientationZ=t(this,d,u.orientationZ,Pa,Ra),this._positionX=t(this,d,u.positionX,Pa,Ra),this._positionY=t(this,d,u.positionY,Pa,Ra),this._positionZ=t(this,d,u.positionZ,Pa,Ra),a(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(e){this._nativePannerNode.coneInnerAngle=e}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(e){this._nativePannerNode.coneOuterAngle=e}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(e){this._nativePannerNode.coneOuterGain=e}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(e){this._nativePannerNode.distanceModel=e}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(e){this._nativePannerNode.maxDistance=e}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(e){this._nativePannerNode.panningModel=e}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(e){this._nativePannerNode.refDistance=e}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(e){this._nativePannerNode.rolloffFactor=e}})(lc,Rc,Nu,Bu,$l,Ql,Dc),ju=(e=>(t,{disableNormalization:n,imag:r,real:o})=>{const i=r instanceof Float32Array?r:new Float32Array(r),a=o instanceof Float32Array?o:new Float32Array(o),s=t.createPeriodicWave(a,i,{disableNormalization:n});if(Array.from(r).length<2)throw e();return s})(Ta),Fu=((e,t,n,r)=>class o{constructor(o,i){const a=t(o),s=r({...hl,...i}),l=e(a,s);return n.add(l),l}static[Symbol.hasInstance](e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===o.prototype||n.has(e)}})(ju,$l,new WeakSet,(e=>{const{imag:t,real:n}=e;return void 0===t?void 0===n?{...e,imag:[0,0],real:[0,0]}:{...e,imag:Array.from(n,(()=>0)),real:n}:void 0===n?{...e,imag:t,real:Array.from(t,(()=>0))}:{...e,imag:t,real:n}})),zu=((e,t,n,r,o,i)=>{const a=16385,s=new Float32Array([1,1]),l=Math.PI/2,c={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...c,oversample:"none"},d=(e,i,d,f,h)=>{if(1===i)return((e,t,o,i)=>{const d=new Float32Array(a),f=new Float32Array(a);for(let e=0;e<a;e+=1){const t=e/16384*l;d[e]=Math.cos(t),f[e]=Math.sin(t)}const h=n(e,{...c,gain:0}),p=r(e,{...u,curve:d}),m=r(e,{...u,curve:s}),g=n(e,{...c,gain:0}),v=r(e,{...u,curve:f});return{connectGraph(){t.connect(h),t.connect(void 0===m.inputs?m:m.inputs[0]),t.connect(g),m.connect(o),o.connect(void 0===p.inputs?p:p.inputs[0]),o.connect(void 0===v.inputs?v:v.inputs[0]),p.connect(h.gain),v.connect(g.gain),h.connect(i,0,0),g.connect(i,0,1)},disconnectGraph(){t.disconnect(h),t.disconnect(void 0===m.inputs?m:m.inputs[0]),t.disconnect(g),m.disconnect(o),o.disconnect(void 0===p.inputs?p:p.inputs[0]),o.disconnect(void 0===v.inputs?v:v.inputs[0]),p.disconnect(h.gain),v.disconnect(g.gain),h.disconnect(i,0,0),g.disconnect(i,0,1)}}})(e,d,f,h);if(2===i)return((e,o,i,d)=>{const f=new Float32Array(a),h=new Float32Array(a),p=new Float32Array(a),m=new Float32Array(a),g=Math.floor(8192.5);for(let e=0;e<a;e+=1)if(e>g){const t=(e-g)/(16384-g)*l;f[e]=Math.cos(t),h[e]=Math.sin(t),p[e]=0,m[e]=1}else{const t=e/(16384-g)*l;f[e]=1,h[e]=0,p[e]=Math.cos(t),m[e]=Math.sin(t)}const v=t(e,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),b=n(e,{...c,gain:0}),y=r(e,{...u,curve:f}),w=n(e,{...c,gain:0}),x=r(e,{...u,curve:h}),S=r(e,{...u,curve:s}),M=n(e,{...c,gain:0}),_=r(e,{...u,curve:p}),E=n(e,{...c,gain:0}),A=r(e,{...u,curve:m});return{connectGraph(){o.connect(v),o.connect(void 0===S.inputs?S:S.inputs[0]),v.connect(b,0),v.connect(w,0),v.connect(M,1),v.connect(E,1),S.connect(i),i.connect(void 0===y.inputs?y:y.inputs[0]),i.connect(void 0===x.inputs?x:x.inputs[0]),i.connect(void 0===_.inputs?_:_.inputs[0]),i.connect(void 0===A.inputs?A:A.inputs[0]),y.connect(b.gain),x.connect(w.gain),_.connect(M.gain),A.connect(E.gain),b.connect(d,0,0),M.connect(d,0,0),w.connect(d,0,1),E.connect(d,0,1)},disconnectGraph(){o.disconnect(v),o.disconnect(void 0===S.inputs?S:S.inputs[0]),v.disconnect(b,0),v.disconnect(w,0),v.disconnect(M,1),v.disconnect(E,1),S.disconnect(i),i.disconnect(void 0===y.inputs?y:y.inputs[0]),i.disconnect(void 0===x.inputs?x:x.inputs[0]),i.disconnect(void 0===_.inputs?_:_.inputs[0]),i.disconnect(void 0===A.inputs?A:A.inputs[0]),y.disconnect(b.gain),x.disconnect(w.gain),_.disconnect(M.gain),A.disconnect(E.gain),b.disconnect(d,0,0),M.disconnect(d,0,0),w.disconnect(d,0,1),E.disconnect(d,0,1)}}})(e,d,f,h);throw o()};return(t,{channelCount:r,channelCountMode:a,pan:s,...l})=>{if("max"===a)throw o();const c=e(t,{...l,channelCount:1,channelCountMode:a,numberOfInputs:2}),u=n(t,{...l,channelCount:r,channelCountMode:a,gain:1}),f=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:s});let{connectGraph:h,disconnectGraph:p}=d(t,r,u,f,c);Object.defineProperty(f.gain,"defaultValue",{get:()=>0}),Object.defineProperty(f.gain,"maxValue",{get:()=>1}),Object.defineProperty(f.gain,"minValue",{get:()=>-1});const m={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){u.channelCount!==e&&(g&&p(),({connectGraph:h,disconnectGraph:p}=d(t,e,u,f,c)),g&&h()),u.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){if("clamped-max"===e||"max"===e)throw o();u.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){u.channelInterpretation=e},get context(){return u.context},get inputs(){return[u]},get numberOfInputs(){return u.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get pan(){return f.gain},addEventListener:(...e)=>u.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>u.dispatchEvent(e[0]),removeEventListener:(...e)=>u.removeEventListener(e[0],e[1],e[2])};let g=!1;return i(rl(m,c),(()=>{h(),g=!0}),(()=>{p(),g=!1}))}})(Qc,nl,il,Ru,cl,Kc),Uu=((e,t)=>(n,r)=>{const o=r.channelCountMode;if("clamped-max"===o)throw t();if(void 0===n.createStereoPanner)return e(n,r);const i=n.createStereoPanner();return Gs(i,r),Vs(i,r,"pan"),Object.defineProperty(i,"channelCountMode",{get:()=>o,set:e=>{if(e!==o)throw t()}}),i})(zu,cl),Hu=((e,t,n,r,o)=>()=>{const i=new WeakMap;return{render(a,s){const l=i.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=Ca(l,s);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(s,e)}return i.set(s,l),c?await e(s,a.pan,l.pan):await r(s,a.pan,l.pan),Ya(l)?await o(a,s,l.inputs[0]):await o(a,s,l),l})(a,s)}}})(Ac,Uu,is,Ic,Gl),Gu=((e,t,n,r,o,i)=>class extends e{constructor(e,a){const s=o(e),l={...pl,...a},c=n(s,l),u=i(s);super(e,!1,c,u?r():null),this._pan=t(this,u,c.pan)}get pan(){return this._pan}})(lc,Rc,Uu,Hu,$l,Ql),Wu=((e,t,n)=>()=>{const r=new WeakMap;return{render(o,i){const a=r.get(i);return void 0!==a?Promise.resolve(a):(async(o,i)=>{let a=t(o);if(!Ca(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=e(i,t)}return r.set(i,a),Ya(a)?await n(o,i,a.inputs[0]):await n(o,i,a),a})(o,i)}}})(Ru,is,Gl),Vu=((e,t,n,r,o,i,a)=>class extends e{constructor(e,t){const s=o(e),l={...gl,...t},c=n(s,l);super(e,!0,c,i(s)?r():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=c,a(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(e){if(null===e)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(e.length<2)throw t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=e}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(e){this._nativeWaveShaperNode.oversample=e}})(lc,Ns,Ru,Wu,$l,Ql,Dc),qu=(e=>null!==e&&e.isSecureContext)(Dl),Ku=(e=>(t,n,r)=>{Object.defineProperties(e,{currentFrame:{configurable:!0,get:()=>Math.round(t*n)},currentTime:{configurable:!0,get:()=>t}});try{return r()}finally{null!==e&&(delete e.currentFrame,delete e.currentTime)}})(Dl),$u=new WeakMap,Ju=((e,t)=>n=>{let r=e.get(n);if(void 0!==r)return r;if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");return r=new t(1,1,44100),e.set(n,r),r})($u,Xl),Xu=qu?((e,t,n,r,o,i,a,s,l,c,u,d,f)=>{let h=0;return(p,m,g={credentials:"omit"})=>{const v=u.get(p);if(void 0!==v&&v.has(m))return Promise.resolve();const b=c.get(p);if(void 0!==b){const e=b.get(m);if(void 0!==e)return e}const y=i(p),w=void 0===y.audioWorklet?o(m).then((([e,t])=>{const[r,o]=ma(e,t);return n(`${r};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${o}\n})})(window,'_AWGS')`)})).then((()=>{const e=f._AWGS.pop();if(void 0===e)throw new SyntaxError;r(y.currentTime,y.sampleRate,(()=>e(class{},void 0,((e,n)=>{if(""===e.trim())throw t();const r=ua.get(y);if(void 0!==r){if(r.has(e))throw t();va(n),ga(n.parameterDescriptors),r.set(e,n)}else va(n),ga(n.parameterDescriptors),ua.set(y,new Map([[e,n]]))}),y.sampleRate,void 0,void 0)))})):Promise.all([o(m),Promise.resolve(e(d,d))]).then((([[e,t],n])=>{const r=h+1;h=r;const[o,i]=ma(e,t),c=new Blob([`${o};((AudioWorkletProcessor,registerProcessor)=>{${i}\n})(${n?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${n?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${n?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${r}',class extends AudioWorkletProcessor{process(){return !1}})`],{type:"application/javascript; charset=utf-8"}),u=URL.createObjectURL(c);return y.audioWorklet.addModule(u,g).then((()=>{if(s(y))return y;const e=a(y);return e.audioWorklet.addModule(u,g).then((()=>e))})).then((e=>{if(null===l)throw new SyntaxError;try{new l(e,`__sac${r}`)}catch{throw new SyntaxError}})).finally((()=>URL.revokeObjectURL(u)))}));return void 0===b?c.set(p,new Map([[m,w]])):b.set(m,w),w.then((()=>{const e=u.get(p);void 0===e?u.set(p,new Set([m])):e.add(m)})).finally((()=>{const e=c.get(p);void 0!==e&&e.delete(m)})),w}})(Nl,cl,(e=>t=>new Promise(((n,r)=>{if(null===e)return void r(new SyntaxError);const o=e.document.head;if(null===o)r(new SyntaxError);else{const i=e.document.createElement("script"),a=new Blob([t],{type:"application/javascript"}),s=URL.createObjectURL(a),l=e.onerror,c=()=>{e.onerror=l,URL.revokeObjectURL(s)};e.onerror=(t,n,o,i,a)=>n===s||n===e.location.href&&1===o&&1===i?(c(),r(a),!1):null!==l?l(t,n,o,i,a):void 0,i.onerror=()=>{c(),r(new SyntaxError)},i.onload=()=>{c(),n()},i.src=s,i.type="module",o.appendChild(i)}})))(Dl),Ku,(Qu=()=>new DOMException("","AbortError"),async e=>{try{const t=await fetch(e);if(t.ok)return[await t.text(),t.url]}catch{}throw Qu()}),$l,Ju,Ql,sc,new WeakMap,new WeakMap,((e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const n=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),r=new t(1,128,44100),o=URL.createObjectURL(n);let i=!1,a=!1;try{await r.audioWorklet.addModule(o);const t=new e(r,"a",{numberOfOutputs:0}),n=r.createOscillator();t.port.onmessage=()=>i=!0,t.onprocessorerror=()=>a=!0,n.connect(t),n.start(0),await r.startRendering()}catch{}finally{URL.revokeObjectURL(o)}return i&&!a})(sc,Xl),Dl):void 0;var Qu;const Yu=((e,t)=>n=>e(n)||t(n))(rc,Ql),Zu=((e,t,n,r,o,i,a,s,l,c,u)=>(d,f)=>{const h=a(d)?d:i(d);if(o.has(f)){const e=n();return Promise.reject(e)}try{o.add(f)}catch{}return t(l,(()=>l(h)))?h.decodeAudioData(f).then((n=>(ks(f).catch((()=>{})),t(s,(()=>s(n)))||u(n),e.add(n),n))):new Promise(((t,n)=>{const o=async()=>{try{await ks(f)}catch{}},i=e=>{n(e),o()};try{h.decodeAudioData(f,(n=>{"function"!=typeof n.copyFromChannel&&(c(n),Ia(n)),e.add(n),o().then((()=>t(n)))}),(e=>{i(null===e?r():e)}))}catch(e){i(e)}}))})(dc,Nl,(()=>new DOMException("","DataCloneError")),(()=>new DOMException("","EncodingError")),new WeakSet,$l,Yu,ka,zs,mc,gc),ed=(td=Xu,nd=uc,rd=bc,od=Nc,id=jc,ad=Zc,sd=tu,ld=iu,cd=lu,ud=Zu,dd=uu,fd=pu,hd=gu,pd=Su,md=Eu,gd=ku,vd=Du,bd=Fu,yd=Gu,wd=Vu,class extends md{constructor(e,t){super(e,t),this._nativeContext=e,this._audioWorklet=void 0===td?void 0:{addModule:(e,t)=>td(this,e,t)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new nd(this)}createBiquadFilter(){return new id(this)}createBuffer(e,t,n){return new rd({length:t,numberOfChannels:e,sampleRate:n})}createBufferSource(){return new od(this)}createChannelMerger(e=6){return new ad(this,{numberOfInputs:e})}createChannelSplitter(e=6){return new sd(this,{numberOfOutputs:e})}createConstantSource(){return new ld(this)}createConvolver(){return new cd(this)}createDelay(e=1){return new dd(this,{maxDelayTime:e})}createDynamicsCompressor(){return new fd(this)}createGain(){return new hd(this)}createIIRFilter(e,t){return new pd(this,{feedback:t,feedforward:e})}createOscillator(){return new gd(this)}createPanner(){return new vd(this)}createPeriodicWave(e,t,n={disableNormalization:!1}){return new bd(this,{...n,imag:t,real:e})}createStereoPanner(){return new yd(this)}createWaveShaper(){return new wd(this)}decodeAudioData(e,t,n){return ud(this._nativeContext,e).then((e=>("function"==typeof t&&t(e),e)),(e=>{throw"function"==typeof n&&n(e),e}))}});var td,nd,rd,od,id,ad,sd,ld,cd,ud,dd,fd,hd,pd,md,gd,vd,bd,yd,wd;const xd=((e,t,n,r)=>class extends e{constructor(e,o){const i=n(e),a=t(i,o);if(r(i))throw TypeError();super(e,!0,a,null),this._nativeMediaElementAudioSourceNode=a}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}})(lc,((e,t)=>e.createMediaElementSource(t.mediaElement)),$l,Ql),Sd=((e,t,n,r)=>class extends e{constructor(e,o){const i=n(e);if(r(i))throw new TypeError;const a={...Fs,...o},s=t(i,a);super(e,!1,s,null),this._nativeMediaStreamAudioDestinationNode=s}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}})(lc,((e,t)=>{const n=e.createMediaStreamDestination();return Gs(n,t),1===n.numberOfOutputs&&Object.defineProperty(n,"numberOfOutputs",{get:()=>0}),n}),$l,Ql),Md=((e,t,n,r)=>class extends e{constructor(e,o){const i=n(e),a=t(i,o);if(r(i))throw new TypeError;super(e,!0,a,null),this._nativeMediaStreamAudioSourceNode=a}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}})(lc,((e,{mediaStream:t})=>{const n=t.getAudioTracks();n.sort(((e,t)=>e.id<t.id?-1:e.id>t.id?1:0));const r=n.slice(0,1),o=e.createMediaStreamSource(new MediaStream(r));return Object.defineProperty(o,"mediaStream",{value:t}),o}),$l,Ql),_d=((e,t)=>(n,{mediaStreamTrack:r})=>{if("function"==typeof n.createMediaStreamTrackSource)return n.createMediaStreamTrackSource(r);const o=new MediaStream([r]),i=n.createMediaStreamSource(o);if("audio"!==r.kind)throw e();if(t(n))throw new TypeError;return i})(Ns,Ql),Ed=((e,t,n)=>class extends e{constructor(e,r){const o=n(e);super(e,!0,t(o,r),null)}})(lc,_d,$l),Ad=((e,t,n,r,o,i,a,s,l)=>class extends e{constructor(e={}){if(null===l)throw new Error("Missing the native AudioContext constructor.");let t;try{t=new l(e)}catch(e){if(12===e.code&&"sampleRate is not in range"===e.message)throw n();throw e}if(null===t)throw r();if(!qa(e.latencyHint))throw new TypeError(`The provided value '${e.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==e.sampleRate&&t.sampleRate!==e.sampleRate)throw n();super(t,2);const{latencyHint:o}=e,{sampleRate:i}=t;if(this._baseLatency="number"==typeof t.baseLatency?t.baseLatency:"balanced"===o?512/i:"interactive"===o||void 0===o?256/i:"playback"===o?1024/i:128*Math.max(2,Math.min(128,Math.round(o*i/128)))/i,this._nativeAudioContext=t,"webkitAudioContext"===l.name?(this._nativeGainNode=t.createGain(),this._nativeOscillatorNode=t.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(t.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===t.state){this._state="suspended";const e=()=>{"suspended"===this._state&&(this._state=null),t.removeEventListener("statechange",e)};t.addEventListener("statechange",e)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then((()=>{throw t()})):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then((()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),Va(this)})))}createMediaElementSource(e){return new o(this,{mediaElement:e})}createMediaStreamDestination(){return new i(this)}createMediaStreamSource(e){return new a(this,{mediaStream:e})}createMediaStreamTrackSource(e){return new s(this,{mediaStreamTrack:e})}resume(){return"suspended"===this._state?new Promise(((e,t)=>{const n=()=>{this._nativeAudioContext.removeEventListener("statechange",n),"running"===this._nativeAudioContext.state?e():this.resume().then(e,t)};this._nativeAudioContext.addEventListener("statechange",n)})):this._nativeAudioContext.resume().catch((e=>{if(void 0===e||15===e.code)throw t();throw e}))}suspend(){return this._nativeAudioContext.suspend().catch((e=>{if(void 0===e)throw t();throw e}))}})(ed,Ns,cl,ml,xd,Sd,Md,Ed,nc),Cd=(kd=_u,e=>{const t=kd.get(e);if(void 0===t)throw new Error("The context has no set of AudioWorkletNodes.");return t});var kd;const Td=(Id=Cd,(e,t)=>{Id(e).add(t)});var Id;const Od=(e=>(t,n,r=0,o=0)=>{const i=t[r];if(void 0===i)throw e();return ds(n)?i.connect(n,0,o):i.connect(n,0)})(Ta),Rd=(e=>(t,n)=>{e(t).delete(n)})(Cd),Pd=(e=>(t,n,r,o=0)=>void 0===n?t.forEach((e=>e.disconnect())):"number"==typeof n?Os(e,t,n).disconnect():ds(n)?void 0===r?t.forEach((e=>e.disconnect(n))):void 0===o?Os(e,t,r).disconnect(n,0):Os(e,t,r).disconnect(n,0,o):void 0===r?t.forEach((e=>e.disconnect(n))):Os(e,t,r).disconnect(n,0))(Ta),Nd=new WeakMap,Ld=(Bd=Nd,Dd=ba,e=>Dd(Bd,e));var Bd,Dd;const jd=((e,t,n,r,o,i,a,s,l,c,u,d,f)=>(h,p,m,g)=>{if(0===g.numberOfInputs&&0===g.numberOfOutputs)throw l();const v=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(v.some((e=>e<1)))throw l();if(v.length!==g.numberOfOutputs)throw t();if("explicit"!==g.channelCountMode)throw l();const b=g.channelCount*g.numberOfInputs,y=v.reduce(((e,t)=>e+t),0),w=void 0===m.parameterDescriptors?0:m.parameterDescriptors.length;if(b+w>6||y>6)throw l();const x=new MessageChannel,S=[],M=[];for(let e=0;e<g.numberOfInputs;e+=1)S.push(a(h,{channelCount:g.channelCount,channelCountMode:g.channelCountMode,channelInterpretation:g.channelInterpretation,gain:1})),M.push(o(h,{channelCount:g.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:g.channelCount}));const _=[];if(void 0!==m.parameterDescriptors)for(const{defaultValue:e,maxValue:t,minValue:n,name:r}of m.parameterDescriptors){const o=i(h,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:void 0!==g.parameterData[r]?g.parameterData[r]:void 0===e?0:e});Object.defineProperties(o.offset,{defaultValue:{get:()=>void 0===e?0:e},maxValue:{get:()=>void 0===t?Pa:t},minValue:{get:()=>void 0===n?Ra:n}}),_.push(o)}const E=r(h,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,b+w)}),A=Xs(p,h.sampleRate),C=s(h,A,b+w,Math.max(1,y)),k=o(h,{channelCount:Math.max(1,y),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,y)}),T=[];for(let e=0;e<g.numberOfOutputs;e+=1)T.push(r(h,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:v[e]}));for(let e=0;e<g.numberOfInputs;e+=1){S[e].connect(M[e]);for(let t=0;t<g.channelCount;t+=1)M[e].connect(E,t,e*g.channelCount+t)}const I=new gs(void 0===m.parameterDescriptors?[]:m.parameterDescriptors.map((({name:e},t)=>{const n=_[t];return n.connect(E,0,b+t),n.start(0),[e,n.offset]})));E.connect(C);let O=g.channelInterpretation,R=null;const P=0===g.numberOfOutputs?[C]:T,N={get bufferSize(){return A},get channelCount(){return g.channelCount},set channelCount(e){throw n()},get channelCountMode(){return g.channelCountMode},set channelCountMode(e){throw n()},get channelInterpretation(){return O},set channelInterpretation(e){for(const t of S)t.channelInterpretation=e;O=e},get context(){return C.context},get inputs(){return S},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return R},set onprocessorerror(e){"function"==typeof R&&N.removeEventListener("processorerror",R),R="function"==typeof e?e:null,"function"==typeof R&&N.addEventListener("processorerror",R)},get parameters(){return I},get port(){return x.port2},addEventListener:(...e)=>C.addEventListener(e[0],e[1],e[2]),connect:e.bind(null,P),disconnect:c.bind(null,P),dispatchEvent:(...e)=>C.dispatchEvent(e[0]),removeEventListener:(...e)=>C.removeEventListener(e[0],e[1],e[2])},L=new Map;var B,D;x.port1.addEventListener=(B=x.port1.addEventListener,(...e)=>{if("message"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=L.get(e[1]);void 0!==n?e[1]=n:(e[1]=e=>{u(h.currentTime,h.sampleRate,(()=>t(e)))},L.set(t,e[1]))}}return B.call(x.port1,e[0],e[1],e[2])}),x.port1.removeEventListener=(D=x.port1.removeEventListener,(...e)=>{if("message"===e[0]){const t=L.get(e[1]);void 0!==t&&(L.delete(e[1]),e[1]=t)}return D.call(x.port1,e[0],e[1],e[2])});let j=null;Object.defineProperty(x.port1,"onmessage",{get:()=>j,set:e=>{"function"==typeof j&&x.port1.removeEventListener("message",j),j="function"==typeof e?e:null,"function"==typeof j&&(x.port1.addEventListener("message",j),x.port1.start())}}),m.prototype.port=x.port1;let F=null;Zs(h,N,m,g).then((e=>F=e));const z=ws(g.numberOfInputs,g.channelCount),U=ws(g.numberOfOutputs,v),H=void 0===m.parameterDescriptors?[]:m.parameterDescriptors.reduce(((e,{name:t})=>({...e,[t]:new Float32Array(128)})),{});let G=!0;const W=()=>{g.numberOfOutputs>0&&C.disconnect(k);for(let e=0,t=0;e<g.numberOfOutputs;e+=1){const n=T[e];for(let r=0;r<v[e];r+=1)k.disconnect(n,t+r,r);t+=v[e]}},V=new Map;C.onaudioprocess=({inputBuffer:e,outputBuffer:t})=>{if(null!==F){const n=d(N);for(let r=0;r<A;r+=128){for(let t=0;t<g.numberOfInputs;t+=1)for(let n=0;n<g.channelCount;n+=1)bs(e,z[t],n,n,r);void 0!==m.parameterDescriptors&&m.parameterDescriptors.forEach((({name:t},n)=>{bs(e,H,t,b+n,r)}));for(let e=0;e<g.numberOfInputs;e+=1)for(let t=0;t<v[e];t+=1)0===U[e][t].byteLength&&(U[e][t]=new Float32Array(128));try{const e=z.map(((e,t)=>{if(n[t].size>0)return V.set(t,A/128),e;const r=V.get(t);return void 0===r?[]:(e.every((e=>e.every((e=>0===e))))&&(1===r?V.delete(t):V.set(t,r-1)),e)})),o=u(h.currentTime+r/h.sampleRate,h.sampleRate,(()=>F.process(e,U,H)));G=o;for(let e=0,n=0;e<g.numberOfOutputs;e+=1){for(let o=0;o<v[e];o+=1)ys(t,U[e],o,n+o,r);n+=v[e]}}catch(e){G=!1,N.dispatchEvent(new ErrorEvent("processorerror",{colno:e.colno,filename:e.filename,lineno:e.lineno,message:e.message}))}if(!G){for(let e=0;e<g.numberOfInputs;e+=1){S[e].disconnect(M[e]);for(let t=0;t<g.channelCount;t+=1)M[r].disconnect(E,t,e*g.channelCount+t)}if(void 0!==m.parameterDescriptors){const e=m.parameterDescriptors.length;for(let t=0;t<e;t+=1){const e=_[t];e.disconnect(E,0,b+t),e.stop()}}E.disconnect(C),C.onaudioprocess=null,q?W():J();break}}}};let q=!1;const K=a(h,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0}),$=()=>C.connect(K).connect(h.destination),J=()=>{C.disconnect(K),K.disconnect()};return $(),f(N,(()=>{if(G){J(),g.numberOfOutputs>0&&C.connect(k);for(let e=0,t=0;e<g.numberOfOutputs;e+=1){const n=T[e];for(let r=0;r<v[e];r+=1)k.connect(n,t+r,r);t+=v[e]}}q=!0}),(()=>{G&&($(),W()),q=!1}))})(Od,Ta,Ns,Qc,nl,ru,il,ll,cl,Pd,Ku,Ld,Kc),Fd=((e,t,n,r,o)=>(i,a,s,l,c,u)=>{if(null!==s)try{const t=new s(i,l,u),r=new Map;let a=null;if(Object.defineProperties(t,{channelCount:{get:()=>u.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>"explicit",set:()=>{throw e()}},onprocessorerror:{get:()=>a,set:e=>{"function"==typeof a&&t.removeEventListener("processorerror",a),a="function"==typeof e?e:null,"function"==typeof a&&t.addEventListener("processorerror",a)}}}),t.addEventListener=(f=t.addEventListener,(...e)=>{if("processorerror"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=r.get(e[1]);void 0!==n?e[1]=n:(e[1]=n=>{"error"===n.type?(Object.defineProperties(n,{type:{value:"processorerror"}}),t(n)):t(new ErrorEvent(e[0],{...n}))},r.set(t,e[1]))}}return f.call(t,"error",e[1],e[2]),f.call(t,...e)}),t.removeEventListener=(d=t.removeEventListener,(...e)=>{if("processorerror"===e[0]){const t=r.get(e[1]);void 0!==t&&(r.delete(e[1]),e[1]=t)}return d.call(t,"error",e[1],e[2]),d.call(t,e[0],e[1],e[2])}),0!==u.numberOfOutputs){const e=n(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(e).connect(i.destination);return o(t,(()=>e.disconnect()),(()=>e.connect(i.destination)))}return t}catch(e){if(11===e.code)throw r();throw e}var d,f;if(void 0===c)throw r();return Js(u),t(i,a,c,u)})(Ns,jd,il,cl,Kc),zd=((e,t,n,r,o,i,a,s,l,c,u,d,f,h,p,m)=>(g,v,b)=>{const y=new WeakMap;let w=null;return{render(x,S){s(S,x);const M=y.get(S);return void 0!==M?Promise.resolve(M):(async(s,x)=>{let S=u(s),M=null;const _=Ca(S,x),E=Array.isArray(v.outputChannelCount)?v.outputChannelCount:Array.from(v.outputChannelCount);if(null===d){const e=E.reduce(((e,t)=>e+t),0),n=o(x,{channelCount:Math.max(1,e),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,e)}),i=[];for(let e=0;e<s.numberOfOutputs;e+=1)i.push(r(x,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:E[e]}));const c=a(x,{channelCount:v.channelCount,channelCountMode:v.channelCountMode,channelInterpretation:v.channelInterpretation,gain:1});c.connect=t.bind(null,i),c.disconnect=l.bind(null,i),M=[n,i,c]}else _||(S=new d(x,g));if(y.set(x,null===M?S:M[2]),null!==M){if(null===w){if(void 0===b)throw new Error("Missing the processor constructor.");if(null===f)throw new Error("Missing the native OfflineAudioContext constructor.");const e=s.channelCount*s.numberOfInputs,t=void 0===b.parameterDescriptors?0:b.parameterDescriptors.length,n=e+t,l=async()=>{const l=new f(n,128*Math.ceil(s.context.length/128),x.sampleRate),c=[],u=[];for(let e=0;e<v.numberOfInputs;e+=1)c.push(a(l,{channelCount:v.channelCount,channelCountMode:v.channelCountMode,channelInterpretation:v.channelInterpretation,gain:1})),u.push(o(l,{channelCount:v.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:v.channelCount}));const d=await Promise.all(Array.from(s.parameters.values()).map((async e=>{const t=i(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:e.value});return await h(l,e,t.offset),t}))),g=r(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,e+t)});for(let e=0;e<v.numberOfInputs;e+=1){c[e].connect(u[e]);for(let t=0;t<v.channelCount;t+=1)u[e].connect(g,t,e*v.channelCount+t)}for(const[t,n]of d.entries())n.connect(g,0,e+t),n.start(0);return g.connect(l.destination),await Promise.all(c.map((e=>p(s,l,e)))),m(l)};w=Ss(s,0===n?null:await l(),x,v,E,b,c)}const e=await w,t=n(x,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[l,u,d]=M;null!==e&&(t.buffer=e,t.start(0)),t.connect(l);for(let e=0,t=0;e<s.numberOfOutputs;e+=1){const n=u[e];for(let r=0;r<E[e];r+=1)l.connect(n,t+r,r);t+=E[e]}return d}if(_)for(const[t,n]of s.parameters.entries())await e(x,n,S.parameters.get(t));else for(const[e,t]of s.parameters.entries())await h(x,t,S.parameters.get(e));return await p(s,x,S),S})(x,S)}}})(Ac,Od,kc,Qc,nl,ru,il,Rd,Pd,Ku,is,sc,Xl,Ic,Gl,bu),Ud=(Hd=$u,e=>Hd.get(e));var Hd;const Gd=(e=>(t,n)=>{e.set(t,n)})(Nd),Wd=(qu&&((e,t,n,r,o,i,a,s,l,c,u,d,f,h)=>{})(Td,lc,Rc,zd,Fd,Ha,Ud,$l,Ql,sc,(e=>({...e,outputChannelCount:void 0!==e.outputChannelCount?e.outputChannelCount:1===e.numberOfInputs&&1===e.numberOfOutputs?[e.channelCount]:Array.from({length:e.numberOfOutputs},(()=>1))})),Gd,(e=>{const{port1:t,port2:n}=new MessageChannel;try{t.postMessage(e)}finally{t.close(),n.close()}}),El),((e,t,n,r,o)=>{})(Ns,cl,ml,Eu,nc),((e,t)=>(n,r,o)=>{if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(n,r,o)}catch(t){if("SyntaxError"===t.name)throw e();throw t}})(cl,Xl)),Vd=((e,t,n,r,o,i,a,s)=>(l,c)=>n(l).render(l,c).then((()=>Promise.all(Array.from(r(c)).map((e=>n(e).render(e,c)))))).then((()=>o(c))).then((n=>("function"!=typeof n.copyFromChannel?(a(n),Ia(n)):t(i,(()=>i(n)))||s(n),e.add(n),n))))(dc,Nl,Ul,Cd,bu,ka,mc,gc);qd=oa,Kd=ic;var qd,Kd;$d=aa,Jd=ac;var $d,Jd;var Xd=a("4IUwl");u=a("85Hg2");var Qd={error:console.error,info:console.info,success:console.log};u=a("85Hg2"),u=a("85Hg2"),Xd=a("4IUwl"),u=a("85Hg2"),Xd=a("4IUwl");var Yd=({className:e,title:t,loading:n=!0})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:r(Xd)(e,{"memori-loading-icon":n}),"aria-label":t},r(u).createElement("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}));var Zd=({primary:e=!1,outlined:t=!1,ghost:n=!1,padded:o=!0,shape:i="rounded",danger:a=!1,loading:s=!1,disabled:l=!1,block:c=!1,icon:d,className:f,title:h,id:p,htmlType:m,onClick:g,onTouchEnd:v,children:b})=>r(u).createElement("button",{id:p,type:m,onClick:g,onTouchEnd:v,title:h,disabled:s||l,className:r(Xd)("memori-button",{"memori-button--primary":e,"memori-button--outlined":t,"memori-button--ghost":n,"memori-button--square":"square"===i,"memori-button--rounded":"rounded"===i,"memori-button--circle":"circle"===i,"memori-button--padded":o,"memori-button--block":c,"memori-button--with-icon":(d||s)&&b,"memori-button--icon-only":(d||s)&&!b,"memori-button--danger":a,"memori-button--loading":s},f)},d&&!s&&r(u).createElement("span",{className:"memori-button--icon"},d),s&&r(u).createElement("span",{className:"memori-button--icon loading-icon"},r(u).createElement(Yd,{loading:!0})),b);u=a("85Hg2"),u=a("85Hg2");function ef(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ef),r}u=a("85Hg2");var tf,nf,rf=((nf=rf||{})[nf.None=0]="None",nf[nf.RenderStrategy=1]="RenderStrategy",nf[nf.Static=2]="Static",nf),of=((tf=of||{})[tf.Unmount=0]="Unmount",tf[tf.Hidden=1]="Hidden",tf);function af({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:a}){let s=lf(t,e);if(i)return sf(s,n,r,a);let l=null!=o?o:0;if(2&l){let{static:e=!1,...t}=s;if(e)return sf(t,n,r,a)}if(1&l){let{unmount:e=!0,...t}=s;return ef(e?0:1,{0:()=>null,1:()=>sf({...t,hidden:!0,style:{display:"none"}},n,r,a)})}return sf(s,n,r,a)}function sf(e,t={},n,r){let{as:o=n,children:i,refName:a="ref",...s}=df(e,["unmount","static"]),l=void 0!==e.ref?{[a]:e.ref}:{},c="function"==typeof i?i(t):i;s.className&&"function"==typeof s.className&&(s.className=s.className(t));let d={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r);e&&(d["data-headlessui-state"]=n.join(" "))}if(o===u.Fragment&&Object.keys(uf(s)).length>0){if(!(0,u.isValidElement)(c)||Array.isArray(c)&&c.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"));return(0,u.cloneElement)(c,Object.assign({},lf(c.props,uf(df(s,["ref"]))),d,l,function(...e){return{ref:e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(c.ref,l.ref)))}return(0,u.createElement)(o,Object.assign({},df(s,["ref"]),o!==u.Fragment&&l,o!==u.Fragment&&d),c)}function lf(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map((e=>[e,void 0]))));for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function cf(e){var t;return Object.assign((0,u.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function uf(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function df(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}u=a("85Hg2"),u=a("85Hg2"),u=a("85Hg2"),u=a("85Hg2");const ff="undefined"==typeof window||"undefined"==typeof document;let hf=ff?u.useEffect:u.useLayoutEffect;function pf(e){let t=(0,u.useRef)(e);return hf((()=>{t.current=e}),[e]),t}let mf=function(e){let t=pf(e);return r(u).useCallback(((...e)=>t.current(...e)),[t])},gf=Symbol();function vf(e,t=!0){return Object.assign(e,{[gf]:t})}function bf(...e){let t=(0,u.useRef)(e);(0,u.useEffect)((()=>{t.current=e}),[e]);let n=mf((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[gf])))?void 0:n}var yf,wf=((yf=wf||{}).Space=" ",yf.Enter="Enter",yf.Escape="Escape",yf.Backspace="Backspace",yf.Delete="Delete",yf.ArrowLeft="ArrowLeft",yf.ArrowUp="ArrowUp",yf.ArrowRight="ArrowRight",yf.ArrowDown="ArrowDown",yf.Home="Home",yf.End="End",yf.PageUp="PageUp",yf.PageDown="PageDown",yf.Tab="Tab",yf);function xf(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}u=a("85Hg2"),u=a("85Hg2");let Sf={serverHandoffComplete:!1};function Mf(){let[e,t]=(0,u.useState)(Sf.serverHandoffComplete);return(0,u.useEffect)((()=>{!0!==e&&t(!0)}),[e]),(0,u.useEffect)((()=>{!1===Sf.serverHandoffComplete&&(Sf.serverHandoffComplete=!0)}),[]),e}var _f;let Ef=0;function Af(){return++Ef}let Cf=null!=(_f=r(u).useId)?_f:function(){let e=Mf(),[t,n]=r(u).useState(e?Af:null);return hf((()=>{null===t&&n(Af())}),[t]),null!=t?""+t:void 0};u=a("85Hg2");var kf=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(kf||{});let Tf=cf((function(e,t){let{features:n=1,...r}=e;return af({ourProps:{ref:t,"aria-hidden":2==(2&n)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&n)&&2!=(2&n)&&{display:"none"}}},theirProps:r,slot:{},defaultTag:"div",name:"Hidden"})}));function If(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}function Of(){let e=[],t=[],n={enqueue(e){t.push(e)},addEventListener:(e,t,r,o)=>(e.addEventListener(t,r,o),n.add((()=>e.removeEventListener(t,r,o)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return n.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>n.requestAnimationFrame((()=>n.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return n.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return If((()=>{t.current&&e[0]()})),n.add((()=>{t.current=!1}))},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0){let[t]=e.splice(n,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return n}function Rf(e){return ff?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Pf=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var Nf,Lf,Bf=((Lf=Bf||{})[Lf.First=1]="First",Lf[Lf.Previous=2]="Previous",Lf[Lf.Next=4]="Next",Lf[Lf.Last=8]="Last",Lf[Lf.WrapAround=16]="WrapAround",Lf[Lf.NoScroll=32]="NoScroll",Lf),Df=((Nf=Df||{})[Nf.Error=0]="Error",Nf[Nf.Overflow=1]="Overflow",Nf[Nf.Success=2]="Success",Nf[Nf.Underflow=3]="Underflow",Nf),jf=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(jf||{});function Ff(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(Pf))}var zf=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(zf||{});function Uf(e,t=0){var n;return e!==(null==(n=Rf(e))?void 0:n.body)&&ef(t,{0:()=>e.matches(Pf),1(){let t=e;for(;null!==t;){if(t.matches(Pf))return!0;t=t.parentElement}return!1}})}function Hf(e){let t=Rf(e);Of().nextFrame((()=>{t&&!Uf(t.activeElement,0)&&Gf(e)}))}function Gf(e){null==e||e.focus({preventScroll:!0})}let Wf=["textarea","input"].join(",");function Vf(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function qf(e,t){return Kf(Ff(),t,!0,e)}function Kf(e,t,n=!0,r=null){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?n?Vf(e):e:Ff(e);r=null!=r?r:o.activeElement;let a,s=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,i.indexOf(r))-1;if(4&t)return Math.max(0,i.indexOf(r))+1;if(8&t)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&t?{preventScroll:!0}:{},u=0,d=i.length;do{if(u>=d||u+d<=0)return 0;let e=l+u;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}a=i[e],null==a||a.focus(c),u+=s}while(a!==o.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,Wf))&&n}(a)&&a.select(),a.hasAttribute("tabindex")||a.setAttribute("tabindex","0"),2}u=a("85Hg2"),u=a("85Hg2");function $f(e,t,n){let r=pf(t);(0,u.useEffect)((()=>{function t(e){r.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)}),[e,n])}var Jf=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Jf||{});function Xf(){let e=(0,u.useRef)(0);return $f("keydown",(t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)}),!0),e}u=a("85Hg2");function Qf(){let e=(0,u.useRef)(!1);return hf((()=>(e.current=!0,()=>{e.current=!1})),[]),e}u=a("85Hg2");function Yf(...e){return(0,u.useMemo)((()=>Rf(...e)),[...e])}u=a("85Hg2");function Zf(e,t,n,r){let o=pf(n);(0,u.useEffect)((()=>{function n(e){o.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}),[e,t,r])}u=a("85Hg2");function eh(e,t){let n=(0,u.useRef)([]),r=mf(e);(0,u.useEffect)((()=>{let e=[...n.current];for(let[o,i]of t.entries())if(n.current[o]!==i){let o=r(t,e);return n.current=t,o}}),[r,...t])}var th=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(th||{});let nh=Object.assign(cf((function(e,t){let n=(0,u.useRef)(null),o=bf(n,t),{initialFocus:i,containers:a,features:s=30,...l}=e;Mf()||(s=1);let c=Yf(n);!function({ownerDocument:e},t){let n=(0,u.useRef)(null);Zf(null==e?void 0:e.defaultView,"focusout",(e=>{!t||n.current||(n.current=e.target)}),!0),eh((()=>{t||((null==e?void 0:e.activeElement)===(null==e?void 0:e.body)&&Gf(n.current),n.current=null)}),[t]);let r=(0,u.useRef)(!1);(0,u.useEffect)((()=>(r.current=!1,()=>{r.current=!0,If((()=>{!r.current||(Gf(n.current),n.current=null)}))})),[])}({ownerDocument:c},Boolean(16&s));let d=function({ownerDocument:e,container:t,initialFocus:n},r){let o=(0,u.useRef)(null),i=Qf();return eh((()=>{if(!r)return;let a=t.current;!a||If((()=>{if(!i.current)return;let t=null==e?void 0:e.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===t)return void(o.current=t)}else if(a.contains(t))return void(o.current=t);null!=n&&n.current?Gf(n.current):Kf(a,Bf.First)===Df.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),o.current=null==e?void 0:e.activeElement}))}),[r]),o}({ownerDocument:c,container:n,initialFocus:i},Boolean(2&s));!function({ownerDocument:e,container:t,containers:n,previousActiveElement:r},o){let i=Qf();Zf(null==e?void 0:e.defaultView,"focus",(e=>{if(!o||!i.current)return;let a=new Set(null==n?void 0:n.current);a.add(t);let s=r.current;if(!s)return;let l=e.target;l&&l instanceof HTMLElement?function(e,t){var n;for(let r of e)if(null!=(n=r.current)&&n.contains(t))return!0;return!1}(a,l)?(r.current=l,Gf(l)):(e.preventDefault(),e.stopPropagation(),Gf(s)):Gf(r.current)}),!0)}({ownerDocument:c,container:n,containers:a,previousActiveElement:d},Boolean(8&s));let f=Xf(),h=mf((()=>{let e=n.current;!e||ef(f.current,{[Jf.Forwards]:()=>Kf(e,Bf.First),[Jf.Backwards]:()=>Kf(e,Bf.Last)})})),p={ref:o};return r(u).createElement(r(u).Fragment,null,Boolean(4&s)&&r(u).createElement(Tf,{as:"button",type:"button",onFocus:h,features:kf.Focusable}),af({ourProps:p,theirProps:l,defaultTag:"div",name:"FocusTrap"}),Boolean(4&s)&&r(u).createElement(Tf,{as:"button",type:"button",onFocus:h,features:kf.Focusable}))})),{features:th});let rh=new Set,oh=new Map;function ih(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function ah(e){let t=oh.get(e);!t||(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function sh(e,t=!0){hf((()=>{if(!t||!e.current)return;let n=e.current,r=Rf(n);if(r){rh.add(n);for(let e of oh.keys())e.contains(n)&&(ah(e),oh.delete(e));return r.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement){for(let t of rh)if(e.contains(t))return;1===rh.size&&(oh.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),ih(e))}})),()=>{if(rh.delete(n),rh.size>0)r.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement&&!oh.has(e)){for(let t of rh)if(e.contains(t))return;oh.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),ih(e)}}));else for(let e of oh.keys())ah(e),oh.delete(e)}}}),[t])}u=a("85Hg2"),c=a("2BCLI");let lh=(0,(u=a("85Hg2")).createContext)(!1);function ch(e){return r(u).createElement(lh.Provider,{value:e.force},e.children)}function uh(e){let t=(0,u.useContext)(lh),n=(0,u.useContext)(ph),r=Yf(e),[o,i]=(0,u.useState)((()=>{if(!t&&null!==n||ff)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)}));return(0,u.useEffect)((()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))}),[o,r]),(0,u.useEffect)((()=>{t||null!==n&&i(n.current)}),[n,i,t]),o}let dh=u.Fragment,fh=cf((function(e,t){let n=e,r=(0,u.useRef)(null),o=bf(vf((e=>{r.current=e})),t),i=Yf(r),a=uh(r),[s]=(0,u.useState)((()=>{var e;return ff?null:null!=(e=null==i?void 0:i.createElement("div"))?e:null})),l=Mf(),d=(0,u.useRef)(!1);return hf((()=>{if(d.current=!1,a&&s)return a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s)),()=>{d.current=!0,If((()=>{var e;!d.current||!a||!s||(a.removeChild(s),a.childNodes.length<=0&&(null==(e=a.parentElement)||e.removeChild(a)))}))}}),[a,s]),l&&a&&s?(0,c.createPortal)(af({ourProps:{ref:o},theirProps:n,defaultTag:dh,name:"Portal"}),s):null})),hh=u.Fragment,ph=(0,u.createContext)(null),mh=cf((function(e,t){let{target:n,...o}=e,i={ref:bf(t)};return r(u).createElement(ph.Provider,{value:n},af({ourProps:i,theirProps:o,defaultTag:hh,name:"Popover.Group"}))})),gh=Object.assign(fh,{Group:mh});let vh=(0,(u=a("85Hg2")).createContext)(null);function bh(){let e=(0,u.useContext)(vh);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,bh),e}return e}function yh(){let[e,t]=(0,u.useState)([]);return[e.length>0?e.join(" "):void 0,(0,u.useMemo)((()=>function(e){let n=mf((e=>(t((t=>[...t,e])),()=>t((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),o=(0,u.useMemo)((()=>({register:n,slot:e.slot,name:e.name,props:e.props})),[n,e.slot,e.name,e.props]);return r(u).createElement(vh.Provider,{value:o},e.children)}),[t])]}let wh=cf((function(e,t){let n=bh(),r=`headlessui-description-${Cf()}`,o=bf(t);hf((()=>n.register(r)),[r,n.register]);let i=e;return af({ourProps:{ref:o,...n.props,id:r},theirProps:i,slot:n.slot||{},defaultTag:"p",name:n.name||"Description"})}));let xh=(0,(u=a("85Hg2")).createContext)(null);xh.displayName="OpenClosedContext";var Sh=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Sh||{});function Mh(){return(0,u.useContext)(xh)}function _h({value:e,children:t}){return r(u).createElement(xh.Provider,{value:e},t)}let Eh=(0,(u=a("85Hg2")).createContext)((()=>{}));Eh.displayName="StackContext";var Ah=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Ah||{});function Ch({children:e,onUpdate:t,type:n,element:o,enabled:i}){let a=(0,u.useContext)(Eh),s=mf(((...e)=>{null==t||t(...e),a(...e)}));return hf((()=>{let e=void 0===i||!0===i;return e&&s(0,n,o),()=>{e&&s(1,n,o)}}),[s,n,o,i]),r(u).createElement(Eh.Provider,{value:s},e)}u=a("85Hg2"),u=a("85Hg2");function kh(e,t,n){let r=pf(t);(0,u.useEffect)((()=>{function t(e){r.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}function Th(e,t,n=!0){let r=(0,u.useRef)(!1);function o(n,o){if(!r.current||n.defaultPrevented)return;let i=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e),a=o(n);if(null!==a&&a.getRootNode().contains(a)){for(let e of i){if(null===e)continue;let t=e instanceof HTMLElement?e:e.current;if(null!=t&&t.contains(a))return}return!Uf(a,zf.Loose)&&-1!==a.tabIndex&&n.preventDefault(),t(n,a)}}(0,u.useEffect)((()=>{requestAnimationFrame((()=>{r.current=n}))}),[n]);let i=(0,u.useRef)(null);kh("mousedown",(e=>{var t,n;r.current&&(i.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)}),!0),kh("click",(e=>{!i.current||(o(e,(()=>i.current)),i.current=null)}),!0),kh("blur",(e=>o(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}var Ih=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ih||{}),Oh=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Oh||{});let Rh={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},Ph=(0,u.createContext)(null);function Nh(e){let t=(0,u.useContext)(Ph);if(null===t){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Nh),t}return t}function Lh(e,t){(0,u.useEffect)((()=>{var n;if(!t||!e)return;let r=Of();function o(e,t,n){let o=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),r.add((()=>{Object.assign(e.style,{[t]:o})}))}let i=e.documentElement,a=(null!=(n=e.defaultView)?n:window).innerWidth-i.clientWidth;if(o(i,"overflow","hidden"),a>0){o(i,"paddingRight",`${a-(i.clientWidth-i.offsetWidth)}px`)}if(/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0){let e=window.pageYOffset;o(i,"position","fixed"),o(i,"marginTop",`-${e}px`),o(i,"width","100%"),r.add((()=>window.scrollTo(0,e)))}return r.dispose}),[e,t])}function Bh(e,t){return ef(t.type,Rh,e,t)}Ph.displayName="DialogContext";let Dh=rf.RenderStrategy|rf.Static,jh=cf((function(e,t){let{open:n,onClose:o,initialFocus:i,__demoMode:a=!1,...s}=e,[l,c]=(0,u.useState)(0),d=Mh();void 0===n&&null!==d&&(n=ef(d,{[Sh.Open]:!0,[Sh.Closed]:!1}));let f=(0,u.useRef)(new Set),h=(0,u.useRef)(null),p=bf(h,t),m=(0,u.useRef)(null),g=Yf(h),v=e.hasOwnProperty("open")||null!==d,b=e.hasOwnProperty("onClose");if(!v&&!b)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!b)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof n)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n}`);if("function"!=typeof o)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let y=n?0:1,[w,x]=(0,u.useReducer)(Bh,{titleId:null,descriptionId:null,panelRef:(0,u.createRef)()}),S=mf((()=>o(!1))),M=mf((e=>x({type:0,id:e}))),_=!!Mf()&&(!a&&0===y),E=l>1,A=null!==(0,u.useContext)(Ph),C=E?"parent":"leaf";sh(h,!!E&&_),Th((()=>{var e,t;return[...Array.from(null!=(e=null==g?void 0:g.querySelectorAll("body > *, [data-headlessui-portal]"))?e:[]).filter((e=>!(!(e instanceof HTMLElement)||e.contains(m.current)||w.panelRef.current&&e.contains(w.panelRef.current)))),null!=(t=w.panelRef.current)?t:h.current]}),S,_&&!E),Zf(null==g?void 0:g.defaultView,"keydown",(e=>{e.defaultPrevented||e.key===wf.Escape&&0===y&&(E||(e.preventDefault(),e.stopPropagation(),S()))})),Lh(g,0===y&&!A),(0,u.useEffect)((()=>{if(0!==y||!h.current)return;let e=new IntersectionObserver((e=>{for(let t of e)0===t.boundingClientRect.x&&0===t.boundingClientRect.y&&0===t.boundingClientRect.width&&0===t.boundingClientRect.height&&S()}));return e.observe(h.current),()=>e.disconnect()}),[y,h,S]);let[k,T]=yh(),I=`headlessui-dialog-${Cf()}`,O=(0,u.useMemo)((()=>[{dialogState:y,close:S,setTitleId:M},w]),[y,w,S,M]),R=(0,u.useMemo)((()=>({open:0===y})),[y]),P={ref:p,id:I,role:"dialog","aria-modal":0===y||void 0,"aria-labelledby":w.titleId,"aria-describedby":k};return r(u).createElement(Ch,{type:"Dialog",enabled:0===y,element:h,onUpdate:mf(((e,t,n)=>{"Dialog"===t&&ef(e,{[Ah.Add](){f.current.add(n),c((e=>e+1))},[Ah.Remove](){f.current.add(n),c((e=>e-1))}})}))},r(u).createElement(ch,{force:!0},r(u).createElement(gh,null,r(u).createElement(Ph.Provider,{value:O},r(u).createElement(gh.Group,{target:h},r(u).createElement(ch,{force:!1},r(u).createElement(T,{slot:R,name:"Dialog.Description"},r(u).createElement(nh,{initialFocus:i,containers:f,features:_?ef(C,{parent:nh.features.RestoreFocus,leaf:nh.features.All&~nh.features.FocusLock}):nh.features.None},af({ourProps:P,theirProps:s,slot:R,defaultTag:"div",features:Dh,visible:0===y,name:"Dialog"})))))))),r(u).createElement(Tf,{features:kf.Hidden,ref:m}))})),Fh=cf((function(e,t){let[{dialogState:n,close:r}]=Nh("Dialog.Overlay");return af({ourProps:{ref:bf(t),id:`headlessui-dialog-overlay-${Cf()}`,"aria-hidden":!0,onClick:mf((e=>{if(e.target===e.currentTarget){if(xf(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),r()}}))},theirProps:e,slot:(0,u.useMemo)((()=>({open:0===n})),[n]),defaultTag:"div",name:"Dialog.Overlay"})})),zh=cf((function(e,t){let[{dialogState:n},o]=Nh("Dialog.Backdrop"),i=bf(t),a=`headlessui-dialog-backdrop-${Cf()}`;(0,u.useEffect)((()=>{if(null===o.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")}),[o.panelRef]);let s=(0,u.useMemo)((()=>({open:0===n})),[n]);return r(u).createElement(ch,{force:!0},r(u).createElement(gh,null,af({ourProps:{ref:i,id:a,"aria-hidden":!0},theirProps:e,slot:s,defaultTag:"div",name:"Dialog.Backdrop"})))})),Uh=cf((function(e,t){let[{dialogState:n},r]=Nh("Dialog.Panel"),o=bf(t,r.panelRef),i=`headlessui-dialog-panel-${Cf()}`,a=(0,u.useMemo)((()=>({open:0===n})),[n]);return af({ourProps:{ref:o,id:i,onClick:mf((e=>{e.stopPropagation()}))},theirProps:e,slot:a,defaultTag:"div",name:"Dialog.Panel"})})),Hh=cf((function(e,t){let[{dialogState:n,setTitleId:r}]=Nh("Dialog.Title"),o=`headlessui-dialog-title-${Cf()}`,i=bf(t);(0,u.useEffect)((()=>(r(o),()=>r(null))),[o,r]);let a=(0,u.useMemo)((()=>({open:0===n})),[n]);return af({ourProps:{ref:i,id:o},theirProps:e,slot:a,defaultTag:"h2",name:"Dialog.Title"})})),Gh=Object.assign(jh,{Backdrop:zh,Panel:Uh,Overlay:Fh,Title:Hh,Description:wh});u=a("85Hg2");function Wh(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Vh(e,...t){e&&t.length>0&&e.classList.add(...t)}function qh(e,...t){e&&t.length>0&&e.classList.remove(...t)}var Kh=(e=>(e.Ended="ended",e.Cancelled="cancelled",e))(Kh||{});function $h(e,t,n,r){let o=n?"enter":"leave",i=Of(),a=void 0!==r?Wh(r):()=>{};"enter"===o&&(e.removeAttribute("hidden"),e.style.display="");let s=ef(o,{enter:()=>t.enter,leave:()=>t.leave}),l=ef(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=ef(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return qh(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Vh(e,...s,...c),i.nextFrame((()=>{qh(e,...c),Vh(e,...l),function(e,t){let n=Of();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,a]=[r,o].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t}));if(i+a!==0){let r=[];r.push(n.addEventListener(e,"transitionrun",(o=>{o.target===o.currentTarget&&(r.splice(0).forEach((e=>e())),r.push(n.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(t("ended"),r.splice(0).forEach((e=>e())))})),n.addEventListener(e,"transitioncancel",(e=>{e.target===e.currentTarget&&(t("cancelled"),r.splice(0).forEach((e=>e())))}))))})))}else t("ended");n.add((()=>t("cancelled"))),n.dispose}(e,(n=>("ended"===n&&(qh(e,...s),Vh(e,...t.entered)),a(n))))})),i.dispose}function Jh(){let[e]=(0,u.useState)(Of);return(0,u.useEffect)((()=>()=>e.dispose()),[e]),e}function Xh({container:e,direction:t,classes:n,onStart:r,onStop:o}){let i=Qf(),a=Jh(),s=pf(t);hf((()=>{let t=Of();a.add(t.dispose);let l=e.current;if(l&&"idle"!==s.current&&i.current)return t.dispose(),r.current(s.current),t.add($h(l,n.current,"enter"===s.current,(e=>{t.dispose(),ef(e,{[Kh.Ended](){o.current(s.current)},[Kh.Cancelled]:()=>{}})}))),t.dispose}),[t])}function Qh(e=""){return e.split(" ").filter((e=>e.trim().length>1))}let Yh=(0,(u=a("85Hg2")).createContext)(null);Yh.displayName="TransitionContext";var Zh,ep=((Zh=ep||{}).Visible="visible",Zh.Hidden="hidden",Zh);let tp=(0,u.createContext)(null);function np(e){return"children"in e?np(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function rp(e,t){let n=pf(e),r=(0,u.useRef)([]),o=Qf(),i=Jh(),a=mf(((e,t=of.Hidden)=>{let a=r.current.findIndex((({el:t})=>t===e));-1!==a&&(ef(t,{[of.Unmount](){r.current.splice(a,1)},[of.Hidden](){r.current[a].state="hidden"}}),i.microTask((()=>{var e;!np(r)&&o.current&&(null==(e=n.current)||e.call(n))})))})),s=mf((e=>{let t=r.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>a(e,of.Unmount)})),l=(0,u.useRef)([]),c=(0,u.useRef)(Promise.resolve()),d=(0,u.useRef)({enter:[],leave:[],idle:[]}),f=mf(((e,n,r)=>{l.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter((([t])=>t!==e))),null==t||t.chains.current[n].push([e,new Promise((e=>{l.current.push(e)}))]),null==t||t.chains.current[n].push([e,new Promise((e=>{Promise.all(d.current[n].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===n?c.current=c.current.then((()=>null==t?void 0:t.wait.current)).then((()=>r(n))):r(n)})),h=mf(((e,t,n)=>{Promise.all(d.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=l.current.shift())||e()})).then((()=>n(t)))}));return(0,u.useMemo)((()=>({children:r,register:s,unregister:a,onStart:f,onStop:h,wait:c,chains:d})),[s,a,r,f,h,d,c])}function op(){}tp.displayName="NestingContext";let ip=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function ap(e){var t;let n={};for(let r of ip)n[r]=null!=(t=e[r])?t:op;return n}let sp=rf.RenderStrategy,lp=cf((function(e,t){let{beforeEnter:n,afterEnter:o,beforeLeave:i,afterLeave:a,enter:s,enterFrom:l,enterTo:c,entered:d,leave:f,leaveFrom:h,leaveTo:p,...m}=e,g=(0,u.useRef)(null),v=bf(g,t),b=m.unmount?of.Unmount:of.Hidden,{show:y,appear:w,initial:x}=function(){let e=(0,u.useContext)(Yh);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[S,M]=(0,u.useState)(y?"visible":"hidden"),_=function(){let e=(0,u.useContext)(tp);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:E,unregister:A}=_,C=(0,u.useRef)(null);(0,u.useEffect)((()=>E(g)),[E,g]),(0,u.useEffect)((()=>{if(b===of.Hidden&&g.current)return y&&"visible"!==S?void M("visible"):ef(S,{hidden:()=>A(g),visible:()=>E(g)})}),[S,g,E,A,y,b]);let k=pf({enter:Qh(s),enterFrom:Qh(l),enterTo:Qh(c),entered:Qh(d),leave:Qh(f),leaveFrom:Qh(h),leaveTo:Qh(p)}),T=function(e){let t=(0,u.useRef)(ap(e));return(0,u.useEffect)((()=>{t.current=ap(e)}),[e]),t}({beforeEnter:n,afterEnter:o,beforeLeave:i,afterLeave:a}),I=Mf();(0,u.useEffect)((()=>{if(I&&"visible"===S&&null===g.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[g,S,I]);let O=x&&!w,R=!I||O||C.current===y?"idle":y?"enter":"leave",P=mf((e=>ef(e,{enter:()=>T.current.beforeEnter(),leave:()=>T.current.beforeLeave(),idle:()=>{}}))),N=mf((e=>ef(e,{enter:()=>T.current.afterEnter(),leave:()=>T.current.afterLeave(),idle:()=>{}}))),L=rp((()=>{M("hidden"),A(g)}),_);Xh({container:g,classes:k,direction:R,onStart:pf((e=>{L.onStart(g,e,P)})),onStop:pf((e=>{L.onStop(g,e,N),"leave"===e&&!np(L)&&(M("hidden"),A(g))}))}),(0,u.useEffect)((()=>{!O||(b===of.Hidden?C.current=null:C.current=y)}),[y,O,S]);let B=m,D={ref:v};return r(u).createElement(tp.Provider,{value:L},r(u).createElement(_h,{value:ef(S,{visible:Sh.Open,hidden:Sh.Closed})},af({ourProps:D,theirProps:B,defaultTag:"div",features:sp,visible:"visible"===S,name:"Transition.Child"})))})),cp=cf((function(e,t){let{show:n,appear:o=!1,unmount:i,...a}=e,s=(0,u.useRef)(null),l=bf(s,t);Mf();let c=Mh();if(void 0===n&&null!==c&&(n=ef(c,{[Sh.Open]:!0,[Sh.Closed]:!1})),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,f]=(0,u.useState)(n?"visible":"hidden"),h=rp((()=>{f("hidden")})),[p,m]=(0,u.useState)(!0),g=(0,u.useRef)([n]);hf((()=>{!1!==p&&g.current[g.current.length-1]!==n&&(g.current.push(n),m(!1))}),[g,n]);let v=(0,u.useMemo)((()=>({show:n,appear:o,initial:p})),[n,o,p]);(0,u.useEffect)((()=>{if(n)f("visible");else if(np(h)){let e=s.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&f("hidden")}else f("hidden")}),[n,h]);let b={unmount:i};return r(u).createElement(tp.Provider,{value:h},r(u).createElement(Yh.Provider,{value:v},af({ourProps:{...b,as:u.Fragment,children:r(u).createElement(lp,{ref:l,...b,...a})},theirProps:{},defaultTag:u.Fragment,features:sp,visible:"visible"===d,name:"Transition"})))})),up=cf((function(e,t){let n=null!==(0,u.useContext)(Yh),o=null!==Mh();return r(u).createElement(r(u).Fragment,null,!n&&o?r(u).createElement(cp,{ref:t,...e}):r(u).createElement(lp,{ref:t,...e}))})),dp=Object.assign(cp,{Child:up,Root:cp});u=a("85Hg2"),Xd=a("4IUwl");var fp=({spinning:e=!1,primary:t=!1,className:n,children:o})=>r(u).createElement("div",{className:r(Xd)("memori-spin",n,{"memori-spin--spinning":e,"memori-spin--primary":t})},o,r(u).createElement("div",{className:"memori-spin--spinner"},r(u).createElement(Yd,{loading:!0})));u=a("85Hg2");var hp=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}));Xd=a("4IUwl");var pp=({open:e=!1,onClose:t,className:n,title:o,description:i,children:a,footer:s,loading:l=!1,closable:c=!0,width:d="100%",widthMd:f="100%"})=>{const{t:h}=ea();return r(u).createElement(dp,{appear:!0,show:e,as:r(u).Fragment},r(u).createElement(Gh,{open:e,onClose:t,className:r(Xd)("memori-modal",n)},r(u).createElement(dp.Child,{as:r(u).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},r(u).createElement("div",{className:"memori-modal--backdrop"})),r(u).createElement("div",{className:"memori-modal--container"},r(u).createElement("div",{className:"memori-modal--container-scrollable"},r(u).createElement(dp.Child,{as:r(u).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95"},r(u).createElement(Gh.Panel,{className:"memori-modal--panel"},r(u).createElement("style",{dangerouslySetInnerHTML:{__html:`\n .memori-modal--panel {\n --memori-modal--width: ${d};\n --memori-modal--width-md: ${f};\n }\n `}}),c&&r(u).createElement("div",{className:"memori-modal--close"},r(u).createElement(Zd,{ghost:!0,padded:!0,shape:"circle",icon:r(u).createElement(hp,null),title:h("close")||"Close",onClick:()=>t(!1)})),r(u).createElement(fp,{spinning:l},o&&r(u).createElement(Gh.Title,{className:"memori-modal--title"},o),i&&r(u).createElement(Gh.Description,{className:"memori-modal--description"},i),a,s&&r(u).createElement("div",{className:"memori-modal--footer"},s))))))))},mp=(u=a("85Hg2"),e=>"checkbox"===e.type),gp=e=>e instanceof Date,vp=e=>null==e;const bp=e=>"object"==typeof e;var yp=e=>!vp(e)&&!Array.isArray(e)&&bp(e)&&!gp(e),wp=e=>yp(e)&&e.target?mp(e.target)?e.target.checked:e.target.value:e,xp=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Sp=e=>Array.isArray(e)?e.filter(Boolean):[],Mp=e=>void 0===e,_p=(e,t,n)=>{if(!t||!yp(e))return n;const r=Sp(t.split(/[,[\].]+?/)).reduce(((e,t)=>vp(e)?e:e[t]),e);return Mp(r)||r===e?Mp(e[t])?n:e[t]:r};const Ep="blur",Ap="focusout",Cp="onBlur",kp="onChange",Tp="onSubmit",Ip="onTouched",Op="all",Rp="max",Pp="min",Np="maxLength",Lp="minLength",Bp="pattern",Dp="required",jp="validate";r(u).createContext(null);var Fp=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const o=i;return t._proxyFormState[o]!==Op&&(t._proxyFormState[o]=!r||Op),n&&(n[o]=!0),e[o]}});return o},zp=e=>yp(e)&&!Object.keys(e).length,Up=(e,t,n)=>{const{name:r,...o}=e;return zp(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find((e=>t[e]===(!n||Op)))},Hp=e=>Array.isArray(e)?e:[e];function Gp(e){const t=r(u).useRef(e);t.current=e,r(u).useEffect((()=>{const n=!e.disabled&&t.current.subject.subscribe({next:t.current.callback});return()=>{n&&n.unsubscribe()}}),[e.disabled])}var Wp=e=>"string"==typeof e,Vp=(e,t,n,r)=>Wp(e)?(r&&t.watch.add(e),_p(n,e)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),_p(n,e)))):(t.watchAll=!!r,n),qp="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Kp(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(qp&&(e instanceof Blob||e instanceof FileList)||!n&&!yp(e))return e;if(t=n?[]:{},Array.isArray(e)||(e=>{const t=e.constructor&&e.constructor.prototype;return yp(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)t[n]=Kp(e[n]);else t=e}return t}var $p=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Jp=e=>/^\w*$/.test(e),Xp=e=>Sp(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Qp(e,t,n){let r=-1;const o=Jp(t)?[t]:Xp(t),i=o.length,a=i-1;for(;++r<i;){const t=o[r];let i=n;if(r!==a){const n=e[t];i=yp(n)||Array.isArray(n)?n:isNaN(+o[r+1])?{}:[]}e[t]=i,e=e[t]}return e}const Yp=(e,t,n)=>{for(const r of n||Object.keys(e)){const n=_p(e,r);if(n){const{_f:e,...r}=n;if(e&&t(e.name)){if(e.ref.focus){e.ref.focus();break}if(e.refs&&e.refs[0].focus){e.refs[0].focus();break}}else yp(r)&&Yp(r,t)}}};var Zp=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))))),em=(e,t,n)=>{const r=Sp(_p(e,n));return Qp(r,"root",t[n]),Qp(e,n,r),e},tm=e=>"boolean"==typeof e,nm=e=>"file"===e.type,rm=e=>"function"==typeof e,om=e=>Wp(e)||r(u).isValidElement(e),im=e=>"radio"===e.type,am=e=>e instanceof RegExp;const sm={value:!1,isValid:!1},lm={value:!0,isValid:!0};var cm=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Mp(e[0].attributes.value)?Mp(e[0].value)||""===e[0].value?lm:{value:e[0].value,isValid:!0}:lm:sm}return sm};const um={isValid:!1,value:null};var dm=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),um):um;function fm(e,t,n="validate"){if(om(e)||Array.isArray(e)&&e.every(om)||tm(e)&&!e)return{type:n,message:om(e)?e:"",ref:t}}var hm=e=>yp(e)&&!am(e)?e:{value:e,message:""},pm=async(e,t,n,r,o)=>{const{ref:i,refs:a,required:s,maxLength:l,minLength:c,min:u,max:d,pattern:f,validate:h,name:p,valueAsNumber:m,mount:g,disabled:v}=e._f;if(!g||v)return{};const b=a?a[0]:i,y=e=>{r&&b.reportValidity&&(b.setCustomValidity(tm(e)?"":e||""),b.reportValidity())},w={},x=im(i),S=mp(i),M=x||S,_=(m||nm(i))&&!i.value||""===t||Array.isArray(t)&&!t.length,E=$p.bind(null,p,n,w),A=(e,t,n,r=Np,o=Lp)=>{const a=e?t:n;w[p]={type:e?r:o,message:a,ref:i,...E(e?r:o,a)}};if(o?!Array.isArray(t)||!t.length:s&&(!M&&(_||vp(t))||tm(t)&&!t||S&&!cm(a).isValid||x&&!dm(a).isValid)){const{value:e,message:t}=om(s)?{value:!!s,message:s}:hm(s);if(e&&(w[p]={type:Dp,message:t,ref:b,...E(Dp,t)},!n))return y(t),w}if(!(_||vp(u)&&vp(d))){let e,r;const o=hm(d),a=hm(u);if(vp(t)||isNaN(t)){const n=i.valueAsDate||new Date(t),s=e=>new Date((new Date).toDateString()+" "+e),l="time"==i.type,c="week"==i.type;Wp(o.value)&&t&&(e=l?s(t)>s(o.value):c?t>o.value:n>new Date(o.value)),Wp(a.value)&&t&&(r=l?s(t)<s(a.value):c?t<a.value:n<new Date(a.value))}else{const n=i.valueAsNumber||(t?+t:t);vp(o.value)||(e=n>o.value),vp(a.value)||(r=n<a.value)}if((e||r)&&(A(!!e,o.message,a.message,Rp,Pp),!n))return y(w[p].message),w}if((l||c)&&!_&&(Wp(t)||o&&Array.isArray(t))){const e=hm(l),r=hm(c),o=!vp(e.value)&&t.length>e.value,i=!vp(r.value)&&t.length<r.value;if((o||i)&&(A(o,e.message,r.message),!n))return y(w[p].message),w}if(f&&!_&&Wp(t)){const{value:e,message:r}=hm(f);if(am(e)&&!t.match(e)&&(w[p]={type:Bp,message:r,ref:i,...E(Bp,r)},!n))return y(r),w}if(h)if(rm(h)){const e=fm(await h(t),b);if(e&&(w[p]={...e,...E(jp,e.message)},!n))return y(e.message),w}else if(yp(h)){let e={};for(const r in h){if(!zp(e)&&!n)break;const o=fm(await h[r](t),b,r);o&&(e={...o,...E(r,o.message)},y(o.message),n&&(w[p]=e))}if(!zp(e)&&(w[p]={ref:b,...e},!n))return w}return y(!0),w};var mm=e=>({isOnSubmit:!e||e===Tp,isOnBlur:e===Cp,isOnChange:e===kp,isOnAll:e===Op,isOnTouch:e===Ip});function gm(e){for(const t in e)if(!Mp(e[t]))return!1;return!0}function vm(e,t){const n=Jp(t)?[t]:Xp(t),r=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Mp(e)?r++:e[t[r++]];return e}(e,n),o=n[n.length-1];let i;r&&delete r[o];for(let t=0;t<n.slice(0,-1).length;t++){let r,o=-1;const a=n.slice(0,-(t+1)),s=a.length-1;for(t>0&&(i=e);++o<a.length;){const t=a[o];r=r?r[t]:e[t],s===o&&(yp(r)&&zp(r)||Array.isArray(r)&&gm(r))&&(i?delete i[t]:delete e[t]),i=r}}return e}function bm(){let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}}var ym=e=>vp(e)||!bp(e);function wm(e,t){if(ym(e)||ym(t))return e===t;if(gp(e)&&gp(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const n=e[o];if(!r.includes(o))return!1;if("ref"!==o){const e=t[o];if(gp(n)&&gp(e)||yp(n)&&yp(e)||Array.isArray(n)&&Array.isArray(e)?!wm(n,e):n!==e)return!1}}return!0}var xm=e=>{const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Sm=e=>"select-multiple"===e.type,Mm=e=>xm(e)&&e.isConnected,_m=e=>{for(const t in e)if(rm(e[t]))return!0;return!1};function Em(e,t={}){const n=Array.isArray(e);if(yp(e)||n)for(const n in e)Array.isArray(e[n])||yp(e[n])&&!_m(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Em(e[n],t[n])):vp(e[n])||(t[n]=!0);return t}function Am(e,t,n){const r=Array.isArray(e);if(yp(e)||r)for(const r in e)Array.isArray(e[r])||yp(e[r])&&!_m(e[r])?Mp(t)||ym(n[r])?n[r]=Array.isArray(e[r])?Em(e[r],[]):{...Em(e[r])}:Am(e[r],vp(t)?{}:t[r],n[r]):wm(e[r],t[r])?delete n[r]:n[r]=!0;return n}var Cm=(e,t)=>Am(e,t,Em(t)),km=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Mp(e)?e:t?""===e?NaN:e?+e:e:n&&Wp(e)?new Date(e):r?r(e):e;function Tm(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return nm(t)?t.files:im(t)?dm(e.refs).value:Sm(t)?[...t.selectedOptions].map((({value:e})=>e)):mp(t)?cm(e.refs).value:km(Mp(t.value)?e.ref.value:t.value,e)}var Im=e=>Mp(e)?e:am(e)?e.source:yp(e)?am(e.value)?e.value.source:e.value:e;function Om(e,t,n){const r=_p(e,n);if(r||Jp(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const r=o.join("."),i=_p(t,r),a=_p(e,r);if(i&&!Array.isArray(i)&&n!==r)return{name:n};if(a&&a.type)return{name:r,error:a};o.pop()}return{name:n}}const Rm={mode:Tp,reValidateMode:kp,shouldFocusError:!0};function Pm(e={}){let t,n={...Rm,...e},r={submitCount:0,isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},o={},i=Kp(n.defaultValues)||{},a=n.shouldUnregister?{}:Kp(i),s={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c=0,u={};const d={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={watch:bm(),array:bm(),state:bm()},h=mm(n.mode),p=mm(n.reValidateMode),m=n.criteriaMode===Op,g=async()=>{let e=!1;return d.isValid&&(e=n.resolver?zp((await w()).errors):await x(o,!0),e!==r.isValid&&(r.isValid=e,f.state.next({isValid:e}))),e},v=(e,t,n,r)=>{const l=_p(o,e);if(l){const o=_p(a,e,Mp(n)?_p(i,e):n);Mp(o)||r&&r.defaultChecked||t?Qp(a,e,t?o:Tm(l._f)):_(e,o),s.mount&&g()}},b=(e,t,n,o,a)=>{let s=!1,l=!1;const c={name:e};if(d.isDirty&&(l=r.isDirty,r.isDirty=c.isDirty=S(),s=l!==c.isDirty),d.dirtyFields&&(!n||o)){l=_p(r.dirtyFields,e);const n=wm(_p(i,e),t);n?vm(r.dirtyFields,e):Qp(r.dirtyFields,e,!0),c.dirtyFields=r.dirtyFields,s=s||l!==!n}if(n){const t=_p(r.touchedFields,e);t||(Qp(r.touchedFields,e,n),c.touchedFields=r.touchedFields,s=s||d.touchedFields&&t!==n)}return s&&a&&f.state.next(c),s?c:{}},y=(n,o,i,a)=>{const s=_p(r.errors,n),l=d.isValid&&tm(o)&&r.isValid!==o;var h;if(e.delayError&&i?(h=()=>((e,t)=>{Qp(r.errors,e,t),f.state.next({errors:r.errors})})(n,i),t=e=>{clearTimeout(c),c=window.setTimeout(h,e)},t(e.delayError)):(clearTimeout(c),t=null,i?Qp(r.errors,n,i):vm(r.errors,n)),(i?!wm(s,i):s)||!zp(a)||l){const e={...a,...l&&tm(o)?{isValid:o}:{},errors:r.errors,name:n};r={...r,...e},f.state.next(e)}u[n]--,d.isValidating&&!Object.values(u).some((e=>e))&&(f.state.next({isValidating:!1}),u={})},w=async e=>n.resolver?await n.resolver({...a},n.context,((e,t,n,r)=>{const o={};for(const n of e){const e=_p(t,n);e&&Qp(o,n,e._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}})(e||l.mount,o,n.criteriaMode,n.shouldUseNativeValidation)):{},x=async(e,t,o={valid:!0})=>{for(const i in e){const s=e[i];if(s){const{_f:e,...i}=s;if(e){const i=l.array.has(e.name),c=await pm(s,_p(a,e.name),m,n.shouldUseNativeValidation,i);if(c[e.name]&&(o.valid=!1,t))break;!t&&(_p(c,e.name)?i?em(r.errors,c,e.name):Qp(r.errors,e.name,c[e.name]):vm(r.errors,e.name))}i&&await x(i,t,o)}}return o.valid},S=(e,t)=>(e&&t&&Qp(a,e,t),!wm(T(),i)),M=(e,t,n)=>Vp(e,l,{...s.mount?a:Mp(t)?i:Wp(e)?{[e]:t}:t},n),_=(e,t,n={})=>{const r=_p(o,e);let i=t;if(r){const n=r._f;n&&(!n.disabled&&Qp(a,e,km(t,n)),i=qp&&xm(n.ref)&&vp(t)?"":t,Sm(n.ref)?[...n.ref.options].forEach((e=>e.selected=i.includes(e.value))):n.refs?mp(n.ref)?n.refs.length>1?n.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(i)?!!i.find((t=>t===e.value)):i===e.value))):n.refs[0]&&(n.refs[0].checked=!!i):n.refs.forEach((e=>e.checked=e.value===i)):nm(n.ref)?n.ref.value="":(n.ref.value=i,n.ref.type||f.watch.next({name:e})))}(n.shouldDirty||n.shouldTouch)&&b(e,i,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&k(e)},E=(e,t,n)=>{for(const r in t){const i=t[r],a=`${e}.${r}`,s=_p(o,a);!l.array.has(e)&&ym(i)&&(!s||s._f)||gp(i)?_(a,i,n):E(a,i,n)}},A=(e,t,n={})=>{const s=_p(o,e),c=l.array.has(e),u=Kp(t);Qp(a,e,u),c?(f.array.next({name:e,values:a}),(d.isDirty||d.dirtyFields)&&n.shouldDirty&&(r.dirtyFields=Cm(i,a),f.state.next({name:e,dirtyFields:r.dirtyFields,isDirty:S(e,u)}))):!s||s._f||vp(u)?_(e,u,n):E(e,u,n),Zp(e,l)&&f.state.next({}),f.watch.next({name:e})},C=async e=>{const i=e.target;let s=i.name;const c=_p(o,s);if(c){let x,S;const M=i.type?Tm(c._f):wp(e),_=e.type===Ep||e.type===Ap,E=!((v=c._f).mount&&(v.required||v.min||v.max||v.maxLength||v.minLength||v.pattern||v.validate)||n.resolver||_p(r.errors,s)||c._f.deps)||((e,t,n,r,o)=>!o.isOnAll&&(!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:!(n?r.isOnChange:o.isOnChange)||e))(_,_p(r.touchedFields,s),r.isSubmitted,p,h),A=Zp(s,l,_);Qp(a,s,M),_?(c._f.onBlur&&c._f.onBlur(e),t&&t(0)):c._f.onChange&&c._f.onChange(e);const C=b(s,M,_,!1),T=!zp(C)||A;if(!_&&f.watch.next({name:s,type:e.type}),E)return d.isValid&&g(),T&&f.state.next({name:s,...A?{}:C});if(!_&&A&&f.state.next({}),u[s]=u[s]?u[s]+1:1,f.state.next({isValidating:!0}),n.resolver){const{errors:e}=await w([s]),t=Om(r.errors,o,s),n=Om(e,o,t.name||s);x=n.error,s=n.name,S=zp(e)}else x=(await pm(c,_p(a,s),m,n.shouldUseNativeValidation))[s],g();c._f.deps&&k(c._f.deps),y(s,S,x,C)}var v},k=async(e,t={})=>{let i,a;const s=Hp(e);if(f.state.next({isValidating:!0}),n.resolver){const t=await(async e=>{const{errors:t}=await w();if(e)for(const n of e){const e=_p(t,n);e?Qp(r.errors,n,e):vm(r.errors,n)}else r.errors=t;return t})(Mp(e)?e:s);i=zp(t),a=e?!s.some((e=>_p(t,e))):i}else e?(a=(await Promise.all(s.map((async e=>{const t=_p(o,e);return await x(t&&t._f?{[e]:t}:t)})))).every(Boolean),(a||r.isValid)&&g()):a=i=await x(o);return f.state.next({...!Wp(e)||d.isValid&&i!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:i}:{},errors:r.errors,isValidating:!1}),t.shouldFocus&&!a&&Yp(o,(e=>e&&_p(r.errors,e)),e?s:l.mount),a},T=e=>{const t={...i,...s.mount?a:{}};return Mp(e)?t:Wp(e)?_p(t,e):e.map((e=>_p(t,e)))},I=(e,t)=>({invalid:!!_p((t||r).errors,e),isDirty:!!_p((t||r).dirtyFields,e),isTouched:!!_p((t||r).touchedFields,e),error:_p((t||r).errors,e)}),O=(e,t={})=>{for(const s of e?Hp(e):l.mount)l.mount.delete(s),l.array.delete(s),_p(o,s)&&(t.keepValue||(vm(o,s),vm(a,s)),!t.keepError&&vm(r.errors,s),!t.keepDirty&&vm(r.dirtyFields,s),!t.keepTouched&&vm(r.touchedFields,s),!n.shouldUnregister&&!t.keepDefaultValue&&vm(i,s));f.watch.next({}),f.state.next({...r,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&g()},R=(e,t={})=>{let r=_p(o,e);const c=tm(t.disabled);return Qp(o,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),r?c&&Qp(a,e,t.disabled?void 0:_p(a,e,Tm(r._f))):v(e,!0,t.value),{...c?{disabled:t.disabled}:{},...n.shouldUseNativeValidation?{required:!!t.required,min:Im(t.min),max:Im(t.max),minLength:Im(t.minLength),maxLength:Im(t.maxLength),pattern:Im(t.pattern)}:{},name:e,onChange:C,onBlur:C,ref:a=>{if(a){R(e,t),r=_p(o,e);const n=Mp(a.value)&&a.querySelectorAll&&a.querySelectorAll("input,select,textarea")[0]||a,s=(e=>im(e)||mp(e))(n),l=r._f.refs||[];if(s?l.find((e=>e===n)):n===r._f.ref)return;Qp(o,e,{_f:{...r._f,...s?{refs:[...l.filter(Mm),n,...Array.isArray(_p(i,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),v(e,!1,void 0,n)}else r=_p(o,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!xp(l.array,e)||!s.action)&&l.unMount.add(e)}}},P=()=>n.shouldFocusError&&Yp(o,(e=>e&&_p(r.errors,e)),l.mount);return{control:{register:R,unregister:O,getFieldState:I,_executeSchema:w,_focusError:P,_getWatch:M,_getDirty:S,_updateValid:g,_removeUnmounted:()=>{for(const e of l.unMount){const t=_p(o,e);t&&(t._f.refs?t._f.refs.every((e=>!Mm(e))):!Mm(t._f.ref))&&O(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],n,l,c=!0,u=!0)=>{if(l&&n){if(s.action=!0,u&&Array.isArray(_p(o,e))){const t=n(_p(o,e),l.argA,l.argB);c&&Qp(o,e,t)}if(u&&Array.isArray(_p(r.errors,e))){const t=n(_p(r.errors,e),l.argA,l.argB);c&&Qp(r.errors,e,t),((e,t)=>{!Sp(_p(e,t)).length&&vm(e,t)})(r.errors,e)}if(d.touchedFields&&u&&Array.isArray(_p(r.touchedFields,e))){const t=n(_p(r.touchedFields,e),l.argA,l.argB);c&&Qp(r.touchedFields,e,t)}d.dirtyFields&&(r.dirtyFields=Cm(i,a)),f.state.next({isDirty:S(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Qp(a,e,t)},_getFieldArray:t=>Sp(_p(s.mount?a:i,t,e.shouldUnregister?_p(i,t,[]):[])),_subjects:f,_proxyFormState:d,get _fields(){return o},get _formValues(){return a},get _stateFlags(){return s},set _stateFlags(e){s=e},get _defaultValues(){return i},get _names(){return l},set _names(e){l=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:k,register:R,handleSubmit:(e,t)=>async i=>{i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let s=!0,l=Kp(a);f.state.next({isSubmitting:!0});try{if(n.resolver){const{errors:e,values:t}=await w();r.errors=e,l=t}else await x(o);zp(r.errors)?(f.state.next({errors:{},isSubmitting:!0}),await e(l,i)):(t&&await t({...r.errors},i),P())}catch(e){throw s=!1,e}finally{r.isSubmitted=!0,f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:zp(r.errors)&&s,submitCount:r.submitCount+1,errors:r.errors})}},watch:(e,t)=>rm(e)?f.watch.subscribe({next:n=>e(M(void 0,t),n)}):M(e,t,!0),setValue:A,getValues:T,reset:(t,n)=>((t,n={})=>{const c=t||i,u=Kp(c),h=t&&!zp(t)?u:i;if(n.keepDefaultValues||(i=c),!n.keepValues){if(n.keepDirtyValues)for(const e of l.mount)_p(r.dirtyFields,e)?Qp(h,e,_p(a,e)):A(e,_p(h,e));else{if(qp&&Mp(t))for(const e of l.mount){const t=_p(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(xm(e)){const t=e.closest("form");if(t){t.reset();break}}}}o={}}a=e.shouldUnregister?n.keepDefaultValues?Kp(i):{}:u,f.array.next({values:h}),f.watch.next({values:h})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!n.keepIsValid,s.watch=!!e.shouldUnregister,f.state.next({submitCount:n.keepSubmitCount?r.submitCount:0,isDirty:n.keepDirty||n.keepDirtyValues?r.isDirty:!(!n.keepDefaultValues||wm(t,i)),isSubmitted:!!n.keepIsSubmitted&&r.isSubmitted,dirtyFields:n.keepDirty||n.keepDirtyValues?r.dirtyFields:n.keepDefaultValues&&t?Cm(i,t):{},touchedFields:n.keepTouched?r.touchedFields:{},errors:n.keepErrors?r.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(rm(t)?t(a):t,n),resetField:(e,t={})=>{_p(o,e)&&(Mp(t.defaultValue)?A(e,_p(i,e)):(A(e,t.defaultValue),Qp(i,e,t.defaultValue)),t.keepTouched||vm(r.touchedFields,e),t.keepDirty||(vm(r.dirtyFields,e),r.isDirty=t.defaultValue?S(e,_p(i,e)):S()),t.keepError||(vm(r.errors,e),d.isValid&&g()),f.state.next({...r}))},clearErrors:e=>{e?Hp(e).forEach((e=>vm(r.errors,e))):r.errors={},f.state.next({errors:r.errors})},unregister:O,setError:(e,t,n)=>{const i=(_p(o,e,{_f:{}})._f||{}).ref;Qp(r.errors,e,{...t,ref:i}),f.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&i&&i.focus&&i.focus()},setFocus:(e,t={})=>{const n=_p(o,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:I}}function Nm(e={}){const t=r(u).useRef(),[n,o]=r(u).useState({isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:e.defaultValues});t.current||(t.current={...Pm(e),formState:n});const i=t.current.control;return i._options=e,Gp({subject:i._subjects.state,callback:r(u).useCallback((e=>{Up(e,i._proxyFormState,!0)&&(i._formState={...i._formState,...e},o({...i._formState}))}),[i])}),r(u).useEffect((()=>{i._stateFlags.mount||(i._proxyFormState.isValid&&i._updateValid(),i._stateFlags.mount=!0),i._stateFlags.watch&&(i._stateFlags.watch=!1,i._subjects.state.next({})),i._removeUnmounted()})),r(u).useEffect((()=>{n.submitCount&&i._focusError()}),[i,n.submitCount]),t.current.formState=Fp(n,i),t.current}u=a("85Hg2");var Lm=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),r(u).createElement("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"}));var Bm=({pwdOrTokens:e,setPwdOrTokens:t,onFinish:n,minimumNumberOfRecoveryTokens:o=1,showTokens:i=!0,openModal:a=!1,withModal:s=!1})=>{var l;const{t:c}=ea(),{register:d,handleSubmit:f,formState:{errors:h},setError:p}=Nm(),[m,g]=(0,u.useState)(1),[v,b]=(0,u.useState)(!!e),y=r(u).createElement("form",{name:"memoriAuth",onSubmit:f((t=>{var r,i,a;"password"===e&&!(null===(r=t.password)||void 0===r?void 0:r.length)||"tokens"===e&&(((null===(i=null==t?void 0:t.tokens)||void 0===i?void 0:i.length)||0)<o||!(null===(a=null==t?void 0:t.tokens)||void 0===a?void 0:a.every((e=>e.length))))?p("tokens",{type:"minLength",message:"Tokens"}):n&&n(t).then((()=>{b(!1)}))})),className:"memori-auth-widget--form"},("password"===e||!i)&&r(u).createElement("fieldset",{className:"memori-auth-widget--password-fieldset"},r(u).createElement("label",null,"Password:"," ",r(u).createElement("input",{className:"memori-auth-widget--input",required:!0,type:"password",placeholder:"Password",...d("password",{required:!0})})),i&&r(u).createElement(r(u).Fragment,null,r(u).createElement("hr",null),r(u).createElement(Zd,{outlined:!0,onClick:()=>t("tokens")},c("auth.useRecoveryTokens")||"Recovery tokens"))),"tokens"===e&&i&&r(u).createElement("fieldset",{className:"memori-auth-widget--tokens-fieldset",name:"tokens"},r(u).createElement("legend",null,c("auth.tokens"),": "),(w=m,Array.from({length:w},((e,t)=>t))).map((e=>r(u).createElement("label",{className:"memori-auth-widget--token",key:e},r(u).createElement("input",{type:"password",className:"memori-auth-widget--input",placeholder:"Recovery token",required:!0,autoComplete:"off",...d(`tokens.${e}`,{required:!0})})))),r(u).createElement(Zd,{onClick:()=>g((e=>e+1)),className:"memori-auth-widget--token-add",icon:r(u).createElement(Lm,null)},c("auth.addToken")||"Add token"),r(u).createElement("hr",null),r(u).createElement(Zd,{outlined:!0,onClick:()=>t("password")},c("auth.usePassword")||"Password")),"minLength"===(null===(l=h.tokens)||void 0===l?void 0:l.type)&&r(u).createElement("div",{className:"memori-auth-widget--error"},c("auth.atLeast")||"At least"," ",o),r(u).createElement(Zd,{htmlType:"submit",primary:!0,className:"memori-auth-widget--submit"},c("confirm")||"Submit"));var w;return s?r(u).createElement(pp,{open:a||v,title:"Authentication",onClose:()=>t(null),closable:!1},y):y};u=a("85Hg2"),Xd=a("4IUwl"),u=a("85Hg2");const Dm=()=>{let e=!1;if("maxTouchPoints"in navigator)e=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)e=navigator.msMaxTouchPoints>0;else{const n=window&&"matchMedia"in window&&matchMedia("(pointer:coarse)");if(n&&"(pointer:coarse)"===n.media)e=!!n.matches;else if("orientation"in window)e=!0;else{var t=null===navigator||void 0===navigator?void 0:navigator.userAgent;e=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(t)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(t)}}return e};const jm=e=>e.slice(0,e.length/2).trim().toLowerCase()===e.slice(e.length/2+1).trim().toLowerCase()?e.slice(0,e.length/2):e,Fm=({type:e,resourceURI:t,sessionID:n,baseURL:r=""})=>{var o,i;let a="cover"===e?`${r}/images/memoriCover.png`:`${r}/images/memoriAvatar.png`;return t&&0!==t.length?t.includes("memoriai/memory")&&!t.includes("memori-ai-session-id")&&n?`${t}?memori-ai-session-id=${n}`:t.startsWith("https://")||t.startsWith("http://")?`${t}${n?`/${n}`:""}`:t.startsWith("cloud://")?`${o=void 0,(void 0===o?void 0:o.replace(/v2/,"v1"))||""}/CloudAsset/${t.replace("cloud://","")}`:t.startsWith("guid://")?`${i=void 0,(void 0===i?void 0:i.replace(/v2/,"v1"))||""}/GuidAsset/${t.replace("guid://","")}`:a:a};u=a("85Hg2"),Xd=a("4IUwl"),u=a("85Hg2");var zm=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}));var Um=({message:e,memori:t,tenant:n,baseUrl:o})=>r(u).createElement(r(u).Fragment,null,e.initial&&r(u).createElement("div",{className:"memori-chat--bubble-initial"}),r(u).createElement(dp,{show:!0,appear:!0,as:"div",className:r(Xd)("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!e.fromUser})},!e.fromUser&&r(u).createElement(dp.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15")},r(u).createElement("source",{src:Fm({type:"avatar",tenantID:null==n?void 0:n.id,resourceURI:t.avatarURL,baseURL:o})}),r(u).createElement("img",{className:"memori-chat--bubble-avatar-img",alt:t.name,src:t.avatarURL&&t.avatarURL.length>0?Fm({type:"avatar",tenantID:null==n?void 0:n.id,resourceURI:t.avatarURL,baseURL:o}):Fm({tenantID:null==n?void 0:n.id,type:"avatar",baseURL:o||"https://app.twincreator.com"})})),r(u).createElement(dp.Child,{as:"div",className:r(Xd)("memori-chat--bubble",{"memori-chat--user-bubble":!!e.fromUser}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30")},(e.translatedText||e.text).split(/\r\n|\r|\n/).map(((e,t)=>r(u).createElement("p",{key:t},e)))),e.fromUser&&r(u).createElement(dp.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15")},r(u).createElement(zm,null))));u=a("85Hg2"),u=a("85Hg2"),u=a("85Hg2");var Hm,Gm=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})),Wm=(Xd=a("4IUwl"),{});Hm=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function n(e,n){var r=e.el,o=e.elStyle,i=e.elHeight,a=e.rowsLimit,s=e.rowsWrapped,l=e.options,c=e.buffer,u=c;if(s===a+1)return t({},e);var d=c,f=s,h=i;return r.innerHTML=u=c.length?""+c+l.delimiter+n+l.replaceStr:""+n+l.replaceStr,parseFloat(o.height)>parseFloat(i)&&(f++,h=o.height,f===a+1)?(r.innerHTML=u="."===d[d.length-1]&&"..."===l.replaceStr?d+"..":""+d+l.replaceStr,t({},e,{elHeight:h,rowsWrapped:f})):(r.innerHTML=u=d.length?""+d+l.delimiter+n:""+n,t({},e,{buffer:u,elHeight:h,rowsWrapped:f}))}e.disableResponsive=function(e){window.removeEventListener("resize",e)},e.ellipsis=function e(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={replaceStr:"...",responsive:!1,debounceDelay:250,delimiter:" "},s=t({},a,i),l=r&&(r instanceof NodeList?r:1===r.nodeType?[r]:document.querySelectorAll(r)),c=[],u=0;u<l.length;u++){var d=l[u];c[u]=d.innerHTML;var f=d.innerHTML.split(s.delimiter);d.innerHTML="";var h=window.getComputedStyle(d);f.reduce(n,{el:d,buffer:d.innerHTML,elStyle:h,elHeight:0,rowsLimit:o,rowsWrapped:0,options:s})}if(s.responsive){var p=!1,m=window.innerWidth,g=function(){if(window.innerWidth!==m){m=window.innerWidth;for(var n=0;n<l.length;n++)l[n].innerHTML=c[n];e(r,o,t({},i,{responsive:!1}))}},v=function(){clearTimeout(p),p=setTimeout(g,s.debounceDelay)};return window.addEventListener("resize",v),v}}},"function"==typeof define&&define.amd?define(["exports"],Hm):Hm(Wm);u=a("85Hg2"),Xd=a("4IUwl");var Vm=({loading:e=!1,className:t,title:n,description:o,cover:i,hoverable:a=!1,children:s})=>r(u).createElement("div",{className:r(Xd)("memori-card",t,{"memori-card--loading":e,"memori-card--with-cover":i,"memori-card--hoverable":a})},r(u).createElement(fp,{spinning:e},i&&r(u).createElement("div",{className:"memori-card--cover"},i),r(u).createElement("div",{className:"memori-card--content"},n&&r(u).createElement("h3",{className:"memori-card--title"},n),o&&r(u).createElement("p",{className:"memori-card--description"},o),r(u).createElement("div",{className:"memori-card--children"},s))));const qm=({item:e,baseUrl:t,onLinkPreviewInfo:n,descriptionOneLine:o=!1})=>{var i,a,s,l;const[c,d]=(0,u.useState)(null),f=(null===(i=e.url)||void 0===i?void 0:i.startsWith("http"))||!e.url||0===(null===(a=e.url)||void 0===a?void 0:a.length)?e.url:`https://${e.url}`;(0,u.useEffect)((()=>{var r,o;let i=(null===(r=e.url)||void 0===r?void 0:r.startsWith("http"))||!e.url||0===(null===(o=e.url)||void 0===o?void 0:o.length)?e.url:`https://${e.url}`;i&&i!==(null==c?void 0:c.urlKey)&&(async(e,t)=>{try{const n=await fetch(`${t||"https://app.twincreator.com"}/api/linkpreview/${encodeURIComponent(e)}`);return await n.json()}catch(e){return console.error("getSiteInfo",e),null}})(i,t).then((e=>{d(e?{...e,urlKey:i}:null),n&&e&&n(e)}))}),[null==e?void 0:e.url,t,n]);const h=e.title&&e.title.length>0?e.title:null==c?void 0:c.title,p=null==c?void 0:c.description,m=null==c?void 0:c.video,g=null!==(s=null==c?void 0:c.image)&&void 0!==s?s:null===(l=null==c?void 0:c.images)||void 0===l?void 0:l[0];return(0,u.useEffect)((()=>{setTimeout((()=>{(0,Wm.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[p,e.mediumID]),r(u).createElement("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"memori-link-item--link"},r(u).createElement(Vm,{hoverable:!0,className:r(Xd)("memori-link-item--card",{"memori-link-item--card-description-oneline":o,"memori-link-item--card-has-image":g,"memori-link-item--card-has-video":m}),cover:m?r(u).createElement("iframe",{width:"100%",height:"100%",src:m,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):g?r(u).createElement("img",{className:"memori-link-item--card-cover-img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",srcSet:g.includes("data:image")?void 0:g,alt:e.title}):r(u).createElement("div",{className:"memori-link-item--card-cover-icon"},r(u).createElement(Gm,{className:"memori-link-item--icon"})),title:h,description:p}))};var Km=({items:e,baseUrl:t,descriptionOneLine:n=!1,onLinkPreviewInfo:o})=>r(u).createElement(dp,{appear:!0,show:!0,as:"div",className:"memori-link-items"},r(u).createElement("div",{className:"memori-link-items--grid"},e.map(((e,i)=>r(u).createElement(dp.Child,{as:"div",className:"memori-link-item",key:e.mediumID,enter:"ease-out duration-500 delay-"+100*i,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95"},r(u).createElement(qm,{item:e,baseUrl:t,descriptionOneLine:n,onLinkPreviewInfo:o}))))));u=a("85Hg2");const $m=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],Jm=async(e,t,n,r)=>{var o;const i=$m.indexOf(e.toLowerCase())>-1?"IT":null==n?void 0:n.toUpperCase(),a=await fetch(`${r||"https://app.twincreator.com"}/api/translate?text=${encodeURIComponent(e)}&target_lang=${t.toUpperCase()}${i?`&source_lang=${i}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),s=await a.json();return null===(o=null==s?void 0:s.translations)||void 0===o?void 0:o[0]},Xm=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"}],Qm=["image/jpeg","image/png","image/jpg","image/gif","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/pdf","video/mp4","video/avi","audio/mpeg3","audio/wav","audio/mpeg","video/mpeg","model/gltf-binary"],Ym="👤",Zm=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}];u=a("85Hg2");var eg=({src:e,poster:t,alt:n=""})=>((0,u.useEffect)((()=>{const e=document.createElement("script");return e.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",e.type="module",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),r(u).createElement("div",{className:"model-viewer"},r(u).createElement("model-viewer",{src:e,"ios-src":"",poster:t,alt:n,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})));u=a("85Hg2"),u=a("85Hg2");var tg=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})),ng={};function rg(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}(ng=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){rg(i,r,o,a,s,"next",e)}function s(e){rg(i,r,o,a,s,"throw",e)}a(void 0)}))}}).__esModule=!0,ng.default=ng;var og={};function ig(){return og=ig=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},og.__esModule=!0,og.default=og,ig.apply(this,arguments)}(og=ig).__esModule=!0,og.default=og;var ag={};(ag=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}).__esModule=!0,ag.default=ag;var sg={},lg={},cg=a("7h3ED").default,ug={},dg=a("7h3ED").default;function fg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lg(r.key),r)}}(ug=function(e,t){if("object"!==dg(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==dg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}).__esModule=!0,ug.default=ug,(lg=function(e){var t=ug(e,"string");return"symbol"===cg(t)?t:String(t)}).__esModule=!0,lg.default=lg,(sg=function(e,t,n){return t&&fg(e.prototype,t),n&&fg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}).__esModule=!0,sg.default=sg;var hg={},pg={};function mg(e,t){return pg=mg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pg.__esModule=!0,pg.default=pg,mg(e,t)}(pg=mg).__esModule=!0,pg.default=pg,(hg=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pg(e,t)}).__esModule=!0,hg.default=hg;var gg={},vg=a("7h3ED").default,bg={};(bg=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}).__esModule=!0,bg.default=bg,(gg=function(e,t){if(t&&("object"===vg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return bg(e)}).__esModule=!0,gg.default=gg;var yg={};function wg(e){return yg=wg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yg.__esModule=!0,yg.default=yg,wg(e)}(yg=wg).__esModule=!0,yg.default=yg;var xg={};(xg=function(e,t,n){return(t=lg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}).__esModule=!0,xg.default=xg;var Sg,Mg=a("6EIcq")();Sg=Mg;try{regeneratorRuntime=Mg}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=Mg:Function("r","regeneratorRuntime = r")(Mg)}u=a("85Hg2");var _g={},Eg={};(Eg=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}).__esModule=!0,Eg.default=Eg,(_g=function(e,t){if(null==e)return{};var n,r,o=Eg(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}).__esModule=!0,_g.default=_g;var Ag={},Cg={},kg={};(kg=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}).__esModule=!0,kg.default=kg,(Cg=function(e){if(Array.isArray(e))return kg(e)}).__esModule=!0,Cg.default=Cg;var Tg={};(Tg=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}).__esModule=!0,Tg.default=Tg;var Ig={};Ig=function(e,t){if(e){if("string"==typeof e)return kg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kg(e,t):void 0}},Ig.__esModule=!0,Ig.default=Ig;var Og={};(Og=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,Og.default=Og,(Ag=function(e){return Cg(e)||Tg(e)||Ig(e)||Og()}).__esModule=!0,Ag.default=Ag;u=a("85Hg2"),u=a("85Hg2");function Rg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rg(Object(n),!0).forEach((function(t){r(xg)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ng={};function Lg(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return Ng[r]||(Ng[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),Ng[r]}function Bg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),o=Lg(r);return o.reduce((function(e,t){return Pg(Pg({},e),n[t])}),t)}function Dg(e){return e.join(" ")}function jg(e){var t=e.node,n=e.stylesheet,o=e.style,i=void 0===o?{}:o,a=e.useInlineStyles,s=e.key,l=t.properties,c=t.type,d=t.tagName,f=t.value;if("text"===c)return f;if(d){var h,p=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,o){return jg({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(o)})}))}}(n,a);if(a){var m=Object.keys(n).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&g.concat(l.className.filter((function(e){return!m.includes(e)})));h=Pg(Pg({},l),{},{className:Dg(v)||void 0,style:Bg(l.className,Object.assign({},l.style,i),n)})}else h=Pg(Pg({},l),{},{className:Dg(l.className)});var b=p(t.children);return r(u).createElement(d,r(og)({key:s},h),b)}}var Fg=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function zg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ug(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zg(Object(n),!0).forEach((function(t){r(xg)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Hg=/\n/g;function Gg(e){var t=e.codeString,n=e.codeStyle,o=e.containerStyle,i=void 0===o?{float:"left",paddingRight:"10px"}:o,a=e.numberStyle,s=void 0===a?{}:a,l=e.startingLineNumber;return r(u).createElement("code",{style:Object.assign({},n,i)},function(e){var t=e.lines,n=e.startingLineNumber,o=e.style;return t.map((function(e,t){var i=t+n;return r(u).createElement("span",{key:"line-".concat(t),className:"react-syntax-highlighter-line-number",style:"function"==typeof o?o(i):o},"".concat(i,"\n"))}))}({lines:t.replace(/\n$/,"").split("\n"),style:s,startingLineNumber:l}))}function Wg(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Vg(e,t,n){var r,o={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},i="function"==typeof e?e(t):e;return Ug(Ug({},o),i)}function qg(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,o=e.largestLineNumber,i=e.showInlineLineNumbers,a=e.lineProps,s=void 0===a?{}:a,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,f="function"==typeof s?s(n):s;if(f.className=c,n&&i){var h=Vg(r,n,o);t.unshift(Wg(n,h))}return d&u&&(f.style=Ug(Ug({},f.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:f,children:t}}function Kg(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=0;o<e.length;o++){var i=e[o];if("text"===i.type)n.push(qg({children:[i],className:r(Ag)(new Set(t))}));else if(i.children){var a=t.concat(i.properties.className);Kg(i.children,a).forEach((function(e){return n.push(e)}))}}return n}function $g(e,t,n,r,o,i,a,s,l){var c,u=Kg(e.value),d=[],f=-1,h=0;function p(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return qg({children:e,lineNumber:t,lineNumberStyle:s,largestLineNumber:a,showInlineLineNumbers:o,lineProps:n,className:i,showLineNumbers:r,wrapLongLines:l})}function m(e,t){if(r&&t&&o){var n=Vg(s,t,a);e.unshift(Wg(t,n))}return e}function g(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?p(e,n,r):m(e,n)}for(var v=function(){var e=u[h],t=e.children[0].value;if(t.match(Hg)){var n=t.split("\n");n.forEach((function(t,o){var a=r&&d.length+i,s={type:"text",value:"".concat(t,"\n")};if(0===o){var l=g(u.slice(f+1,h).concat(qg({children:[s],className:e.properties.className})),a);d.push(l)}else if(o===n.length-1){var c=u[h+1]&&u[h+1].children&&u[h+1].children[0],p={type:"text",value:"".concat(t)};if(c){var m=qg({children:[p],className:e.properties.className});u.splice(h+1,0,m)}else{var v=g([p],a,e.properties.className);d.push(v)}}else{var b=g([s],a,e.properties.className);d.push(b)}})),f=h}h++};h<u.length;)v();if(f!==u.length-1){var b=u.slice(f+1,u.length);if(b&&b.length){var y=g(b,r&&d.length+i);d.push(y)}}return t?d:(c=[]).concat.apply(c,d)}function Jg(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return jg({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function Xg(e){return e&&void 0!==e.highlightAuto}function Qg(e,t){return function(n){var o=n.language,i=n.children,a=n.style,s=void 0===a?t:a,l=n.customStyle,c=void 0===l?{}:l,d=n.codeTagProps,f=void 0===d?{className:o?"language-".concat(o):void 0,style:Ug(Ug({},s['code[class*="language-"]']),s['code[class*="language-'.concat(o,'"]')])}:d,h=n.useInlineStyles,p=void 0===h||h,m=n.showLineNumbers,g=void 0!==m&&m,v=n.showInlineLineNumbers,b=void 0===v||v,y=n.startingLineNumber,w=void 0===y?1:y,x=n.lineNumberContainerStyle,S=n.lineNumberStyle,M=void 0===S?{}:S,_=n.wrapLines,E=n.wrapLongLines,A=void 0!==E&&E,C=n.lineProps,k=void 0===C?{}:C,T=n.renderer,I=n.PreTag,O=void 0===I?"pre":I,R=n.CodeTag,P=void 0===R?"code":R,N=n.code,L=void 0===N?(Array.isArray(i)?i[0]:i)||"":N,B=n.astGenerator,D=r(_g)(n,Fg);B=B||e;var j=g?r(u).createElement(Gg,{containerStyle:x,codeStyle:f.style||{},numberStyle:M,startingLineNumber:w,codeString:L}):null,F=s.hljs||s['pre[class*="language-"]']||{backgroundColor:"#fff"},z=Xg(B)?"hljs":"prismjs",U=p?Object.assign({},D,{style:Object.assign({},F,c)}):Object.assign({},D,{className:D.className?"".concat(z," ").concat(D.className):z,style:Object.assign({},c)});if(f.style=Ug(Ug({},f.style),{},A?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"}),!B)return r(u).createElement(O,U,j,r(u).createElement(P,f,L));(void 0===_&&T||A)&&(_=!0),T=T||Jg;var H=[{type:"text",value:L}],G=function(e){var t=e.astGenerator,n=e.language,r=e.code,o=e.defaultCodeValue;if(Xg(t)){var i=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:o,language:"text"}:i?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:o}}catch(e){return{value:o}}}({astGenerator:B,language:o,code:L,defaultCodeValue:H});null===G.language&&(G.value=H);var W=$g(G,_,k,g,b,w,G.value.length+w,M,A);return r(u).createElement(O,U,r(u).createElement(P,f,!b&&j,T({rows:W,stylesheet:s,useInlineStyles:p})))}}function Yg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=r(yg)(e);if(t){var i=r(yg)(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return r(gg)(this,n)}}var Zg,ev,tv,nv,rv,ov,iv,av=function(e,t){return function(){var n=r(ng)(r(Sg).mark((function n(o){var i;return r(Sg).wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t();case 2:i=n.sent,o(e,i.default||i);case 4:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()},sv={abap:av("abap",(function(){return a("bwHpE")})),abnf:av("abnf",(function(){return a("daD87")})),actionscript:av("actionscript",(function(){return a("lpEgO")})),ada:av("ada",(function(){return a("1sGW9")})),agda:av("agda",(function(){return a("e9VyR")})),al:av("al",(function(){return a("kMFSe")})),antlr4:av("antlr4",(function(){return a("8HlsP")})),apacheconf:av("apacheconf",(function(){return a("isFCh")})),apex:av("apex",(function(){return a("gUXVM")})),apl:av("apl",(function(){return a("2L15v")})),applescript:av("applescript",(function(){return a("8XyFT")})),aql:av("aql",(function(){return a("gFWTI")})),arduino:av("arduino",(function(){return a("jI3VB")})),arff:av("arff",(function(){return a("6uYTH")})),asciidoc:av("asciidoc",(function(){return a("gdYKH")})),asm6502:av("asm6502",(function(){return a("ahFLg")})),asmatmel:av("asmatmel",(function(){return a("4irIu")})),aspnet:av("aspnet",(function(){return a("yDC6n")})),autohotkey:av("autohotkey",(function(){return a("a4xpy")})),autoit:av("autoit",(function(){return a("iNSix")})),avisynth:av("avisynth",(function(){return a("kEBnk")})),avroIdl:av("avroIdl",(function(){return a("lzthi")})),bash:av("bash",(function(){return Promise.resolve(a("3aDLI"))})),basic:av("basic",(function(){return a("cxDu6")})),batch:av("batch",(function(){return a("6zDll")})),bbcode:av("bbcode",(function(){return a("bPS87")})),bicep:av("bicep",(function(){return a("8dy5f")})),birb:av("birb",(function(){return a("3vHrY")})),bison:av("bison",(function(){return a("bCjBS")})),bnf:av("bnf",(function(){return a("4NqDW")})),brainfuck:av("brainfuck",(function(){return a("4s0KX")})),brightscript:av("brightscript",(function(){return a("jTsQ4")})),bro:av("bro",(function(){return a("5lMc2")})),bsl:av("bsl",(function(){return a("jBYxC")})),c:av("c",(function(){return Promise.resolve(a("lyZgY"))})),cfscript:av("cfscript",(function(){return a("coZDy")})),chaiscript:av("chaiscript",(function(){return a("e1zEN")})),cil:av("cil",(function(){return a("crKoM")})),clike:av("clike",(function(){return a("4kO9t")})),clojure:av("clojure",(function(){return a("01SpB")})),cmake:av("cmake",(function(){return a("9yG4p")})),cobol:av("cobol",(function(){return a("967Hn")})),coffeescript:av("coffeescript",(function(){return a("7Yi6H")})),concurnas:av("concurnas",(function(){return a("5tXmX")})),coq:av("coq",(function(){return a("ektdr")})),cpp:av("cpp",(function(){return Promise.resolve(a("lR39A"))})),crystal:av("crystal",(function(){return a("8gt4L")})),csharp:av("csharp",(function(){return a("7K6eJ")})),cshtml:av("cshtml",(function(){return a("cVu4i")})),csp:av("csp",(function(){return a("ecKo1")})),cssExtras:av("cssExtras",(function(){return a("gnpv8")})),css:av("css",(function(){return a("jx0H8")})),csv:av("csv",(function(){return a("f9kmW")})),cypher:av("cypher",(function(){return a("lojor")})),d:av("d",(function(){return a("6Qa0U")})),dart:av("dart",(function(){return a("74K1B")})),dataweave:av("dataweave",(function(){return a("93H6c")})),dax:av("dax",(function(){return a("cf9Y9")})),dhall:av("dhall",(function(){return a("f6UWv")})),diff:av("diff",(function(){return a("klPVo")})),django:av("django",(function(){return a("jfxe9")})),dnsZoneFile:av("dnsZoneFile",(function(){return a("5aMz5")})),docker:av("docker",(function(){return a("kOauC")})),dot:av("dot",(function(){return a("btE6k")})),ebnf:av("ebnf",(function(){return a("aT88c")})),editorconfig:av("editorconfig",(function(){return a("jWOl8")})),eiffel:av("eiffel",(function(){return a("kHJaX")})),ejs:av("ejs",(function(){return a("frfnA")})),elixir:av("elixir",(function(){return a("hcrJ2")})),elm:av("elm",(function(){return a("jd271")})),erb:av("erb",(function(){return a("gczXL")})),erlang:av("erlang",(function(){return a("FsabW")})),etlua:av("etlua",(function(){return a("9DI9l")})),excelFormula:av("excelFormula",(function(){return a("3QVue")})),factor:av("factor",(function(){return a("ltNCT")})),falselang:av("falselang",(function(){return a("g0Q6p")})),firestoreSecurityRules:av("firestoreSecurityRules",(function(){return a("ukA2V")})),flow:av("flow",(function(){return a("e5prn")})),fortran:av("fortran",(function(){return a("gIEL6")})),fsharp:av("fsharp",(function(){return a("3wQkt")})),ftl:av("ftl",(function(){return a("7ZVWs")})),gap:av("gap",(function(){return a("hOFj6")})),gcode:av("gcode",(function(){return a("95BzQ")})),gdscript:av("gdscript",(function(){return a("iul6t")})),gedcom:av("gedcom",(function(){return a("e0qJM")})),gherkin:av("gherkin",(function(){return a("2SHak")})),git:av("git",(function(){return a("l6VFH")})),glsl:av("glsl",(function(){return a("cEMfJ")})),gml:av("gml",(function(){return a("8UVTr")})),gn:av("gn",(function(){return a("kvibD")})),goModule:av("goModule",(function(){return a("icqjF")})),go:av("go",(function(){return a("jLkg8")})),graphql:av("graphql",(function(){return a("aYGNi")})),groovy:av("groovy",(function(){return a("4bTmH")})),haml:av("haml",(function(){return a("h2A6V")})),handlebars:av("handlebars",(function(){return a("79YVJ")})),haskell:av("haskell",(function(){return a("bsiLW")})),haxe:av("haxe",(function(){return a("94Kdj")})),hcl:av("hcl",(function(){return a("9CheR")})),hlsl:av("hlsl",(function(){return a("h3dqW")})),hoon:av("hoon",(function(){return a("9WbsW")})),hpkp:av("hpkp",(function(){return a("GiPN3")})),hsts:av("hsts",(function(){return a("eaSn9")})),http:av("http",(function(){return a("1uj7b")})),ichigojam:av("ichigojam",(function(){return a("ge562")})),icon:av("icon",(function(){return a("lVHUf")})),icuMessageFormat:av("icuMessageFormat",(function(){return a("aYoUL")})),idris:av("idris",(function(){return a("1RVAE")})),iecst:av("iecst",(function(){return a("bi7Dr")})),ignore:av("ignore",(function(){return a("cq0Pi")})),inform7:av("inform7",(function(){return a("31K4E")})),ini:av("ini",(function(){return a("l05OZ")})),io:av("io",(function(){return a("6bY1b")})),j:av("j",(function(){return a("1ebDS")})),java:av("java",(function(){return a("iEZZI")})),javadoc:av("javadoc",(function(){return a("aHy5a")})),javadoclike:av("javadoclike",(function(){return a("5f3rE")})),javascript:av("javascript",(function(){return a("7JDFI")})),javastacktrace:av("javastacktrace",(function(){return a("gdCGE")})),jexl:av("jexl",(function(){return a("cqMb9")})),jolie:av("jolie",(function(){return a("cEDX4")})),jq:av("jq",(function(){return a("kEWsh")})),jsExtras:av("jsExtras",(function(){return a("74PI8")})),jsTemplates:av("jsTemplates",(function(){return a("30TPr")})),jsdoc:av("jsdoc",(function(){return a("9DH5c")})),json:av("json",(function(){return Promise.resolve(a("l1Rj1"))})),json5:av("json5",(function(){return a("920rv")})),jsonp:av("jsonp",(function(){return a("9AwS1")})),jsstacktrace:av("jsstacktrace",(function(){return a("bYXMr")})),jsx:av("jsx",(function(){return Promise.resolve(a("6ho3O"))})),julia:av("julia",(function(){return a("g0ibH")})),keepalived:av("keepalived",(function(){return a("2hdnH")})),keyman:av("keyman",(function(){return a("cIufI")})),kotlin:av("kotlin",(function(){return a("c26dU")})),kumir:av("kumir",(function(){return a("iYAha")})),kusto:av("kusto",(function(){return a("9z1oX")})),latex:av("latex",(function(){return a("lCPLU")})),latte:av("latte",(function(){return a("c9oN0")})),less:av("less",(function(){return a("hA3V9")})),lilypond:av("lilypond",(function(){return a("hpHTA")})),liquid:av("liquid",(function(){return a("kpZTm")})),lisp:av("lisp",(function(){return a("chgK5")})),livescript:av("livescript",(function(){return a("2gdiv")})),llvm:av("llvm",(function(){return a("jUeFO")})),log:av("log",(function(){return a("3BFSQ")})),lolcode:av("lolcode",(function(){return a("lG9br")})),lua:av("lua",(function(){return a("cVGpd")})),magma:av("magma",(function(){return a("4LVzY")})),makefile:av("makefile",(function(){return a("2NviD")})),markdown:av("markdown",(function(){return a("jUFCF")})),markupTemplating:av("markupTemplating",(function(){return Promise.resolve(a("t3W0d"))})),markup:av("markup",(function(){return a("5hIXu")})),matlab:av("matlab",(function(){return a("kPAC0")})),maxscript:av("maxscript",(function(){return a("gHOJy")})),mel:av("mel",(function(){return a("9mj6e")})),mermaid:av("mermaid",(function(){return a("kozw5")})),mizar:av("mizar",(function(){return a("2bN6W")})),mongodb:av("mongodb",(function(){return a("eHKWX")})),monkey:av("monkey",(function(){return a("7Fh0C")})),moonscript:av("moonscript",(function(){return a("hDXwC")})),n1ql:av("n1ql",(function(){return a("j9bkC")})),n4js:av("n4js",(function(){return a("eTmBF")})),nand2tetrisHdl:av("nand2tetrisHdl",(function(){return a("ezjCf")})),naniscript:av("naniscript",(function(){return a("VxHk1")})),nasm:av("nasm",(function(){return a("ly95T")})),neon:av("neon",(function(){return a("7Fk34")})),nevod:av("nevod",(function(){return a("3U8Qv")})),nginx:av("nginx",(function(){return a("c6qVk")})),nim:av("nim",(function(){return a("1JdCk")})),nix:av("nix",(function(){return a("jcstS")})),nsis:av("nsis",(function(){return a("kEJqW")})),objectivec:av("objectivec",(function(){return a("lUP8A")})),ocaml:av("ocaml",(function(){return a("lhTAD")})),opencl:av("opencl",(function(){return a("8rxKO")})),openqasm:av("openqasm",(function(){return a("ib0uL")})),oz:av("oz",(function(){return a("csCUS")})),parigp:av("parigp",(function(){return a("2DkHE")})),parser:av("parser",(function(){return a("2cp75")})),pascal:av("pascal",(function(){return a("fViVl")})),pascaligo:av("pascaligo",(function(){return a("9Uuxa")})),pcaxis:av("pcaxis",(function(){return a("jUdnN")})),peoplecode:av("peoplecode",(function(){return a("l8w4e")})),perl:av("perl",(function(){return a("aX7dM")})),phpExtras:av("phpExtras",(function(){return a("3cMZl")})),php:av("php",(function(){return Promise.resolve(a("5li5P"))})),phpdoc:av("phpdoc",(function(){return a("bDyJN")})),plsql:av("plsql",(function(){return a("cPuMN")})),powerquery:av("powerquery",(function(){return a("jE1gU")})),powershell:av("powershell",(function(){return a("k7t0j")})),processing:av("processing",(function(){return a("jr8hV")})),prolog:av("prolog",(function(){return a("hpuat")})),promql:av("promql",(function(){return a("ckXC5")})),properties:av("properties",(function(){return a("fAh6P")})),protobuf:av("protobuf",(function(){return a("R6WqB")})),psl:av("psl",(function(){return a("Al65w")})),pug:av("pug",(function(){return a("dxbNS")})),puppet:av("puppet",(function(){return a("lrSuh")})),pure:av("pure",(function(){return a("6DKQK")})),purebasic:av("purebasic",(function(){return a("7ZkSb")})),purescript:av("purescript",(function(){return a("dBTYx")})),python:av("python",(function(){return Promise.resolve(a("kiy5M"))})),q:av("q",(function(){return a("4FXyy")})),qml:av("qml",(function(){return a("2zZFj")})),qore:av("qore",(function(){return a("iCK1Y")})),qsharp:av("qsharp",(function(){return a("dvH9H")})),r:av("r",(function(){return a("lQqRt")})),racket:av("racket",(function(){return a("eHKmq")})),reason:av("reason",(function(){return a("kkeLT")})),regex:av("regex",(function(){return a("llX50")})),rego:av("rego",(function(){return a("9hKdZ")})),renpy:av("renpy",(function(){return a("cJgw5")})),rest:av("rest",(function(){return a("867DK")})),rip:av("rip",(function(){return a("3Odjx")})),roboconf:av("roboconf",(function(){return a("gQ0Us")})),robotframework:av("robotframework",(function(){return a("bLCgx")})),ruby:av("ruby",(function(){return Promise.resolve(a("ch1PX"))})),rust:av("rust",(function(){return a("cInT8")})),sas:av("sas",(function(){return a("iz7eP")})),sass:av("sass",(function(){return a("hrDC3")})),scala:av("scala",(function(){return a("ub8Bf")})),scheme:av("scheme",(function(){return a("7NAAt")})),scss:av("scss",(function(){return Promise.resolve(a("fU6a0"))})),shellSession:av("shellSession",(function(){return a("7kKCv")})),smali:av("smali",(function(){return a("2lkCb")})),smalltalk:av("smalltalk",(function(){return a("4280y")})),smarty:av("smarty",(function(){return a("4hXYK")})),sml:av("sml",(function(){return a("jh2E8")})),solidity:av("solidity",(function(){return a("dTdF2")})),solutionFile:av("solutionFile",(function(){return a("iI5tm")})),soy:av("soy",(function(){return a("aoU5C")})),sparql:av("sparql",(function(){return a("ggrvb")})),splunkSpl:av("splunkSpl",(function(){return a("8LhCX")})),sqf:av("sqf",(function(){return a("3tDsu")})),sql:av("sql",(function(){return Promise.resolve(a("bnDV9"))})),squirrel:av("squirrel",(function(){return a("bxaUV")})),stan:av("stan",(function(){return a("dBqrq")})),stylus:av("stylus",(function(){return a("JlHVK")})),swift:av("swift",(function(){return a("c7NBs")})),systemd:av("systemd",(function(){return a("jprZl")})),t4Cs:av("t4Cs",(function(){return a("edsMI")})),t4Templating:av("t4Templating",(function(){return a("bS9Wa")})),t4Vb:av("t4Vb",(function(){return a("gYk20")})),tap:av("tap",(function(){return a("byv7d")})),tcl:av("tcl",(function(){return a("lUAIZ")})),textile:av("textile",(function(){return a("7J2LO")})),toml:av("toml",(function(){return a("eXtdM")})),tremor:av("tremor",(function(){return a("vyajH")})),tsx:av("tsx",(function(){return Promise.resolve(a("7cTnl"))})),tt2:av("tt2",(function(){return a("8XOOm")})),turtle:av("turtle",(function(){return a("1XvLQ")})),twig:av("twig",(function(){return a("i9Fpp")})),typescript:av("typescript",(function(){return Promise.resolve(a("fzL8k"))})),typoscript:av("typoscript",(function(){return a("kKk69")})),unrealscript:av("unrealscript",(function(){return a("jgq8Y")})),uorazor:av("uorazor",(function(){return a("dsZ00")})),uri:av("uri",(function(){return a("fqJRp")})),v:av("v",(function(){return a("bgfyB")})),vala:av("vala",(function(){return a("68x4q")})),vbnet:av("vbnet",(function(){return a("eUhQs")})),velocity:av("velocity",(function(){return a("fPNdV")})),verilog:av("verilog",(function(){return a("2fM1V")})),vhdl:av("vhdl",(function(){return a("hNF6q")})),vim:av("vim",(function(){return a("75TCr")})),visualBasic:av("visualBasic",(function(){return a("fc93z")})),warpscript:av("warpscript",(function(){return a("jgHlG")})),wasm:av("wasm",(function(){return a("dVZkI")})),webIdl:av("webIdl",(function(){return a("9Jnxv")})),wiki:av("wiki",(function(){return a("1Gimo")})),wolfram:av("wolfram",(function(){return a("4SyRT")})),wren:av("wren",(function(){return a("gaIVs")})),xeora:av("xeora",(function(){return a("lagad")})),xmlDoc:av("xmlDoc",(function(){return a("9DNYE")})),xojo:av("xojo",(function(){return a("ksF4f")})),xquery:av("xquery",(function(){return a("gXxHJ")})),yaml:av("yaml",(function(){return a("6rk3j")})),yang:av("yang",(function(){return a("kTyrQ")})),zig:av("zig",(function(){return a("d3mFC")}))},lv=(ev=(Zg={loader:function(){return a("bB2YF").then((function(e){return e.default||e}))},isLanguageRegistered:function(e,t){return e.registered(t)},languageLoaders:sv,registerLanguage:function(e,t,n){return e.register(n)}}).loader,tv=Zg.isLanguageRegistered,nv=Zg.registerLanguage,rv=Zg.languageLoaders,ov=Zg.noAsyncLoadingLanguages,iv=function(e){r(hg)(o,e);var t,n=Yg(o);function o(){return r(ag)(this,o),n.apply(this,arguments)}return r(sg)(o,[{key:"componentDidUpdate",value:function(){!o.isRegistered(this.props.language)&&rv&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var e=this;o.astGeneratorPromise||o.loadAstGenerator(),o.astGenerator||o.astGeneratorPromise.then((function(){e.forceUpdate()})),!o.isRegistered(this.props.language)&&rv&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var e=this,t=this.props.language;"text"!==t&&o.loadLanguage(t).then((function(){return e.forceUpdate()})).catch((function(){}))}},{key:"normalizeLanguage",value:function(e){return o.isSupportedLanguage(e)?e:"text"}},{key:"render",value:function(){return r(u).createElement(o.highlightInstance,r(og)({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:o.astGenerator}))}}],[{key:"preload",value:function(){return o.loadAstGenerator()}},{key:"loadLanguage",value:(t=r(ng)(r(Sg).mark((function e(t){var n;return r(Sg).wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(n=rv[t])){e.next=5;break}return e.abrupt("return",n(o.registerLanguage));case 5:throw new Error("Language ".concat(t," not supported"));case 6:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"isSupportedLanguage",value:function(e){return o.isRegistered(e)||"function"==typeof rv[e]}},{key:"loadAstGenerator",value:function(){return o.astGeneratorPromise=ev().then((function(e){o.astGenerator=e,nv&&o.languages.forEach((function(t,n){return nv(e,n,t)}))})),o.astGeneratorPromise}}]),o}(r(u).PureComponent),r(xg)(iv,"astGenerator",null),r(xg)(iv,"highlightInstance",Qg(null,{})),r(xg)(iv,"astGeneratorPromise",null),r(xg)(iv,"languages",new Map),r(xg)(iv,"supportedLanguages",Zg.supportedLanguages||Object.keys(rv||{})),r(xg)(iv,"isRegistered",(function(e){if(ov)return!0;if(!nv)throw new Error("Current syntax highlighter doesn't support registration of languages");return iv.astGenerator?tv(iv.astGenerator,e):iv.languages.has(e)})),r(xg)(iv,"registerLanguage",(function(e,t){if(!nv)throw new Error("Current syntax highlighter doesn't support registration of languages");if(iv.astGenerator)return nv(iv.astGenerator,e,t);iv.languages.set(e,t)})),iv),cv={},uv={};(uv=function(e){return e&&e.__esModule?e:{default:e}}).__esModule=!0,uv.default=uv,Object.defineProperty(cv,"__esModule",{value:!0}),Object.defineProperty(cv,"a11yDark",{enumerable:!0,get:function(){return yv.default}}),Object.defineProperty(cv,"atomDark",{enumerable:!0,get:function(){return wv.default}}),Object.defineProperty(cv,"base16AteliersulphurpoolLight",{enumerable:!0,get:function(){return xv.default}}),Object.defineProperty(cv,"cb",{enumerable:!0,get:function(){return Sv.default}}),Object.defineProperty(cv,"coldarkCold",{enumerable:!0,get:function(){return Mv.default}}),Object.defineProperty(cv,"coldarkDark",{enumerable:!0,get:function(){return _v.default}}),Object.defineProperty(cv,"coy",{enumerable:!0,get:function(){return dv.default}}),Object.defineProperty(cv,"coyWithoutShadows",{enumerable:!0,get:function(){return Ev.default}}),Object.defineProperty(cv,"darcula",{enumerable:!0,get:function(){return Av.default}}),Object.defineProperty(cv,"dark",{enumerable:!0,get:function(){return fv.default}}),Object.defineProperty(cv,"dracula",{enumerable:!0,get:function(){return Cv.default}}),Object.defineProperty(cv,"duotoneDark",{enumerable:!0,get:function(){return kv.default}}),Object.defineProperty(cv,"duotoneEarth",{enumerable:!0,get:function(){return Tv.default}}),Object.defineProperty(cv,"duotoneForest",{enumerable:!0,get:function(){return Iv.default}}),Object.defineProperty(cv,"duotoneLight",{enumerable:!0,get:function(){return Ov.default}}),Object.defineProperty(cv,"duotoneSea",{enumerable:!0,get:function(){return Rv.default}}),Object.defineProperty(cv,"duotoneSpace",{enumerable:!0,get:function(){return Pv.default}}),Object.defineProperty(cv,"funky",{enumerable:!0,get:function(){return hv.default}}),Object.defineProperty(cv,"ghcolors",{enumerable:!0,get:function(){return Nv.default}}),Object.defineProperty(cv,"gruvboxDark",{enumerable:!0,get:function(){return Lv.default}}),Object.defineProperty(cv,"gruvboxLight",{enumerable:!0,get:function(){return Bv.default}}),Object.defineProperty(cv,"holiTheme",{enumerable:!0,get:function(){return Dv.default}}),Object.defineProperty(cv,"hopscotch",{enumerable:!0,get:function(){return jv.default}}),Object.defineProperty(cv,"lucario",{enumerable:!0,get:function(){return Fv.default}}),Object.defineProperty(cv,"materialDark",{enumerable:!0,get:function(){return zv.default}}),Object.defineProperty(cv,"materialLight",{enumerable:!0,get:function(){return Uv.default}}),Object.defineProperty(cv,"materialOceanic",{enumerable:!0,get:function(){return Hv.default}}),Object.defineProperty(cv,"nightOwl",{enumerable:!0,get:function(){return Gv.default}}),Object.defineProperty(cv,"nord",{enumerable:!0,get:function(){return Wv.default}}),Object.defineProperty(cv,"okaidia",{enumerable:!0,get:function(){return pv.default}}),Object.defineProperty(cv,"oneDark",{enumerable:!0,get:function(){return Vv.default}}),Object.defineProperty(cv,"oneLight",{enumerable:!0,get:function(){return qv.default}}),Object.defineProperty(cv,"pojoaque",{enumerable:!0,get:function(){return Kv.default}}),Object.defineProperty(cv,"prism",{enumerable:!0,get:function(){return bv.default}}),Object.defineProperty(cv,"shadesOfPurple",{enumerable:!0,get:function(){return $v.default}}),Object.defineProperty(cv,"solarizedDarkAtom",{enumerable:!0,get:function(){return Jv.default}}),Object.defineProperty(cv,"solarizedlight",{enumerable:!0,get:function(){return mv.default}}),Object.defineProperty(cv,"synthwave84",{enumerable:!0,get:function(){return Xv.default}}),Object.defineProperty(cv,"tomorrow",{enumerable:!0,get:function(){return gv.default}}),Object.defineProperty(cv,"twilight",{enumerable:!0,get:function(){return vv.default}}),Object.defineProperty(cv,"vs",{enumerable:!0,get:function(){return Qv.default}}),Object.defineProperty(cv,"vscDarkPlus",{enumerable:!0,get:function(){return Yv.default}}),Object.defineProperty(cv,"xonokai",{enumerable:!0,get:function(){return Zv.default}}),Object.defineProperty(cv,"zTouch",{enumerable:!0,get:function(){return eb.default}});var dv=uv(a("jcF8U")),fv=uv(a("3Tppx")),hv=uv(a("dBuK7")),pv=uv(a("eEjWK")),mv=uv(a("awG2g")),gv=uv(a("2oFzQ")),vv=uv(a("4Au6Q")),bv=uv(a("dAPqs")),yv=uv(a("8eAql")),wv=uv(a("cv2QE")),xv=uv(a("h5I9g")),Sv=uv(a("i4C5w")),Mv=uv(a("3kFKo")),_v=uv(a("17zK0")),Ev=uv(a("5Avqr")),Av=uv(a("1jHMv")),Cv=uv(a("7Q8CE")),kv=uv(a("jKUos")),Tv=uv(a("Uzm4J")),Iv=uv(a("7yfkN")),Ov=uv(a("lT2l1")),Rv=uv(a("fZ9um")),Pv=uv(a("1MoQL")),Nv=uv(a("4uys7")),Lv=uv(a("kaYsk")),Bv=uv(a("kN6Vu")),Dv=uv(a("2Z6pG")),jv=uv(a("4jQJK")),Fv=uv(a("bpXw0")),zv=uv(a("i4S8s")),Uv=uv(a("5bNr4")),Hv=uv(a("5ZYWT")),Gv=uv(a("ihJCU")),Wv=uv(a("8iIbg")),Vv=uv(a("424u7")),qv=uv(a("jPiNI")),Kv=uv(a("OHVOA")),$v=uv(a("2OKTL")),Jv=uv(a("2Mg8H")),Xv=uv(a("9Kud0")),Qv=uv(a("eCrmR")),Yv=uv(a("8UhcQ")),Zv=uv(a("dtU9z")),eb=uv(a("4xtLO")),tb={};Object.defineProperty(tb,"__esModule",{value:!0}),tb.default=void 0;var nb=uv(a("7cTnl")).default;tb.default=nb;var rb={};Object.defineProperty(rb,"__esModule",{value:!0}),rb.default=void 0;var ob=uv(a("l1Rj1")).default;rb.default=ob;var ib={};Object.defineProperty(ib,"__esModule",{value:!0}),ib.default=void 0;var ab=uv(a("fU6a0")).default;ib.default=ab;var sb={};Object.defineProperty(sb,"__esModule",{value:!0}),sb.default=void 0;var lb=uv(a("3aDLI")).default;sb.default=lb;var cb={};Object.defineProperty(cb,"__esModule",{value:!0}),cb.default=void 0;var ub=uv(a("kiy5M")).default;cb.default=ub;var db={};Object.defineProperty(db,"__esModule",{value:!0}),db.default=void 0;var fb=uv(a("lR39A")).default;db.default=fb;var hb={};Object.defineProperty(hb,"__esModule",{value:!0}),hb.default=void 0;var pb=uv(a("5li5P")).default;hb.default=pb;var mb={};Object.defineProperty(mb,"__esModule",{value:!0}),mb.default=void 0;var gb=uv(a("ch1PX")).default;mb.default=gb;var vb={};Object.defineProperty(vb,"__esModule",{value:!0}),vb.default=void 0;var bb=uv(a("bnDV9")).default;vb.default=bb,lv.registerLanguage("tsx",r(tb)),lv.registerLanguage("json",r(rb)),lv.registerLanguage("scss",r(ib)),lv.registerLanguage("bash",r(sb)),lv.registerLanguage("python",r(cb)),lv.registerLanguage("cpp",r(db)),lv.registerLanguage("php",r(hb)),lv.registerLanguage("ruby",r(mb)),lv.registerLanguage("sql",r(vb));var yb=({medium:e,className:t,preview:n=!1})=>{var o,i,a,s;const{t:l}=ea();return r(u).createElement("div",{className:"memori-snippet"},r(u).createElement("div",{className:"memori-snippet--content"},r(u).createElement(lv,{"aria-labelledby":`#snippet-${e.mediumID}`,className:t,style:cv.atomDark,showLineNumbers:!0,language:null!==(i=null===(o=Zm.find((t=>e.mimeType===t.mimeType)))||void 0===o?void 0:o.lang)&&void 0!==i?i:"text"},(null===(a=e.content)||void 0===a?void 0:a.length)&&e.content.length>200&&n?`${e.content.slice(0,200)}\n...`:`${e.content}`),r(u).createElement(Zd,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:l("copy")||"Copy",icon:r(u).createElement(tg,null),onClick:()=>{var t;return navigator.clipboard.writeText(null!==(t=e.content)&&void 0!==t?t:"")}})),!!(null===(s=e.title)||void 0===s?void 0:s.length)&&r(u).createElement("p",{id:`snippet-${e.mediumID}`,className:"memori-snippet--caption"},e.title))};u=a("85Hg2");var wb=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"}));u=a("85Hg2");var xb=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"}));u=a("85Hg2");var Sb=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"}));u=a("85Hg2");var Mb=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"}));const _b=({item:e,sessionID:t,tenantID:n,preview:o=!1,baseURL:i})=>{switch(e.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:r(u).createElement("picture",{className:"memori-media-item--figure"},!o&&r(u).createElement("source",{srcSet:[Fm({resourceURI:e.url,sessionID:t,tenantID:n,baseURL:i}),Fm({resourceURI:e.content,sessionID:t,tenantID:n,baseURL:i}),e.url,e.content].join(", "),type:e.mimeType}),r(u).createElement("img",{alt:e.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),e.title&&r(u).createElement("figcaption",{className:"memori-media-item--figure-caption"},e.title))}));case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,cover:r(u).createElement(Mb,{className:"memori-media-item--icon"}),title:e.title}));case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,cover:r(u).createElement(Sb,{className:"memori-media-item--icon"}),title:e.title}));case"application/pdf":return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,cover:r(u).createElement(xb,{className:"memori-media-item--icon"}),title:e.title}));case"video/mp4":case"video/avi":case"video/mpeg":return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,cover:r(u).createElement("video",{style:{width:"100%",height:"100%"},controls:!0,src:e.url,title:e.title}),title:e.title}));case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,cover:r(u).createElement("audio",{style:{width:"100%",height:"100%"},controls:!0,src:e.url}),title:e.title}));case"model/gltf-binary":return r(u).createElement(eg,{src:e.url,alt:"",poster:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="});default:return r(u).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},r(u).createElement(Vm,{hoverable:!0,cover:r(u).createElement(wb,{className:"memori-media-item--icon"}),title:e.title}))}};var Eb=({items:e,sessionID:t,tenantID:n,translateTo:o,baseURL:i})=>{const[a,s]=(0,u.useState)(e),l=(0,u.useCallback)((async()=>{if(!o)return;const t=await Promise.all((null!=e?e:[]).map((async e=>{var t;if(!e.title)return e;try{const n=await Jm(e.title,o);return{...e,title:null!==(t=n.text)&&void 0!==t?t:e.title}}catch(t){return console.error(t),e}})));s(t)}),[o,e]);return(0,u.useEffect)((()=>{o&&l()}),[o,l]),(0,u.useEffect)((()=>{e.filter((e=>{var t;return"text/javascript"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).forEach((e=>{var t;try{new Function(null!==(t=e.content)&&void 0!==t?t:"")()}catch(e){console.error(e)}}))}),[]),r(u).createElement(dp,{appear:!0,show:!0,as:"div",className:"memori-media-items"},r(u).createElement("div",{className:"memori-media-items--grid"},a.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&!Zm.map((e=>e.mimeType)).includes(e.mimeType)})).sort(((e,t)=>e.creationTimestamp>t.creationTimestamp?1:e.creationTimestamp<t.creationTimestamp?-1:0)).map(((e,o)=>r(u).createElement(dp.Child,{as:"div",className:"memori-media-item",key:e.url+"&index="+o,enter:"ease-out duration-500 delay-"+100*o,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95"},r(u).createElement(_b,{sessionID:t,tenantID:n,baseURL:i,item:{...e,title:e.title,url:e.url,content:e.content}}))))),a.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&Zm.map((e=>e.mimeType)).includes(e.mimeType)})).map((e=>r(u).createElement(dp.Child,{as:"div",className:"memori-media-item--snippet",key:e.mediumID,enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0"},r(u).createElement(yb,{key:e.mediumID,medium:e})))),a.filter((e=>{var t;return"text/css"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).map((e=>r(u).createElement("style",{key:e.mediumID,dangerouslySetInnerHTML:{__html:e.content||""}}))))};Xd=a("4IUwl");var Ab=({hints:e=[],links:t=[],media:n=[],simulateUserPrompt:o=(()=>{}),sessionID:i,baseUrl:a,translateTo:s})=>{const[l,c]=(0,u.useState)(!0);return(0,u.useEffect)((()=>{c(!0)}),[e]),r(u).createElement("div",{className:"memori-media-widget"},(null==n?void 0:n.length)>0&&r(u).createElement(Eb,{items:n,sessionID:i,translateTo:s,baseURL:a}),(null==t?void 0:t.length)>0&&r(u).createElement(Km,{items:t,baseUrl:a}),(null==e?void 0:e.length)>0&&l&&r(u).createElement(dp,{appear:!0,show:!0,as:"ul",className:"memori-media--hints"},e.map(((e,t)=>r(u).createElement(dp.Child,{as:"li",key:e.text+t,enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0"},r(u).createElement(Zd,{key:e.text+t,className:r(Xd)("memori-media--hint"),primary:!0,onClick:()=>{o(e.originalText,e.text),c(!1)},onTouchEnd:()=>{o(e.originalText,e.text),c(!1)}},e.text))))))};u=a("85Hg2"),u=a("85Hg2"),u=a("85Hg2");var Cb=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Cb||{});function kb(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=null!=r?r:-1,i=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==o&&r.length-n-1>=o)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=o)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===i?r:i}u=a("85Hg2");function Tb({container:e,accept:t,walk:n,enabled:r=!0}){let o=(0,u.useRef)(t),i=(0,u.useRef)(n);(0,u.useEffect)((()=>{o.current=t,i.current=n}),[t,n]),hf((()=>{if(!e||!r)return;let t=Rf(e);if(!t)return;let n=o.current,a=i.current,s=Object.assign((e=>n(e)),{acceptNode:n}),l=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,s,!1);for(;l.nextNode();)a(l.currentNode)}),[e,r,o,i])}u=a("85Hg2");function Ib(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function Ob(e,t){let[n,r]=(0,u.useState)((()=>Ib(e)));return hf((()=>{r(Ib(e))}),[e.type,e.as]),hf((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")}),[n,t]),n}var Rb=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Rb||{}),Pb=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Pb||{}),Nb=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(Nb||{});function Lb(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=Vf(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),o=n?r.indexOf(n):null;return-1===o&&(o=null),{items:r,activeItemIndex:o}}let Bb={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=Lb(e),o=kb(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:o,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),i=o?e.items.indexOf(o):-1;return-1===i||i===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:i,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=Lb(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=Lb(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},Db=(0,u.createContext)(null);function jb(e){let t=(0,u.useContext)(Db);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,jb),t}return t}function Fb(e,t){return ef(t.type,Bb,e,t)}Db.displayName="MenuContext";let zb=u.Fragment,Ub=cf((function(e,t){let n=(0,u.useReducer)(Fb,{menuState:1,buttonRef:(0,u.createRef)(),itemsRef:(0,u.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:o,itemsRef:i,buttonRef:a},s]=n,l=bf(t);Th([a,i],((e,t)=>{var n;s({type:1}),Uf(t,zf.Loose)||(e.preventDefault(),null==(n=a.current)||n.focus())}),0===o);let c=mf((()=>{s({type:1})})),d=(0,u.useMemo)((()=>({open:0===o,close:c})),[o,c]),f=e,h={ref:l};return r(u).createElement(Db.Provider,{value:n},r(u).createElement(_h,{value:ef(o,{0:Sh.Open,1:Sh.Closed})},af({ourProps:h,theirProps:f,slot:d,defaultTag:zb,name:"Menu"})))})),Hb=cf((function(e,t){var n;let[r,o]=jb("Menu.Button"),i=bf(r.buttonRef,t),a=`headlessui-menu-button-${Cf()}`,s=Jh(),l=mf((e=>{switch(e.key){case wf.Space:case wf.Enter:case wf.ArrowDown:e.preventDefault(),e.stopPropagation(),o({type:0}),s.nextFrame((()=>o({type:2,focus:Cb.First})));break;case wf.ArrowUp:e.preventDefault(),e.stopPropagation(),o({type:0}),s.nextFrame((()=>o({type:2,focus:Cb.Last})))}})),c=mf((e=>{if(e.key===wf.Space)e.preventDefault()})),d=mf((t=>{if(xf(t.currentTarget))return t.preventDefault();e.disabled||(0===r.menuState?(o({type:1}),s.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),o({type:0})))})),f=(0,u.useMemo)((()=>({open:0===r.menuState})),[r]),h=e;return af({ourProps:{ref:i,id:a,type:Ob(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===r.menuState,onKeyDown:l,onKeyUp:c,onClick:d},theirProps:h,slot:f,defaultTag:"button",name:"Menu.Button"})})),Gb=rf.RenderStrategy|rf.Static,Wb=cf((function(e,t){var n,r;let[o,i]=jb("Menu.Items"),a=bf(o.itemsRef,t),s=Yf(o.itemsRef),l=`headlessui-menu-items-${Cf()}`,c=Jh(),d=Mh(),f=null!==d?d===Sh.Open:0===o.menuState;(0,u.useEffect)((()=>{let e=o.itemsRef.current;!e||0===o.menuState&&e!==(null==s?void 0:s.activeElement)&&e.focus({preventScroll:!0})}),[o.menuState,o.itemsRef,s]),Tb({container:o.itemsRef.current,enabled:0===o.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let h=mf((e=>{var t,n;switch(c.dispose(),e.key){case wf.Space:if(""!==o.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:3,value:e.key});case wf.Enter:if(e.preventDefault(),e.stopPropagation(),i({type:1}),null!==o.activeItemIndex){let{dataRef:e}=o.items[o.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}Hf(o.buttonRef.current);break;case wf.ArrowDown:return e.preventDefault(),e.stopPropagation(),i({type:2,focus:Cb.Next});case wf.ArrowUp:return e.preventDefault(),e.stopPropagation(),i({type:2,focus:Cb.Previous});case wf.Home:case wf.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:2,focus:Cb.First});case wf.End:case wf.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:2,focus:Cb.Last});case wf.Escape:e.preventDefault(),e.stopPropagation(),i({type:1}),Of().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case wf.Tab:e.preventDefault(),e.stopPropagation(),i({type:1}),Of().nextFrame((()=>{qf(o.buttonRef.current,e.shiftKey?Bf.Previous:Bf.Next)}));break;default:1===e.key.length&&(i({type:3,value:e.key}),c.setTimeout((()=>i({type:4})),350))}})),p=mf((e=>{if(e.key===wf.Space)e.preventDefault()})),m=(0,u.useMemo)((()=>({open:0===o.menuState})),[o]),g=e;return af({ourProps:{"aria-activedescendant":null===o.activeItemIndex||null==(n=o.items[o.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(r=o.buttonRef.current)?void 0:r.id,id:l,onKeyDown:h,onKeyUp:p,role:"menu",tabIndex:0,ref:a},theirProps:g,slot:m,defaultTag:"div",features:Gb,visible:f,name:"Menu.Items"})})),Vb=u.Fragment,qb=cf((function(e,t){let{disabled:n=!1,...r}=e,[o,i]=jb("Menu.Item"),a=`headlessui-menu-item-${Cf()}`,s=null!==o.activeItemIndex&&o.items[o.activeItemIndex].id===a,l=(0,u.useRef)(null),c=bf(t,l);hf((()=>{if(0!==o.menuState||!s||0===o.activationTrigger)return;let e=Of();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=l.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[l,s,o.menuState,o.activationTrigger,o.activeItemIndex]);let d=(0,u.useRef)({disabled:n,domRef:l});hf((()=>{d.current.disabled=n}),[d,n]),hf((()=>{var e,t;d.current.textValue=null==(t=null==(e=l.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,l]),hf((()=>(i({type:5,id:a,dataRef:d}),()=>i({type:6,id:a}))),[d,a]);let f=mf((()=>{i({type:1})})),h=mf((e=>{if(n)return e.preventDefault();i({type:1}),Hf(o.buttonRef.current)})),p=mf((()=>{if(n)return i({type:2,focus:Cb.Nothing});i({type:2,focus:Cb.Specific,id:a})})),m=mf((()=>{n||s||i({type:2,focus:Cb.Specific,id:a,trigger:0})})),g=mf((()=>{n||!s||i({type:2,focus:Cb.Nothing})})),v=(0,u.useMemo)((()=>({active:s,disabled:n,close:f})),[s,n,f]);return af({ourProps:{id:a,ref:c,role:"menuitem",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,disabled:void 0,onClick:h,onFocus:p,onPointerMove:m,onMouseMove:m,onPointerLeave:g,onMouseLeave:g},theirProps:r,slot:v,defaultTag:Vb,name:"Menu.Item"})})),Kb=Object.assign(Ub,{Button:Hb,Items:Wb,Item:qb});Xd=a("4IUwl"),u=a("85Hg2");var $b=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 1 0 0-176 88 88 0 0 0 0 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}));u=a("85Hg2");var Jb=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0 0 12.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0 0 12.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 0 0 174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}));var Xb=({attachmentsMenuOpen:e,setAttachmentsMenuOpen:t,disabled:n=!1,authToken:o})=>r(u).createElement(Kb,{as:"div",className:"memori-upload-menu"},r(u).createElement(Kb.Button,{disabled:n,className:r(Xd)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button")},r(u).createElement("div",{className:"memori-button--icon"},r(u).createElement(Jb,null))),r(u).createElement(Kb.Items,{as:"ul",className:"memori-menu--overlay"},r(u).createElement(Kb.Item,{as:"li",className:"memori-menu--li"},r(u).createElement(Zd,{className:"memori-menu--button",ghost:!0,icon:r(u).createElement(Gm,null),outlined:"link"===e,onClick:()=>t("link")},"Link")),!!(null==o?void 0:o.length)&&r(u).createElement(Kb.Item,null,r(u).createElement(Zd,{className:"memori-menu--button",ghost:!0,icon:r(u).createElement($b,null),outlined:"media"===e,onClick:()=>t("media")},"Media"))));u=a("85Hg2"),u=a("85Hg2"),u=a("85Hg2");function Qb(e=0){let[t,n]=(0,u.useState)(e),r=(0,u.useCallback)((e=>n((t=>t|e))),[t]),o=(0,u.useCallback)((e=>Boolean(t&e)),[t]),i=(0,u.useCallback)((e=>n((t=>t&~e))),[n]),a=(0,u.useCallback)((e=>n((t=>t^e))),[n]);return{addFlag:r,hasFlag:o,removeFlag:i,toggleFlag:a}}let Yb=(0,(u=a("85Hg2")).createContext)(null);function Zb(){let e=(0,u.useContext)(Yb);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Zb),e}return e}function ey(){let[e,t]=(0,u.useState)([]);return[e.length>0?e.join(" "):void 0,(0,u.useMemo)((()=>function(e){let n=mf((e=>(t((t=>[...t,e])),()=>t((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),o=(0,u.useMemo)((()=>({register:n,slot:e.slot,name:e.name,props:e.props})),[n,e.slot,e.name,e.props]);return r(u).createElement(Yb.Provider,{value:o},e.children)}),[t])]}let ty=cf((function(e,t){let{passive:n=!1,...r}=e,o=Zb(),i=`headlessui-label-${Cf()}`,a=bf(t);hf((()=>o.register(i)),[i,o.register]);let s={ref:a,...o.props,id:i};return n&&("onClick"in s&&delete s.onClick,"onClick"in r&&delete r.onClick),af({ourProps:s,theirProps:r,slot:o.slot||{},defaultTag:"label",name:o.name||"Label"})}));function ny(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))oy(n,ry(t,r),o);return n}function ry(e,t){return e?e+"["+t+"]":t}function oy(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())oy(e,ry(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):ny(n,t,e)}function iy(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n)for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type)return void e.click()}u=a("85Hg2");function ay(e,t,n){let[r,o]=(0,u.useState)(n),i=void 0!==e,a=(0,u.useRef)(i),s=(0,u.useRef)(!1),l=(0,u.useRef)(!1);return!i||a.current||s.current?!i&&a.current&&!l.current&&(l.current=!0,a.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(s.current=!0,a.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[i?e:r,mf((e=>(i||o(e),null==t?void 0:t(e))))]}var sy,ly=((sy=ly||{})[sy.RegisterOption=0]="RegisterOption",sy[sy.UnregisterOption=1]="UnregisterOption",sy);let cy={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Vf(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},uy=(0,u.createContext)(null);function dy(e){let t=(0,u.useContext)(uy);if(null===t){let t=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,dy),t}return t}function fy(e,t){return ef(t.type,cy,e,t)}uy.displayName="RadioGroupContext";let hy=cf((function(e,t){let{value:n,defaultValue:o,name:i,onChange:a,by:s=((e,t)=>e===t),disabled:l=!1,...c}=e,d=mf("string"==typeof s?(e,t)=>{let n=s;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:s),[f,h]=(0,u.useReducer)(fy,{options:[]}),p=f.options,[m,g]=ey(),[v,b]=yh(),y=`headlessui-radiogroup-${Cf()}`,w=(0,u.useRef)(null),x=bf(w,t),[S,M]=ay(n,a,o),_=(0,u.useMemo)((()=>p.find((e=>!e.propsRef.current.disabled))),[p]),E=(0,u.useMemo)((()=>p.some((e=>d(e.propsRef.current.value,S)))),[p,S]),A=mf((e=>{var t;if(l||d(e,S))return!1;let n=null==(t=p.find((t=>d(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==M||M(e),!0)}));Tb({container:w.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let C=mf((e=>{let t=w.current;if(!t)return;let n=Rf(t),r=p.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case wf.Enter:iy(e.currentTarget);break;case wf.ArrowLeft:case wf.ArrowUp:if(e.preventDefault(),e.stopPropagation(),Kf(r,Bf.Previous|Bf.WrapAround)===Df.Success){let e=p.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&A(e.propsRef.current.value)}break;case wf.ArrowRight:case wf.ArrowDown:if(e.preventDefault(),e.stopPropagation(),Kf(r,Bf.Next|Bf.WrapAround)===Df.Success){let e=p.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&A(e.propsRef.current.value)}break;case wf.Space:{e.preventDefault(),e.stopPropagation();let t=p.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&A(t.propsRef.current.value)}}})),k=mf((e=>(h({type:0,...e}),()=>h({type:1,id:e.id})))),T=(0,u.useMemo)((()=>({registerOption:k,firstOption:_,containsCheckedOption:E,change:A,disabled:l,value:S,compare:d})),[k,_,E,A,l,S,d]),I={ref:x,id:y,role:"radiogroup","aria-labelledby":m,"aria-describedby":v,onKeyDown:C},O=(0,u.useMemo)((()=>({value:S})),[S]);return r(u).createElement(b,{name:"RadioGroup.Description"},r(u).createElement(g,{name:"RadioGroup.Label"},r(u).createElement(uy.Provider,{value:T},null!=i&&null!=S&&ny({[i]:S}).map((([e,t])=>r(u).createElement(Tf,{features:kf.Hidden,...uf({key:e,as:"input",type:"radio",checked:null!=t,hidden:!0,readOnly:!0,name:e,value:t})}))),af({ourProps:I,theirProps:c,slot:O,defaultTag:"div",name:"RadioGroup"}))))}));var py=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(py||{});let my=cf((function(e,t){let n=(0,u.useRef)(null),o=bf(n,t),i=`headlessui-radiogroup-option-${Cf()}`,[a,s]=ey(),[l,c]=yh(),{addFlag:d,removeFlag:f,hasFlag:h}=Qb(1),{value:p,disabled:m=!1,...g}=e,v=(0,u.useRef)({value:p,disabled:m});hf((()=>{v.current.value=p}),[p,v]),hf((()=>{v.current.disabled=m}),[m,v]);let{registerOption:b,disabled:y,change:w,firstOption:x,containsCheckedOption:S,value:M,compare:_}=dy("RadioGroup.Option");hf((()=>b({id:i,element:n,propsRef:v})),[i,b,n,e]);let E=mf((e=>{var t;if(xf(e.currentTarget))return e.preventDefault();!w(p)||(d(2),null==(t=n.current)||t.focus())})),A=mf((e=>{if(xf(e.currentTarget))return e.preventDefault();d(2)})),C=mf((()=>f(2))),k=(null==x?void 0:x.id)===i,T=y||m,I=_(M,p),O={ref:o,id:i,role:"radio","aria-checked":I?"true":"false","aria-labelledby":a,"aria-describedby":l,"aria-disabled":!!T||void 0,tabIndex:T?-1:I||!S&&k?0:-1,onClick:T?void 0:E,onFocus:T?void 0:A,onBlur:T?void 0:C},R=(0,u.useMemo)((()=>({checked:I,disabled:T,active:h(2)})),[I,T,h]);return r(u).createElement(c,{name:"RadioGroup.Description"},r(u).createElement(s,{name:"RadioGroup.Label"},af({ourProps:O,theirProps:g,slot:R,defaultTag:"div",name:"RadioGroup.Option"})))})),gy=Object.assign(hy,{Option:my,Label:ty,Description:wh});Xd=a("4IUwl");var vy=({sendOnEnter:e,setSendOnEnter:t})=>{const{t:n}=ea();return r(u).createElement(Kb,{as:"div",className:"memori-send-on-enter-menu"},r(u).createElement(Kb.Button,{className:r(Xd)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button")},r(u).createElement("div",{className:"memori-button--icon"},r(u).createElement("span",{style:{display:"block",width:"1rem",height:"1rem"}},"…"))),r(u).createElement(Kb.Items,{className:"memori-menu--overlay"},r(u).createElement(gy,{value:e,onChange:t},r(u).createElement(gy.Option,{value:"keypress",className:"memori-menu--option"},(({checked:e})=>r(u).createElement(Kb.Item,null,r(u).createElement(Zd,{className:"memori-menu--button",ghost:!0,outlined:e,icon:r(u).createElement("span",{className:"memori-menu--icon"},e?"✓":"")},n("widget.sendOnKeypress"))))),r(u).createElement(gy.Option,{value:"click",className:"memori-menu--option"},(({checked:e})=>r(u).createElement(Kb.Item,null,r(u).createElement(Zd,{className:"memori-menu--button",ghost:!0,outlined:e,icon:r(u).createElement("span",{className:"memori-menu--icon"},e?"✓":"")},n("widget.sendOnClick"))))))))};u=a("85Hg2"),Xd=a("4IUwl"),u=a("85Hg2");var by=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"}));u=a("85Hg2");var yy=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}));var wy=({disabled:e=!1,value:t,onChange:n,onPressEnter:o,onFocus:i,onBlur:a})=>{const[s,l]=(0,u.useState)(!1);return r(u).createElement("div",{"data-testid":"chat-textarea",className:r(Xd)("memori-chat-textarea",{"memori-chat-textarea--expanded":s,"memori-chat-textarea--disabled":e})},r(u).createElement("div",{className:"memori-chat-textarea--inner"},r(u).createElement("textarea",{className:"memori-chat-textarea--input",disabled:e,value:t,onChange:e=>{n(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&o&&o(e)},onFocus:i,onBlur:a}),r(u).createElement("div",{className:"memori-chat-textarea--expand"},r(u).createElement(Zd,{className:r(Xd)("memori-chat-textarea--expand-button"),onClick:()=>l(!s),padded:!1,ghost:!0,icon:s?r(u).createElement(yy,null):r(u).createElement(by,null)}))))};Xd=a("4IUwl"),u=a("85Hg2");var xy=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}));u=a("85Hg2");var Sy=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"}));var My=({dialogState:e,instruct:t=!1,sendOnEnter:n="click",setSendOnEnter:o,attachmentsMenuOpen:i,setAttachmentsMenuOpen:a,userMessage:s="",onChangeUserMessage:l,sendMessage:c,onTextareaFocus:d,onTextareaBlur:f,onTextareaPressEnter:h,showMicrophone:p=!1,listening:m=!1,isPlayingAudio:g=!1,stopAudio:v,startListening:b,stopListening:y,authToken:w})=>{const{t:x}=ea();return r(u).createElement("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===(null==e?void 0:e.state)||"X3"===(null==e?void 0:e.state)},(t||(null==e?void 0:e.acceptsMedia))&&r(u).createElement(Xb,{attachmentsMenuOpen:i,setAttachmentsMenuOpen:a,authToken:w,disabled:!(null==e?void 0:e.acceptsMedia)}),r(u).createElement(vy,{sendOnEnter:n,setSendOnEnter:o}),r(u).createElement(wy,{value:s,onChange:l,onPressEnter:h,onFocus:d,onBlur:f,disabled:["R2","R3","R4","G3","X3"].includes((null==e?void 0:e.state)||"")}),r(u).createElement(Zd,{shape:"circle",primary:!!(null==s?void 0:s.length),disabled:!s||0===s.length,className:"memori-chat-inputs--send",onClick:()=>{c(s),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:x("send")||"Send",icon:r(u).createElement(xy,null)}),p&&r(u).createElement(Zd,{className:r(Xd)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":m}),title:m?x("write_and_speak.micButtonPopoverListening")||"Listening":x("write_and_speak.micButtonPopover")||"Start listening",disabled:g,onClick:e=>{console.log("mic button",m,e),m?y():(v(),b())},shape:"circle",icon:r(u).createElement(Sy,null)}))};var _y=({memori:e,tenant:t,sessionID:n,baseUrl:o,translateTo:i,memoriTyping:a,history:s=[],authToken:l,dialogState:c,simulateUserPrompt:d,showDates:f=!1,showContextPerLine:h=!1,selectReceiverTag:p,preview:m=!1,instruct:g=!1,showInputs:v=!0,showMicrophone:b=!1,sendOnEnter:y,setSendOnEnter:w,attachmentsMenuOpen:x,setAttachmentsMenuOpen:S,userMessage:M="",onChangeUserMessage:_,sendMessage:E,listening:A,isPlayingAudio:C,stopAudio:k,startListening:T,stopListening:I,resetTranscript:O})=>{var R,P,N,L,B;const D=()=>{setTimeout((()=>{var e,t,n,r,o;document.body.classList.contains("chat-focused")?(null===(e=document.querySelector(".ant-tabs-nav"))||void 0===e||e.scrollIntoView(),null===(t=document.querySelector(".memori-chat--content"))||void 0===t||t.scrollTo(0,null!==(r=null===(n=document.querySelector(".memori-chat--content"))||void 0===n?void 0:n.scrollHeight)&&void 0!==r?r:0)):null===(o=document.querySelector("#end-messages-ref"))||void 0===o||o.scrollIntoView({behavior:"smooth"})}),200)};(0,u.useEffect)((()=>{!m&&D()}),[s,m]);return r(u).createElement("div",{className:r(Xd)("memori-chat--wrapper",{"memori-chat-wrapper--translate":i}),id:"chat-wrapper",lang:null==i?void 0:i.toUpperCase(),"data-memori-lang":null!==(L=null===(N=null===(P=null===(R=e.culture)||void 0===R?void 0:R.split("-"))||void 0===P?void 0:P[0])||void 0===N?void 0:N.toUpperCase())&&void 0!==L?L:"EN"},r(u).createElement("div",{className:r(Xd)("memori-chat--history",{"memori-chat--history-touch":Dm()})},r(u).createElement("div",{className:r(Xd)("memori-chat--content",{"memori-chat--content-touch":Dm()})},r(u).createElement("div",{className:r(Xd)("memori-chat--cover"),style:{backgroundImage:`url("${Fm({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:o})}"), url("${Fm({type:"cover",tenantID:null==t?void 0:t.id,baseURL:o||"https://app.twincreator.com"})}")`}}),s.map(((a,s)=>{var l,c,p,m;return r(u).createElement(r(u).Fragment,{key:s},r(u).createElement(Um,{message:a,memori:e,tenant:t,baseUrl:o}),f&&!!a.timestamp&&r(u).createElement("small",{className:"memori-chat--timestamp "+(a.fromUser?"text-right":"text-left")},new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(a.timestamp.endsWith("Z")?a.timestamp:`${a.timestamp}Z`))),h&&!!Object.keys(null!==(l=a.contextVars)&&void 0!==l?l:{}).length&&r(u).createElement("div",{className:"memori-chat--context-vars"},Object.keys(null!==(c=a.contextVars)&&void 0!==c?c:{}).map((e=>{var t,n,o;return"-"===(null===(t=a.contextVars)||void 0===t?void 0:t[e])?r(u).createElement("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",key:e},r(u).createElement("span",{className:"memori-chat--context-tag-text"},e)):"✔️"===(null===(n=a.contextVars)||void 0===n?void 0:n[e])?r(u).createElement("div",{className:"memori-chat--context-tag",key:e},r(u).createElement("span",{className:"memori-chat--context-tag-text"},e)):r(u).createElement("div",{className:"memori-chat--context-tag",key:e},r(u).createElement("span",{className:"memori-chat--context-tag-text"},e,": ",null===(o=a.contextVars)||void 0===o?void 0:o[e]))}))),r(u).createElement(Ab,{simulateUserPrompt:d,media:null===(p=null==a?void 0:a.media)||void 0===p?void 0:p.filter((e=>"text/html"!==e.mimeType&&"text/plain"!==e.mimeType)),links:null===(m=null==a?void 0:a.media)||void 0===m?void 0:m.filter((e=>"text/html"===e.mimeType)),sessionID:n,baseUrl:o,translateTo:i}))})),a&&r(u).createElement("div",{className:"memori-chat--bubble"},r(u).createElement("div",{id:"wave"},r(u).createElement("span",{className:"dot"}),r(u).createElement("span",{className:"dot"}),r(u).createElement("span",{className:"dot"}))),(null==c?void 0:c.hints)&&c.hints.length>0&&r(u).createElement(Ab,{simulateUserPrompt:d,hints:c.translatedHints?c.translatedHints:c.hints.map((e=>({text:e,originalText:e})))}),r(u).createElement("div",{id:"end-messages-ref"}))),"X3"===(null==c?void 0:c.state)&&n&&r(u).createElement("div",{className:"memori-chat--known-tags"},Object.keys(null!==(B=c.knownTags)&&void 0!==B?B:{}).filter((t=>t!==e.giverTag)).map((e=>{var t;return r(u).createElement(Zd,{key:e,icon:r(u).createElement("span",{className:"memori-chat--known-tag-icon"},e),className:"memori-chat--known-tag",onClick:()=>p(e)},null===(t=c.knownTags)||void 0===t?void 0:t[e])}))),v&&r(u).createElement(My,{userMessage:M,onChangeUserMessage:_,dialogState:c,instruct:g,authToken:l,sendMessage:E,sendOnEnter:y,setSendOnEnter:w,attachmentsMenuOpen:x,setAttachmentsMenuOpen:S,onTextareaPressEnter:()=>{"keypress"===y&&(null==M?void 0:M.length)>0&&(I(),E(M),_(""),O())},onTextareaFocus:()=>{var e,t;I(),Dm()&&window.innerWidth<=768&&(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t||t.add("chat-focused"),setTimeout((()=>{D()}),300))},onTextareaBlur:()=>{var e,t,n;(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("chat-focused"))&&(null===(n=document.getElementById("chat-wrapper"))||void 0===n||n.classList.remove("chat-focused"),D())},startListening:T,stopListening:I,stopAudio:k,listening:A,isPlayingAudio:C,showMicrophone:b}))};u=a("85Hg2"),u=a("85Hg2"),Xd=a("4IUwl");var Ey=({content:e,className:t,alignLeft:n=!1,disabled:o=!1,visible:i=!1,children:a})=>r(u).createElement("div",{className:r(Xd)("memori-tooltip",t,{"memori-tooltip--align-left":n,"memori-tooltip--disabled":o,"memori-tooltip--visible":i})},r(u).createElement("div",{className:"memori-tooltip--content"},e),r(u).createElement("div",{className:"memori-tooltip--trigger"},a));u=a("85Hg2");var Ay=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),r(u).createElement("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"}));u=a("85Hg2"),u=a("85Hg2");var Cy=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},r(u).createElement("path",{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}));var ky=({memoriName:e,blockedUntil:t,showGiverInfo:n=!1,showTitle:o=!1,marginLeft:i=!1})=>{const{t:a}=ea(),s=new Date(t);return s>new Date?r(u).createElement(Ey,{className:"blocked-memori-badge--tooltip",content:r(u).createElement(r(u).Fragment,null,!n&&a("memoriBlockedAnon",{name:e,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(s)}),n&&a("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(s)}),n&&` ${a("memoriBlockedReasonExceedChats")}`,n&&r(u).createElement("br",null),n&&`\n${a("memoriBlockedGiverHelper")}`)},r(u).createElement("div",{className:"blocked-memori-badge--wrapper"},r(u).createElement("div",{className:"blocked-memori-badge "+(i?" margin-left":"")},r(u).createElement(Cy,{className:"blocked-memori-badge--icon"})),o&&r(u).createElement("span",{className:"blocked-memori-badge--title"},a("memoriBlockedTitle")))):null};var Ty=({memori:e,tenant:t,gamificationLevel:n,language:o,userLang:i,setUserLang:a,baseUrl:s,position:l,openPositionDrawer:c,integrationConfig:d,instruct:f=!1,clickedStart:h,onClickStart:p,initializeTTS:m})=>{var g,v;const{t:b,i18n:y}=ea(),[w,x]=(0,u.useState)(e.description),[S,M]=(0,u.useState)(!0);return(0,u.useEffect)((()=>{var t,n,r,i,a,l;(null!==(n=null===(t=y.language)||void 0===t?void 0:t.toUpperCase())&&void 0!==n?n:"IT")!==(null!==(r=null==o?void 0:o.toUpperCase())&&void 0!==r?r:"IT")&&(null===(i=e.description)||void 0===i?void 0:i.length)&&Jm(e.description,null!==(l=null===(a=y.language)||void 0===a?void 0:a.toUpperCase())&&void 0!==l?l:"IT",o,s).then((e=>{x(e.text)})).catch(console.error)}),[y.language,o,e.description,s]),r(u).createElement("div",{className:"memori--start-panel"},r(u).createElement("div",{className:"memori--cover",style:{backgroundImage:`url("${Fm({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:s})}"), url("${Fm({type:"cover",tenantID:null==t?void 0:t.id,baseURL:s})}")`}},!!(null===(g=null==n?void 0:n.badge)||void 0===g?void 0:g.length)&&r(u).createElement("div",{className:"memori--gamification-badge"},r(u).createElement(Ey,{alignLeft:!0,content:`${b("gamification.level")} ${n.badge}, ${n.points} ${b("gamification.points")}`},r(u).createElement("span",{"aria-label":`${b("gamification.level")} ${n.badge}, ${n.points} ${b("gamification.points")}`},n.badge)))),r(u).createElement("picture",{className:"memori--avatar"},r(u).createElement("source",{src:null!==(v=e.avatarURL)&&void 0!==v?v:Fm({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:s})}),r(u).createElement("img",{alt:e.name,src:e.avatarURL&&e.avatarURL.length>0?Fm({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:s}):Fm({type:"avatar",tenantID:null==t?void 0:t.id,baseURL:s})})),r(u).createElement("h2",{className:"memori--title"},e.name),e.needsPosition&&!l&&r(u).createElement("div",{className:"memori--needsPosition"},r(u).createElement("p",null,b("write_and_speak.requirePosition")),r(u).createElement(Zd,{primary:!0,onClick:()=>c(),className:"memori--start-button"},b("widget.position"))),(e.needsPosition&&l||!e.needsPosition)&&r(u).createElement("div",{className:"memori--description"},r(u).createElement("p",null,r(u).createElement("span",{className:"memori--description-text"},w&&S?w:e.description),w!==e.description&&r(u).createElement(Zd,{ghost:!0,className:"memori--translation-toggle",icon:r(u).createElement(Ay,null),onClick:()=>{M((e=>!e))}},b(S?"showOriginalText":"showTranslatedText"))),(null==d?void 0:d.multilanguage)&&!f&&r(u).createElement("div",{className:"memori--language-chooser"},r(u).createElement("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref"},b("write_and_speak.iWantToTalkToIn",{name:e.name})),r(u).createElement("select",{id:"user-lang-pref",value:(null!=i?i:y.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{a(e.target.value)}},Xm.map((e=>r(u).createElement("option",{key:e.value,value:e.value,"aria-label":e.label},e.label))))),r(u).createElement(Zd,{primary:!0,disabled:!!e.blockedUntil&&!e.isGiver,loading:h,onClick:e=>{speechSynthesis.speak(new SpeechSynthesisUtterance("")),m&&m(),p&&p()},className:"memori--start-button"},b("write_and_speak."+(f?"instructButton":"tryMeButton"))),r(u).createElement("p",{className:"memori--start-description"},b(f?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")),!!e.blockedUntil&&r(u).createElement(ky,{memoriName:e.name,blockedUntil:e.blockedUntil,showGiverInfo:e.isGiver,showTitle:!0,marginLeft:!0})))},Iy=(u=a("85Hg2"),u=a("85Hg2"),u=a("85Hg2"),{}),Oy={};(Oy=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}).__esModule=!0,Oy.default=Oy,(Iy=function(e,t){if(null==e)return{};var n,r,o=Oy(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}).__esModule=!0,Iy.default=Iy;u=a("85Hg2");var Ry=["forwardedRef"];function Py(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ny(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Py(Object(n),!0).forEach((function(t){r(Si)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Py(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}class Ly extends u.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:r(u).createElement("div",{style:{background:"rgba(255, 255, 255, 0.4)",color:"#000",padding:"2rem",borderRadius:"10px"}},r(u).createElement("h2",null,this.props.t("error.generic")),r(u).createElement(Zd,{primary:!0,onClick:()=>this.setState({hasError:!1})},this.props.t("error.tryAgain")||"Try again")):this.props.children}}var By=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){function o(o){var i=o.forwardedRef,a=r(Iy)(o,Ry),s=ea(e,Ny(Ny({},a),{},{keyPrefix:t.keyPrefix})),l=r(gi)(s,3),c=l[0],d=l[1],f=l[2],h=Ny(Ny({},a),{},{t:c,i18n:d,tReady:f});return t.withRef&&i?h.ref=i:!t.withRef&&i&&(h.forwardedRef=i),(0,u.createElement)(n,h)}o.displayName="withI18nextTranslation(".concat(Xi(n),")"),o.WrappedComponent=n;return t.withRef?(0,u.forwardRef)((function(e,t){return(0,u.createElement)(o,Object.assign({},e,{forwardedRef:t}))})):o}}(["common"])(Ly),Dy=(u=a("85Hg2"),u=a("85Hg2"),{});e(Dy,"REVISION",(()=>jy)),e(Dy,"MOUSE",(()=>Fy)),e(Dy,"TOUCH",(()=>zy)),e(Dy,"CullFaceNone",(()=>Uy)),e(Dy,"CullFaceBack",(()=>Hy)),e(Dy,"CullFaceFront",(()=>Gy)),e(Dy,"CullFaceFrontBack",(()=>Wy)),e(Dy,"BasicShadowMap",(()=>Vy)),e(Dy,"PCFShadowMap",(()=>qy)),e(Dy,"PCFSoftShadowMap",(()=>Ky)),e(Dy,"VSMShadowMap",(()=>$y)),e(Dy,"FrontSide",(()=>Jy)),e(Dy,"BackSide",(()=>Xy)),e(Dy,"DoubleSide",(()=>Qy)),e(Dy,"NoBlending",(()=>Yy)),e(Dy,"NormalBlending",(()=>Zy)),e(Dy,"AdditiveBlending",(()=>ew)),e(Dy,"SubtractiveBlending",(()=>tw)),e(Dy,"MultiplyBlending",(()=>nw)),e(Dy,"CustomBlending",(()=>rw)),e(Dy,"AddEquation",(()=>ow)),e(Dy,"SubtractEquation",(()=>iw)),e(Dy,"ReverseSubtractEquation",(()=>aw)),e(Dy,"MinEquation",(()=>sw)),e(Dy,"MaxEquation",(()=>lw)),e(Dy,"ZeroFactor",(()=>cw)),e(Dy,"OneFactor",(()=>uw)),e(Dy,"SrcColorFactor",(()=>dw)),e(Dy,"OneMinusSrcColorFactor",(()=>fw)),e(Dy,"SrcAlphaFactor",(()=>hw)),e(Dy,"OneMinusSrcAlphaFactor",(()=>pw)),e(Dy,"DstAlphaFactor",(()=>mw)),e(Dy,"OneMinusDstAlphaFactor",(()=>gw)),e(Dy,"DstColorFactor",(()=>vw)),e(Dy,"OneMinusDstColorFactor",(()=>bw)),e(Dy,"SrcAlphaSaturateFactor",(()=>yw)),e(Dy,"NeverDepth",(()=>ww)),e(Dy,"AlwaysDepth",(()=>xw)),e(Dy,"LessDepth",(()=>Sw)),e(Dy,"LessEqualDepth",(()=>Mw)),e(Dy,"EqualDepth",(()=>_w)),e(Dy,"GreaterEqualDepth",(()=>Ew)),e(Dy,"GreaterDepth",(()=>Aw)),e(Dy,"NotEqualDepth",(()=>Cw)),e(Dy,"MultiplyOperation",(()=>kw)),e(Dy,"MixOperation",(()=>Tw)),e(Dy,"AddOperation",(()=>Iw)),e(Dy,"NoToneMapping",(()=>Ow)),e(Dy,"LinearToneMapping",(()=>Rw)),e(Dy,"ReinhardToneMapping",(()=>Pw)),e(Dy,"CineonToneMapping",(()=>Nw)),e(Dy,"ACESFilmicToneMapping",(()=>Lw)),e(Dy,"CustomToneMapping",(()=>Bw)),e(Dy,"UVMapping",(()=>Dw)),e(Dy,"CubeReflectionMapping",(()=>jw)),e(Dy,"CubeRefractionMapping",(()=>Fw)),e(Dy,"EquirectangularReflectionMapping",(()=>zw)),e(Dy,"EquirectangularRefractionMapping",(()=>Uw)),e(Dy,"CubeUVReflectionMapping",(()=>Hw)),e(Dy,"RepeatWrapping",(()=>Gw)),e(Dy,"ClampToEdgeWrapping",(()=>Ww)),e(Dy,"MirroredRepeatWrapping",(()=>Vw)),e(Dy,"NearestFilter",(()=>qw)),e(Dy,"NearestMipmapNearestFilter",(()=>Kw)),e(Dy,"NearestMipMapNearestFilter",(()=>$w)),e(Dy,"NearestMipmapLinearFilter",(()=>Jw)),e(Dy,"NearestMipMapLinearFilter",(()=>Xw)),e(Dy,"LinearFilter",(()=>Qw)),e(Dy,"LinearMipmapNearestFilter",(()=>Yw)),e(Dy,"LinearMipMapNearestFilter",(()=>Zw)),e(Dy,"LinearMipmapLinearFilter",(()=>ex)),e(Dy,"LinearMipMapLinearFilter",(()=>tx)),e(Dy,"UnsignedByteType",(()=>nx)),e(Dy,"ByteType",(()=>rx)),e(Dy,"ShortType",(()=>ox)),e(Dy,"UnsignedShortType",(()=>ix)),e(Dy,"IntType",(()=>ax)),e(Dy,"UnsignedIntType",(()=>sx)),e(Dy,"FloatType",(()=>lx)),e(Dy,"HalfFloatType",(()=>cx)),e(Dy,"UnsignedShort4444Type",(()=>ux)),e(Dy,"UnsignedShort5551Type",(()=>dx)),e(Dy,"UnsignedInt248Type",(()=>fx)),e(Dy,"AlphaFormat",(()=>hx)),e(Dy,"RGBFormat",(()=>px)),e(Dy,"RGBAFormat",(()=>mx)),e(Dy,"LuminanceFormat",(()=>gx)),e(Dy,"LuminanceAlphaFormat",(()=>vx)),e(Dy,"DepthFormat",(()=>bx)),e(Dy,"DepthStencilFormat",(()=>yx)),e(Dy,"RedFormat",(()=>wx)),e(Dy,"RedIntegerFormat",(()=>xx)),e(Dy,"RGFormat",(()=>Sx)),e(Dy,"RGIntegerFormat",(()=>Mx)),e(Dy,"RGBAIntegerFormat",(()=>_x)),e(Dy,"RGB_S3TC_DXT1_Format",(()=>Ex)),e(Dy,"RGBA_S3TC_DXT1_Format",(()=>Ax)),e(Dy,"RGBA_S3TC_DXT3_Format",(()=>Cx)),e(Dy,"RGBA_S3TC_DXT5_Format",(()=>kx)),e(Dy,"RGB_PVRTC_4BPPV1_Format",(()=>Tx)),e(Dy,"RGB_PVRTC_2BPPV1_Format",(()=>Ix)),e(Dy,"RGBA_PVRTC_4BPPV1_Format",(()=>Ox)),e(Dy,"RGBA_PVRTC_2BPPV1_Format",(()=>Rx)),e(Dy,"RGB_ETC1_Format",(()=>Px)),e(Dy,"RGB_ETC2_Format",(()=>Nx)),e(Dy,"RGBA_ETC2_EAC_Format",(()=>Lx)),e(Dy,"RGBA_ASTC_4x4_Format",(()=>Bx)),e(Dy,"RGBA_ASTC_5x4_Format",(()=>Dx)),e(Dy,"RGBA_ASTC_5x5_Format",(()=>jx)),e(Dy,"RGBA_ASTC_6x5_Format",(()=>Fx)),e(Dy,"RGBA_ASTC_6x6_Format",(()=>zx)),e(Dy,"RGBA_ASTC_8x5_Format",(()=>Ux)),e(Dy,"RGBA_ASTC_8x6_Format",(()=>Hx)),e(Dy,"RGBA_ASTC_8x8_Format",(()=>Gx)),e(Dy,"RGBA_ASTC_10x5_Format",(()=>Wx)),e(Dy,"RGBA_ASTC_10x6_Format",(()=>Vx)),e(Dy,"RGBA_ASTC_10x8_Format",(()=>qx)),e(Dy,"RGBA_ASTC_10x10_Format",(()=>Kx)),e(Dy,"RGBA_ASTC_12x10_Format",(()=>$x)),e(Dy,"RGBA_ASTC_12x12_Format",(()=>Jx)),e(Dy,"RGBA_BPTC_Format",(()=>Xx)),e(Dy,"LoopOnce",(()=>Qx)),e(Dy,"LoopRepeat",(()=>Yx)),e(Dy,"LoopPingPong",(()=>Zx)),e(Dy,"InterpolateDiscrete",(()=>eS)),e(Dy,"InterpolateLinear",(()=>tS)),e(Dy,"InterpolateSmooth",(()=>nS)),e(Dy,"ZeroCurvatureEnding",(()=>rS)),e(Dy,"ZeroSlopeEnding",(()=>oS)),e(Dy,"WrapAroundEnding",(()=>iS)),e(Dy,"NormalAnimationBlendMode",(()=>aS)),e(Dy,"AdditiveAnimationBlendMode",(()=>sS)),e(Dy,"TrianglesDrawMode",(()=>lS)),e(Dy,"TriangleStripDrawMode",(()=>cS)),e(Dy,"TriangleFanDrawMode",(()=>uS)),e(Dy,"LinearEncoding",(()=>dS)),e(Dy,"sRGBEncoding",(()=>fS)),e(Dy,"BasicDepthPacking",(()=>hS)),e(Dy,"RGBADepthPacking",(()=>pS)),e(Dy,"TangentSpaceNormalMap",(()=>mS)),e(Dy,"ObjectSpaceNormalMap",(()=>gS)),e(Dy,"NoColorSpace",(()=>vS)),e(Dy,"SRGBColorSpace",(()=>bS)),e(Dy,"LinearSRGBColorSpace",(()=>yS)),e(Dy,"ZeroStencilOp",(()=>wS)),e(Dy,"KeepStencilOp",(()=>xS)),e(Dy,"ReplaceStencilOp",(()=>SS)),e(Dy,"IncrementStencilOp",(()=>MS)),e(Dy,"DecrementStencilOp",(()=>_S)),e(Dy,"IncrementWrapStencilOp",(()=>ES)),e(Dy,"DecrementWrapStencilOp",(()=>AS)),e(Dy,"InvertStencilOp",(()=>CS)),e(Dy,"NeverStencilFunc",(()=>kS)),e(Dy,"LessStencilFunc",(()=>TS)),e(Dy,"EqualStencilFunc",(()=>IS)),e(Dy,"LessEqualStencilFunc",(()=>OS)),e(Dy,"GreaterStencilFunc",(()=>RS)),e(Dy,"NotEqualStencilFunc",(()=>PS)),e(Dy,"GreaterEqualStencilFunc",(()=>NS)),e(Dy,"AlwaysStencilFunc",(()=>LS)),e(Dy,"StaticDrawUsage",(()=>BS)),e(Dy,"DynamicDrawUsage",(()=>DS)),e(Dy,"StreamDrawUsage",(()=>jS)),e(Dy,"StaticReadUsage",(()=>FS)),e(Dy,"DynamicReadUsage",(()=>zS)),e(Dy,"StreamReadUsage",(()=>US)),e(Dy,"StaticCopyUsage",(()=>HS)),e(Dy,"DynamicCopyUsage",(()=>GS)),e(Dy,"StreamCopyUsage",(()=>WS)),e(Dy,"GLSL1",(()=>VS)),e(Dy,"GLSL3",(()=>qS)),e(Dy,"_SRGBAFormat",(()=>KS)),e(Dy,"EventDispatcher",(()=>$S)),e(Dy,"MathUtils",(()=>lM)),e(Dy,"Vector2",(()=>cM)),e(Dy,"Matrix3",(()=>uM)),e(Dy,"ColorManagement",(()=>bM)),e(Dy,"Color",(()=>EM)),e(Dy,"ImageUtils",(()=>CM)),e(Dy,"Source",(()=>kM)),e(Dy,"Texture",(()=>OM)),e(Dy,"Vector4",(()=>RM)),e(Dy,"WebGLRenderTarget",(()=>PM)),e(Dy,"DataArrayTexture",(()=>NM)),e(Dy,"WebGLArrayRenderTarget",(()=>LM)),e(Dy,"Data3DTexture",(()=>BM)),e(Dy,"WebGL3DRenderTarget",(()=>DM)),e(Dy,"WebGLMultipleRenderTargets",(()=>jM)),e(Dy,"Quaternion",(()=>FM)),e(Dy,"Vector3",(()=>zM)),e(Dy,"Box3",(()=>GM)),e(Dy,"Sphere",(()=>l_)),e(Dy,"Ray",(()=>g_)),e(Dy,"Matrix4",(()=>v_)),e(Dy,"Euler",(()=>C_)),e(Dy,"Layers",(()=>k_)),e(Dy,"Object3D",(()=>H_)),e(Dy,"Triangle",(()=>Z_)),e(Dy,"Material",(()=>tE)),e(Dy,"MeshBasicMaterial",(()=>nE)),e(Dy,"BufferAttribute",(()=>iE)),e(Dy,"Int8BufferAttribute",(()=>aE)),e(Dy,"Uint8BufferAttribute",(()=>sE)),e(Dy,"Uint8ClampedBufferAttribute",(()=>lE)),e(Dy,"Int16BufferAttribute",(()=>cE)),e(Dy,"Uint16BufferAttribute",(()=>uE)),e(Dy,"Int32BufferAttribute",(()=>dE)),e(Dy,"Uint32BufferAttribute",(()=>fE)),e(Dy,"Float16BufferAttribute",(()=>hE)),e(Dy,"Float32BufferAttribute",(()=>pE)),e(Dy,"Float64BufferAttribute",(()=>mE)),e(Dy,"BufferGeometry",(()=>ME)),e(Dy,"Mesh",(()=>UE)),e(Dy,"BoxGeometry",(()=>GE)),e(Dy,"UniformsUtils",(()=>qE)),e(Dy,"ShaderMaterial",(()=>KE)),e(Dy,"Camera",(()=>$E)),e(Dy,"PerspectiveCamera",(()=>JE)),e(Dy,"CubeCamera",(()=>QE)),e(Dy,"CubeTexture",(()=>YE)),e(Dy,"WebGLCubeRenderTarget",(()=>ZE)),e(Dy,"Plane",(()=>rA)),e(Dy,"Frustum",(()=>aA)),e(Dy,"PlaneGeometry",(()=>cA)),e(Dy,"ShaderChunk",(()=>uA)),e(Dy,"UniformsLib",(()=>dA)),e(Dy,"ShaderLib",(()=>fA)),e(Dy,"OrthographicCamera",(()=>yA)),e(Dy,"PMREMGenerator",(()=>kA)),e(Dy,"MeshDepthMaterial",(()=>_k)),e(Dy,"MeshDistanceMaterial",(()=>Ek)),e(Dy,"WebGLUtils",(()=>Tk)),e(Dy,"ArrayCamera",(()=>Ik)),e(Dy,"Group",(()=>Ok)),e(Dy,"DepthTexture",(()=>Nk)),e(Dy,"WebGLRenderer",(()=>jk)),e(Dy,"WebGL1Renderer",(()=>Fk)),e(Dy,"FogExp2",(()=>zk)),e(Dy,"Fog",(()=>Uk)),e(Dy,"Scene",(()=>Hk)),e(Dy,"InterleavedBuffer",(()=>Gk)),e(Dy,"InterleavedBufferAttribute",(()=>Vk)),e(Dy,"SpriteMaterial",(()=>qk)),e(Dy,"Sprite",(()=>aT)),e(Dy,"LOD",(()=>uT)),e(Dy,"SkinnedMesh",(()=>gT)),e(Dy,"Bone",(()=>vT)),e(Dy,"DataTexture",(()=>bT)),e(Dy,"Skeleton",(()=>xT)),e(Dy,"InstancedBufferAttribute",(()=>ST)),e(Dy,"InstancedMesh",(()=>CT)),e(Dy,"LineBasicMaterial",(()=>kT)),e(Dy,"Line",(()=>NT)),e(Dy,"LineSegments",(()=>DT)),e(Dy,"LineLoop",(()=>jT)),e(Dy,"PointsMaterial",(()=>FT)),e(Dy,"Points",(()=>WT)),e(Dy,"VideoTexture",(()=>qT)),e(Dy,"FramebufferTexture",(()=>KT)),e(Dy,"CompressedTexture",(()=>$T)),e(Dy,"CanvasTexture",(()=>JT)),e(Dy,"Curve",(()=>XT)),e(Dy,"EllipseCurve",(()=>QT)),e(Dy,"ArcCurve",(()=>YT)),e(Dy,"CatmullRomCurve3",(()=>oI)),e(Dy,"CubicBezierCurve",(()=>lI)),e(Dy,"CubicBezierCurve3",(()=>cI)),e(Dy,"LineCurve",(()=>uI)),e(Dy,"LineCurve3",(()=>dI)),e(Dy,"QuadraticBezierCurve",(()=>fI)),e(Dy,"QuadraticBezierCurve3",(()=>hI)),e(Dy,"SplineCurve",(()=>pI)),e(Dy,"CurvePath",(()=>gI)),e(Dy,"Path",(()=>vI)),e(Dy,"LatheGeometry",(()=>bI)),e(Dy,"CapsuleGeometry",(()=>yI)),e(Dy,"CircleGeometry",(()=>wI)),e(Dy,"CylinderGeometry",(()=>xI)),e(Dy,"ConeGeometry",(()=>SI)),e(Dy,"PolyhedronGeometry",(()=>MI)),e(Dy,"DodecahedronGeometry",(()=>_I)),e(Dy,"EdgesGeometry",(()=>TI)),e(Dy,"Shape",(()=>II)),e(Dy,"ShapeUtils",(()=>nO)),e(Dy,"ExtrudeGeometry",(()=>iO)),e(Dy,"IcosahedronGeometry",(()=>sO)),e(Dy,"OctahedronGeometry",(()=>lO)),e(Dy,"RingGeometry",(()=>cO)),e(Dy,"ShapeGeometry",(()=>uO)),e(Dy,"SphereGeometry",(()=>dO)),e(Dy,"TetrahedronGeometry",(()=>fO)),e(Dy,"TorusGeometry",(()=>hO)),e(Dy,"TorusKnotGeometry",(()=>pO)),e(Dy,"TubeGeometry",(()=>mO)),e(Dy,"WireframeGeometry",(()=>gO)),e(Dy,"ShadowMaterial",(()=>yO)),e(Dy,"RawShaderMaterial",(()=>wO)),e(Dy,"MeshStandardMaterial",(()=>xO)),e(Dy,"MeshPhysicalMaterial",(()=>SO)),e(Dy,"MeshPhongMaterial",(()=>MO)),e(Dy,"MeshToonMaterial",(()=>_O)),e(Dy,"MeshNormalMaterial",(()=>EO)),e(Dy,"MeshLambertMaterial",(()=>AO)),e(Dy,"MeshMatcapMaterial",(()=>CO)),e(Dy,"LineDashedMaterial",(()=>kO)),e(Dy,"AnimationUtils",(()=>LO)),e(Dy,"Interpolant",(()=>BO)),e(Dy,"CubicInterpolant",(()=>DO)),e(Dy,"LinearInterpolant",(()=>jO)),e(Dy,"DiscreteInterpolant",(()=>FO)),e(Dy,"KeyframeTrack",(()=>zO)),e(Dy,"BooleanKeyframeTrack",(()=>UO)),e(Dy,"ColorKeyframeTrack",(()=>HO)),e(Dy,"NumberKeyframeTrack",(()=>GO)),e(Dy,"QuaternionLinearInterpolant",(()=>WO)),e(Dy,"QuaternionKeyframeTrack",(()=>VO)),e(Dy,"StringKeyframeTrack",(()=>qO)),e(Dy,"VectorKeyframeTrack",(()=>KO)),e(Dy,"AnimationClip",(()=>$O)),e(Dy,"Cache",(()=>XO)),e(Dy,"LoadingManager",(()=>QO)),e(Dy,"DefaultLoadingManager",(()=>YO)),e(Dy,"Loader",(()=>ZO)),e(Dy,"FileLoader",(()=>nR)),e(Dy,"AnimationLoader",(()=>rR)),e(Dy,"CompressedTextureLoader",(()=>oR)),e(Dy,"ImageLoader",(()=>iR)),e(Dy,"CubeTextureLoader",(()=>aR)),e(Dy,"DataTextureLoader",(()=>sR)),e(Dy,"TextureLoader",(()=>lR)),e(Dy,"Light",(()=>cR)),e(Dy,"HemisphereLight",(()=>uR)),e(Dy,"SpotLight",(()=>gR)),e(Dy,"PointLight",(()=>xR)),e(Dy,"DirectionalLight",(()=>MR)),e(Dy,"AmbientLight",(()=>_R)),e(Dy,"RectAreaLight",(()=>ER)),e(Dy,"SphericalHarmonics3",(()=>AR)),e(Dy,"LightProbe",(()=>CR)),e(Dy,"MaterialLoader",(()=>kR)),e(Dy,"LoaderUtils",(()=>TR)),e(Dy,"InstancedBufferGeometry",(()=>IR)),e(Dy,"BufferGeometryLoader",(()=>OR)),e(Dy,"ObjectLoader",(()=>RR)),e(Dy,"ImageBitmapLoader",(()=>BR)),e(Dy,"AudioContext",(()=>jR)),e(Dy,"AudioLoader",(()=>FR)),e(Dy,"HemisphereLightProbe",(()=>zR)),e(Dy,"AmbientLightProbe",(()=>UR)),e(Dy,"StereoCamera",(()=>VR)),e(Dy,"Clock",(()=>qR)),e(Dy,"AudioListener",(()=>YR)),e(Dy,"Audio",(()=>ZR)),e(Dy,"PositionalAudio",(()=>oP)),e(Dy,"AudioAnalyser",(()=>iP)),e(Dy,"PropertyMixer",(()=>aP)),e(Dy,"PropertyBinding",(()=>hP)),e(Dy,"AnimationObjectGroup",(()=>pP)),e(Dy,"AnimationMixer",(()=>vP)),e(Dy,"Uniform",(()=>bP)),e(Dy,"UniformsGroup",(()=>wP)),e(Dy,"InstancedInterleavedBuffer",(()=>xP)),e(Dy,"GLBufferAttribute",(()=>SP)),e(Dy,"Raycaster",(()=>MP)),e(Dy,"Spherical",(()=>AP)),e(Dy,"Cylindrical",(()=>CP)),e(Dy,"Box2",(()=>TP)),e(Dy,"Line3",(()=>RP)),e(Dy,"SpotLightHelper",(()=>NP)),e(Dy,"SkeletonHelper",(()=>jP)),e(Dy,"PointLightHelper",(()=>zP)),e(Dy,"HemisphereLightHelper",(()=>WP)),e(Dy,"GridHelper",(()=>VP)),e(Dy,"PolarGridHelper",(()=>qP)),e(Dy,"DirectionalLightHelper",(()=>XP)),e(Dy,"CameraHelper",(()=>ZP)),e(Dy,"BoxHelper",(()=>nN)),e(Dy,"Box3Helper",(()=>rN)),e(Dy,"PlaneHelper",(()=>oN)),e(Dy,"ArrowHelper",(()=>lN)),e(Dy,"AxesHelper",(()=>cN)),e(Dy,"ShapePath",(()=>uN)),e(Dy,"DataUtils",(()=>hN)),e(Dy,"ImmediateRenderObject",(()=>pN)),e(Dy,"WebGLMultisampleRenderTarget",(()=>mN)),e(Dy,"DataTexture2DArray",(()=>gN)),e(Dy,"DataTexture3D",(()=>vN)),e(Dy,"BoxBufferGeometry",(()=>bN)),e(Dy,"CapsuleBufferGeometry",(()=>yN)),e(Dy,"CircleBufferGeometry",(()=>wN)),e(Dy,"ConeBufferGeometry",(()=>xN)),e(Dy,"CylinderBufferGeometry",(()=>SN)),e(Dy,"DodecahedronBufferGeometry",(()=>MN)),e(Dy,"ExtrudeBufferGeometry",(()=>_N)),e(Dy,"IcosahedronBufferGeometry",(()=>EN)),e(Dy,"LatheBufferGeometry",(()=>AN)),e(Dy,"OctahedronBufferGeometry",(()=>CN)),e(Dy,"PlaneBufferGeometry",(()=>kN)),e(Dy,"PolyhedronBufferGeometry",(()=>TN)),e(Dy,"RingBufferGeometry",(()=>IN)),e(Dy,"ShapeBufferGeometry",(()=>ON)),e(Dy,"SphereBufferGeometry",(()=>RN)),e(Dy,"TetrahedronBufferGeometry",(()=>PN)),e(Dy,"TorusBufferGeometry",(()=>NN)),e(Dy,"TorusKnotBufferGeometry",(()=>LN)),e(Dy,"TubeBufferGeometry",(()=>BN));
91
91
  /**
92
92
  * @license
93
93
  * Copyright 2010-2022 Three.js Authors
@@ -112,4 +112,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
112
112
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
113
113
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
114
114
  PERFORMANCE OF THIS SOFTWARE.
115
- ***************************************************************************** */var VK=function(e,t){return VK=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},VK(e,t)};function qK(e,t){function n(){this.constructor=e}VK(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var KK=function(){return KK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},KK.apply(this,arguments)};Object.create;Object.create;var $K;u=a("85Hg2");function JK(e,t,n,r,o,i){void 0===i&&(i=0);var a=a$(e,t,i),s=a.width,l=a.height,c=Math.min(s,n),u=Math.min(l,r);return c>u*o?{width:u*o,height:u}:{width:c,height:c/o}}function XK(e,t,n,r,o){void 0===o&&(o=0);var i=a$(t.width,t.height,o),a=i.width,s=i.height;return{x:QK(e.x,a,n.width,r),y:QK(e.y,s,n.height,r)}}function QK(e,t,n,r){var o=t*r/2-n/2;return s$(e,-o,o)}function YK(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function ZK(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function e$(e,t,n,r,o,i,a){void 0===i&&(i=0),void 0===a&&(a=!0);var s=a?t$:n$,l=a$(t.width,t.height,i),c=a$(t.naturalWidth,t.naturalHeight,i),u={x:s(100,((l.width-n.width/o)/2-e.x/o)/l.width*100),y:s(100,((l.height-n.height/o)/2-e.y/o)/l.height*100),width:s(100,n.width/l.width*100/o),height:s(100,n.height/l.height*100/o)},d=Math.round(s(c.width,u.width*c.width/100)),f=Math.round(s(c.height,u.height*c.height/100)),h=c.width>=c.height*r?{width:Math.round(f*r),height:f}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:u,croppedAreaPixels:KK(KK({},h),{x:Math.round(s(c.width-h.width,u.x*c.width/100)),y:Math.round(s(c.height-h.height,u.y*c.height/100))})}}function t$(e,t){return Math.min(e,Math.max(0,t))}function n$(e,t){return t}function r$(e,t,n,r,o,i){var a=a$(t.width,t.height,n),s=s$(r.width/a.width*(100/e.width),o,i);return{crop:{x:s*a.width/2-r.width/2-a.width*s*(e.x/100),y:s*a.height/2-r.height/2-a.height*s*(e.y/100)},zoom:s}}function o$(e,t,n,r,o,i){void 0===n&&(n=0);var a=a$(t.naturalWidth,t.naturalHeight,n),s=s$(function(e,t,n){var r=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}(e,t,r),o,i),l=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((a.width-e.width)/2-e.x)*l,y:((a.height-e.height)/2-e.y)*l},zoom:s}}function i$(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function a$(e,t,n){var r=n*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function s$(e,t,n){return Math.min(Math.max(e,t),n)}function l$(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}$K=a("lmpx0");var c$=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=r(u).createRef(),n.videoRef=r(u).createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=document,n.currentWindow=window,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=r$(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),r=t.crop,o=t.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}else if(n.props.initialCroppedAreaPixels){var i=o$(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);r=i.crop,o=i.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}},n.computeSizes=function(){var e,t,r,o,i,a,s=n.imageRef.current||n.videoRef.current;if(s&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var l=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(r=n.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(o=n.videoRef.current)||void 0===o?void 0:o.videoHeight)||0,d=c/u,f=void 0;if(s.offsetWidth<c||s.offsetHeight<u)switch(n.props.objectFit){default:case"contain":f=l>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":f={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":f={width:n.containerRect.height*d,height:n.containerRect.height};break;case"auto-cover":f=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else f={width:s.offsetWidth,height:s.offsetHeight};n.mediaSize=KK(KK({},f),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var h=n.props.cropSize?n.props.cropSize:JK(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(i=n.state.cropSize)||void 0===i?void 0:i.height)===h.height&&(null===(a=n.state.cropSize)||void 0===a?void 0:a.width)===h.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(h),n.setState({cropSize:h},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(h),h}},n.onMouseDown=function(e){e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0])))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var r=t.getMousePoint(e),o=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(o,r,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+e.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,r,o=e.x,i=e.y;n.dragStartPosition={x:o,y:i},n.dragStartCrop=KK({},n.props.crop),null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t)},n.onDrag=function(e){var t=e.x,r=e.y;n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==r){var e=t-n.dragStartPosition.x,o=r-n.dragStartPosition.y,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+o},a=n.props.restrictPosition?XK(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(a)}}))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(!n.props.onWheelRequest||n.props.onWheelRequest(e)){e.preventDefault();var o=t.getMousePoint(e),i=r($K)(e).pixelY,a=n.props.zoom-i*n.props.zoomSpeed/200;n.setNewZoom(a,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e){var t=e.x,r=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(r-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,r=e.y,o=n.props,i=o.crop,a=o.zoom;return{x:(t+i.x)/a,y:(r+i.y)/a}},n.setNewZoom=function(e,t,r){var o=(void 0===r?{}:r).shouldUpdatePosition,i=void 0===o||o;if(n.state.cropSize&&n.props.onZoomChange){var a=s$(e,n.props.minZoom,n.props.maxZoom);if(i){var s=n.getPointOnContainer(t),l=n.getPointOnMedia(s),c={x:l.x*a-s.x,y:l.y*a-s.y},u=n.props.restrictPosition?XK(c,n.mediaSize,n.state.cropSize,a,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(a)}},n.getCropData=function(){return n.state.cropSize?e$(n.props.restrictPosition?XK(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,r),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?XK(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return qK(t,e),t.prototype.componentDidMount=function(){this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef)},t.prototype.componentWillUnmount=function(){var e;this.currentWindow.removeEventListener("resize",this.computeSizes),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,n,r,o,i,a,s,l,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.width)?this.computeSizes():(null===(i=e.crop)||void 0===i?void 0:i.x)===(null===(a=this.props.crop)||void 0===a?void 0:a.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(l=this.props.crop)||void 0===l?void 0:l.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=YK(n,r),this.lastPinchRotation=ZK(n,r),this.onDragStart(i$(n,r))},t.prototype.onPinchMove=function(e){var n=this,r=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]),i=i$(r,o);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=YK(r,o),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var a=ZK(r,o),s=n.props.rotation+(a-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=a}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,i=t.mediaProps,a=t.transform,s=t.crop,l=s.x,c=s.y,d=t.rotation,f=t.zoom,h=t.cropShape,p=t.showGrid,m=t.style,g=m.containerStyle,v=m.cropAreaStyle,b=m.mediaStyle,y=t.classes,w=y.containerClassName,x=y.cropAreaClassName,S=y.mediaClassName,M=t.objectFit;return r(u).createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:l$("reactEasyCrop_Container",w)},n?r(u).createElement("img",KK({alt:"",className:l$("reactEasyCrop_Image","contain"===M&&"reactEasyCrop_Contain","horizontal-cover"===M&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===M&&"reactEasyCrop_Cover_Vertical","auto-cover"===M&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),S)},i,{src:n,ref:this.imageRef,style:KK(KK({},b),{transform:a||"translate("+l+"px, "+c+"px) rotate("+d+"deg) scale("+f+")"}),onLoad:this.onMediaLoad})):o&&r(u).createElement("video",KK({autoPlay:!0,loop:!0,muted:!0,className:l$("reactEasyCrop_Video","contain"===M&&"reactEasyCrop_Contain","horizontal-cover"===M&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===M&&"reactEasyCrop_Cover_Vertical","auto-cover"===M&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),S)},i,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:KK(KK({},b),{transform:a||"translate("+l+"px, "+c+"px) rotate("+d+"deg) scale("+f+")"}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return r(u).createElement("source",KK({key:e.src},e))}))),this.state.cropSize&&r(u).createElement("div",{style:KK(KK({},v),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:l$("reactEasyCrop_CropArea","round"===h&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",x)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(r(u).Component),u$=c$,d$={};e(d$,"default",(()=>G$),(e=>G$=e));Xd=a("4IUwl");var f$,h$=a("3ju0v");rz=a("hCRLo"),sW=a("a0mDm"),az=a("jp3pO"),u=a("85Hg2"),Xd=a("4IUwl");f$=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var c=i[l];if(!s(c))return!1;var u=e[c],d=t[c];if(!1===(o=n?n.call(r,u,d,c):void 0)||void 0===o&&u!==d)return!1}return!0};aW=a("98I6H");var p$=a("3b0np"),m$=(u=a("85Hg2"),aW=a("98I6H"),sz=a("jfn1H"),h$=a("3ju0v"),p$=a("3b0np"),u=a("85Hg2"),Xd=a("4IUwl"),(u=a("85Hg2")).createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0}));function g$(e,t,n){return(e-t)/(n-t)}function v$(e,t,n,r){var o=g$(t,n,r),i={};switch(e){case"rtl":i.right="".concat(100*o,"%"),i.transform="translateX(50%)";break;case"btt":i.bottom="".concat(100*o,"%"),i.transform="translateY(50%)";break;case"ttb":i.top="".concat(100*o,"%"),i.transform="translateY(-50%)";break;default:i.left="".concat(100*o,"%"),i.transform="translateX(-50%)"}return i}function b$(e,t){return Array.isArray(e)?e[t]:e}var y$=["prefixCls","value","valueIndex","onStartMove","style","render","dragging","onOffsetChange"],w$=u.forwardRef((function(e,t){var n,o,i=e.prefixCls,a=e.value,s=e.valueIndex,l=e.onStartMove,c=e.style,d=e.render,f=e.dragging,h=e.onOffsetChange,p=(0,p$.default)(e,y$),m=u.useContext(m$),g=m.min,v=m.max,b=m.direction,y=m.disabled,w=m.range,x=m.tabIndex,S=m.ariaLabelForHandle,M=m.ariaLabelledByForHandle,_=m.ariaValueTextFormatterForHandle,E="".concat(i,"-handle"),A=function(e){y||l(e,s)},C=v$(b,a,g,v),k=u.createElement("div",(0,aW.default)({ref:t,className:r(Xd)(E,(n={},(0,h$.default)(n,"".concat(E,"-").concat(s+1),w),(0,h$.default)(n,"".concat(E,"-dragging"),f),n)),style:(0,sz.default)((0,sz.default)({},C),c),onMouseDown:A,onTouchStart:A,onKeyDown:function(e){if(!y){var t=null;switch(e.which||e.keyCode){case xW.LEFT:t="ltr"===b||"btt"===b?-1:1;break;case xW.RIGHT:t="ltr"===b||"btt"===b?1:-1;break;case xW.UP:t="ttb"!==b?1:-1;break;case xW.DOWN:t="ttb"!==b?-1:1;break;case xW.HOME:t="min";break;case xW.END:t="max";break;case xW.PAGE_UP:t=2;break;case xW.PAGE_DOWN:t=-2}null!==t&&(e.preventDefault(),h(t,s))}},tabIndex:y?null:b$(x,s),role:"slider","aria-valuemin":g,"aria-valuemax":v,"aria-valuenow":a,"aria-disabled":y,"aria-label":b$(S,s),"aria-labelledby":b$(M,s),"aria-valuetext":null===(o=b$(_,s))||void 0===o?void 0:o(a)},p));return d&&(k=d(k,{index:s,prefixCls:i,value:a,dragging:f})),k})),x$=w$,S$=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","draggingIndex"],M$=u.forwardRef((function(e,t){var n=e.prefixCls,r=e.style,o=e.onStartMove,i=e.onOffsetChange,a=e.values,s=e.handleRender,l=e.draggingIndex,c=(0,p$.default)(e,S$),d=u.useRef({});return u.useImperativeHandle(t,(function(){return{focus:function(e){var t;null===(t=d.current[e])||void 0===t||t.focus()}}})),u.createElement(u.Fragment,null,a.map((function(e,t){return u.createElement(x$,(0,aW.default)({ref:function(e){e?d.current[t]=e:delete d.current[t]},dragging:l===t,prefixCls:n,style:b$(r,t),key:t,value:e,valueIndex:t,onStartMove:o,onOffsetChange:i,render:s},c))})))}));rz=a("hCRLo"),sW=a("a0mDm"),u=a("85Hg2");function _$(e){var t="touches"in e?e.touches[0]:e;return{pageX:t.pageX,pageY:t.pageY}}function E$(e,t,n,r,o,i,a,s,l){var c=u.useState(null),d=(0,sW.default)(c,2),f=d[0],h=d[1],p=u.useState(-1),m=(0,sW.default)(p,2),g=m[0],v=m[1],b=u.useState(n),y=(0,sW.default)(b,2),w=y[0],x=y[1],S=u.useState(n),M=(0,sW.default)(S,2),_=M[0],E=M[1],A=u.useRef(null),C=u.useRef(null);u.useEffect((function(){-1===g&&x(n)}),[n,g]),u.useEffect((function(){return function(){document.removeEventListener("mousemove",A.current),document.removeEventListener("mouseup",C.current),document.removeEventListener("touchmove",A.current),document.removeEventListener("touchend",C.current)}}),[]);var k=function(e,t){w.some((function(t,n){return t!==e[n]}))&&(void 0!==t&&h(t),x(e),a(e))},T=function(e,t){if(-1===e){var n=_[0],a=_[_.length-1],s=r-n,c=o-a,u=t*(o-r);u=Math.max(u,s),u=Math.min(u,c);var d=i(n+u);u=d-n;var f=_.map((function(e){return e+u}));k(f)}else{var h=(o-r)*t,p=(0,rz.default)(w);p[e]=_[e];var m=l(p,h,e,"dist");k(m.values,m.value)}},I=u.useRef(T);I.current=T;var O=u.useMemo((function(){var e=(0,rz.default)(n).sort((function(e,t){return e-t})),t=(0,rz.default)(w).sort((function(e,t){return e-t}));return e.every((function(e,n){return e===t[n]}))?w:n}),[n,w]);return[g,f,O,function(r,o){r.stopPropagation();var i=n[o];v(o),h(i),E(n);var a=_$(r),l=a.pageX,c=a.pageY,u=function(n){n.preventDefault();var r,i=_$(n),a=i.pageX,s=i.pageY,u=a-l,d=s-c,f=e.current.getBoundingClientRect(),h=f.width,p=f.height;switch(t){case"btt":r=-d/p;break;case"ttb":r=d/p;break;case"rtl":r=-u/h;break;default:r=u/h}I.current(o,r)},d=function e(t){t.preventDefault(),document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",u),document.removeEventListener("touchend",e),document.removeEventListener("touchmove",u),A.current=null,C.current=null,v(-1),s()};document.addEventListener("mouseup",d),document.addEventListener("mousemove",u),document.addEventListener("touchend",d),document.addEventListener("touchmove",u),A.current=u,C.current=d}]}u=a("85Hg2"),sz=a("jfn1H"),u=a("85Hg2"),Xd=a("4IUwl");function A$(e){var t=e.prefixCls,n=e.style,o=e.start,i=e.end,a=e.index,s=e.onStartMove,l=u.useContext(m$),c=l.direction,d=l.min,f=l.max,h=l.disabled,p=l.range,m="".concat(t,"-track"),g=g$(o,d,f),v=g$(i,d,f),b=function(e){!h&&s&&s(e,-1)},y={};switch(c){case"rtl":y.right="".concat(100*g,"%"),y.width="".concat(100*v-100*g,"%");break;case"btt":y.bottom="".concat(100*g,"%"),y.height="".concat(100*v-100*g,"%");break;case"ttb":y.top="".concat(100*g,"%"),y.height="".concat(100*v-100*g,"%");break;default:y.left="".concat(100*g,"%"),y.width="".concat(100*v-100*g,"%")}return u.createElement("div",{className:r(Xd)(m,p&&"".concat(m,"-").concat(a+1)),style:(0,sz.default)((0,sz.default)({},y),n),onMouseDown:b,onTouchStart:b})}function C$(e){var t=e.prefixCls,n=e.style,r=e.values,o=e.startPoint,i=e.onStartMove,a=u.useContext(m$),s=a.included,l=a.range,c=a.min,d=u.useMemo((function(){if(!l){if(0===r.length)return[];var e=null!=o?o:c,t=r[0];return[{start:Math.min(e,t),end:Math.max(e,t)}]}for(var n=[],i=0;i<r.length-1;i+=1)n.push({start:r[i],end:r[i+1]});return n}),[r,l,o,c]);return s?d.map((function(e,r){var o=e.start,a=e.end;return u.createElement(A$,{index:r,prefixCls:t,style:b$(n,r),start:o,end:a,key:r,onStartMove:i})})):null}u=a("85Hg2"),sz=a("jfn1H"),h$=a("3ju0v"),u=a("85Hg2"),Xd=a("4IUwl");function k$(e){var t=e.prefixCls,n=e.style,o=e.children,i=e.value,a=e.onClick,s=u.useContext(m$),l=s.min,c=s.max,d=s.direction,f=s.includedStart,h=s.includedEnd,p=s.included,m="".concat(t,"-text"),g=v$(d,i,l,c);return u.createElement("span",{className:r(Xd)(m,(0,h$.default)({},"".concat(m,"-active"),p&&f<=i&&i<=h)),style:(0,sz.default)((0,sz.default)({},g),n),onMouseDown:function(e){e.stopPropagation()},onClick:function(){a(i)}},o)}function T$(e){var t=e.prefixCls,n=e.marks,r=e.onClick,o="".concat(t,"-mark");return n.length?u.createElement("div",{className:o},n.map((function(e){var t=e.value,n=e.style,i=e.label;return u.createElement(k$,{key:t,prefixCls:o,style:n,value:t,onClick:r},i)}))):null}u=a("85Hg2"),h$=a("3ju0v"),sz=a("jfn1H"),u=a("85Hg2"),Xd=a("4IUwl");function I$(e){var t=e.prefixCls,n=e.value,o=e.style,i=e.activeStyle,a=u.useContext(m$),s=a.min,l=a.max,c=a.direction,d=a.included,f=a.includedStart,h=a.includedEnd,p="".concat(t,"-dot"),m=d&&f<=n&&n<=h,g=(0,sz.default)((0,sz.default)({},v$(c,n,s,l)),"function"==typeof o?o(n):o);return m&&(g=(0,sz.default)((0,sz.default)({},g),"function"==typeof i?i(n):i)),u.createElement("span",{className:r(Xd)(p,(0,h$.default)({},"".concat(p,"-active"),m)),style:g})}function O$(e){var t=e.prefixCls,n=e.marks,r=e.dots,o=e.style,i=e.activeStyle,a=u.useContext(m$),s=a.min,l=a.max,c=a.step,d=u.useMemo((function(){var e=new Set;if(n.forEach((function(t){e.add(t.value)})),r&&null!==c)for(var t=s;t<=l;)e.add(t),t+=c;return Array.from(e)}),[s,l,c,r,n]);return u.createElement("div",{className:"".concat(t,"-step")},d.map((function(e){return u.createElement(I$,{prefixCls:t,key:e,value:e,style:o,activeStyle:i})})))}rz=a("hCRLo"),u=a("85Hg2");function R$(e,t,n,r,o,i){var a=u.useCallback((function(n){var r=isFinite(n)?n:e;return r=Math.min(t,n),r=Math.max(e,r)}),[e,t]),s=u.useCallback((function(r){if(null!==n){var o=e+Math.round((a(r)-e)/n)*n,i=function(e){return(String(e).split(".")[1]||"").length},s=Math.max(i(n),i(t),i(e)),l=Number(o.toFixed(s));return e<=l&&l<=t?l:null}return null}),[n,e,t,a]),l=u.useCallback((function(o){var i=a(o),l=r.map((function(e){return e.value}));null!==n&&l.push(s(o)),l.push(e,t);var c=l[0],u=t-e;return l.forEach((function(e){var t=Math.abs(i-e);t<=u&&(c=e,u=t)})),c}),[e,t,r,n,a,s]),c=function o(i,a,l){var c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit";if("number"==typeof a){var u,d=i[l],f=d+a,h=[];r.forEach((function(e){h.push(e.value)})),h.push(e,t),h.push(s(d));var p=a>0?1:-1;"unit"===c?h.push(s(d+p*n)):h.push(s(f)),h=h.filter((function(e){return null!==e})).filter((function(e){return a<0?e<=d:e>=d})),"unit"===c&&(h=h.filter((function(e){return e!==d})));var m="unit"===c?d:f;u=h[0];var g=Math.abs(u-m);if(h.forEach((function(e){var t=Math.abs(e-m);t<g&&(u=e,g=t)})),void 0===u)return a<0?e:t;if("dist"===c)return u;if(Math.abs(a)>1){var v=(0,rz.default)(i);return v[l]=u,o(v,a-p,l,c)}return u}return"min"===a?e:"max"===a?t:void 0},d=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",o=e[n],i=c(e,t,n,r);return{value:i,changed:i!==o}},f=function(e){return null===i&&0===e||"number"==typeof i&&e<i};return[l,function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",a=e.map(l),s=a[n],u=c(a,t,n,r);if(a[n]=u,!1===o){var h=i||0;n>0&&a[n-1]!==s&&(a[n]=Math.max(a[n],a[n-1]+h)),n<a.length-1&&a[n+1]!==s&&(a[n]=Math.min(a[n],a[n+1]-h))}else if("number"==typeof i||null===i){for(var p=n+1;p<a.length;p+=1)for(var m=!0;f(a[p]-a[p-1])&&m;){var g=d(a,1,p);a[p]=g.value,m=g.changed}for(var v=n;v>0;v-=1)for(var b=!0;f(a[v]-a[v-1])&&b;){var y=d(a,-1,v-1);a[v-1]=y.value,b=y.changed}for(var w=a.length-1;w>0;w-=1)for(var x=!0;f(a[w]-a[w-1])&&x;){var S=d(a,-1,w-1);a[w-1]=S.value,x=S.changed}for(var M=0;M<a.length-1;M+=1)for(var _=!0;f(a[M+1]-a[M])&&_;){var E=d(a,1,M+1);a[M+1]=E.value,_=E.changed}}return{value:a[n],values:a}}]}a("irlKZ");var P$=u.forwardRef((function(e,t){var n,o=e.prefixCls,i=void 0===o?"rc-slider":o,a=e.className,s=e.style,l=e.disabled,c=void 0!==l&&l,d=e.autoFocus,f=e.onFocus,h=e.onBlur,p=e.min,m=void 0===p?0:p,g=e.max,v=void 0===g?100:g,b=e.step,y=void 0===b?1:b,w=e.value,x=e.defaultValue,S=e.range,M=e.count,_=e.onChange,E=e.onBeforeChange,A=e.onAfterChange,C=e.allowCross,k=void 0===C||C,T=e.pushable,I=void 0!==T&&T,O=e.draggableTrack,R=e.reverse,P=e.vertical,N=e.included,L=void 0===N||N,B=e.startPoint,D=e.trackStyle,j=e.handleStyle,F=e.railStyle,z=e.dotStyle,U=e.activeDotStyle,H=e.marks,G=e.dots,W=e.handleRender,V=e.tabIndex,q=void 0===V?0:V,K=e.ariaLabelForHandle,$=e.ariaLabelledByForHandle,J=e.ariaValueTextFormatterForHandle,X=u.useRef(),Q=u.useRef(),Y=u.useMemo((function(){return P?R?"ttb":"btt":R?"rtl":"ltr"}),[R,P]),Z=u.useMemo((function(){return isFinite(m)?m:0}),[m]),ee=u.useMemo((function(){return isFinite(v)?v:100}),[v]),te=u.useMemo((function(){return null!==y&&y<=0?1:y}),[y]),ne=u.useMemo((function(){return!0===I?te:I>=0&&I}),[I,te]),re=u.useMemo((function(){return Object.keys(H||{}).map((function(e){var t=H[e],n={value:Number(e)};return t&&"object"===(0,az.default)(t)&&!u.isValidElement(t)&&("label"in t||"style"in t)?(n.style=t.style,n.label=t.label):n.label=t,n})).filter((function(e){var t=e.label;return t||"number"==typeof t})).sort((function(e,t){return e.value-t.value}))}),[H]),oe=R$(Z,ee,te,re,k,ne),ie=(0,sW.default)(oe,2),ae=ie[0],se=ie[1],le=VV(x,{value:w}),ce=(0,sW.default)(le,2),ue=ce[0],de=ce[1],fe=u.useMemo((function(){var e=null==ue?[]:Array.isArray(ue)?ue:[ue],t=(0,sW.default)(e,1)[0],n=null===ue?[]:[void 0===t?Z:t];if(S){if(n=(0,rz.default)(e),M||void 0===ue){var r=M>=0?M+1:2;for(n=n.slice(0,r);n.length<r;){var o;n.push(null!==(o=n[n.length-1])&&void 0!==o?o:Z)}}n.sort((function(e,t){return e-t}))}return n.forEach((function(e,t){n[t]=ae(e)})),n}),[ue,S,Z,M,ae]),he=u.useRef(fe);he.current=fe;var pe=function(e){return S?e:e[0]},me=function(e){var t=(0,rz.default)(e).sort((function(e,t){return e-t}));_&&!r(f$)(t,he.current)&&_(pe(t)),de(t)},ge=function(e){if(!c){var t=0,n=ee-Z;fe.forEach((function(r,o){var i=Math.abs(e-r);i<=n&&(n=i,t=o)}));var r=(0,rz.default)(fe);r[t]=e,S&&!fe.length&&void 0===M&&r.push(e),null==E||E(pe(r)),me(r),null==A||A(pe(r))}},ve=u.useState(null),be=(0,sW.default)(ve,2),ye=be[0],we=be[1];u.useEffect((function(){if(null!==ye){var e=fe.indexOf(ye);e>=0&&X.current.focus(e)}we(null)}),[ye]);var xe=u.useMemo((function(){return(!O||null!==te)&&O}),[O,te]),Se=E$(Q,Y,fe,Z,ee,ae,me,(function(){null==A||A(pe(he.current))}),se),Me=(0,sW.default)(Se,4),_e=Me[0],Ee=Me[1],Ae=Me[2],Ce=Me[3],ke=function(e,t){Ce(e,t),null==E||E(pe(he.current))},Te=-1!==_e;u.useEffect((function(){if(!Te){var e=fe.lastIndexOf(Ee);X.current.focus(e)}}),[Te]);var Ie=u.useMemo((function(){return(0,rz.default)(Ae).sort((function(e,t){return e-t}))}),[Ae]),Oe=u.useMemo((function(){return S?[Ie[0],Ie[Ie.length-1]]:[Z,Ie[0]]}),[Ie,S,Z]),Re=(0,sW.default)(Oe,2),Pe=Re[0],Ne=Re[1];u.useImperativeHandle(t,(function(){return{focus:function(){X.current.focus(0)},blur:function(){var e=document.activeElement;Q.current.contains(e)&&(null==e||e.blur())}}})),u.useEffect((function(){d&&X.current.focus(0)}),[]);var Le=u.useMemo((function(){return{min:Z,max:ee,direction:Y,disabled:c,step:te,included:L,includedStart:Pe,includedEnd:Ne,range:S,tabIndex:q,ariaLabelForHandle:K,ariaLabelledByForHandle:$,ariaValueTextFormatterForHandle:J}}),[Z,ee,Y,c,te,L,Pe,Ne,S,q,K,$,J]);return u.createElement(m$.Provider,{value:Le},u.createElement("div",{ref:Q,className:r(Xd)(i,a,(n={},(0,h$.default)(n,"".concat(i,"-disabled"),c),(0,h$.default)(n,"".concat(i,"-vertical"),P),(0,h$.default)(n,"".concat(i,"-horizontal"),!P),(0,h$.default)(n,"".concat(i,"-with-marks"),re.length),n)),style:s,onMouseDown:function(e){e.preventDefault();var t,n=Q.current.getBoundingClientRect(),r=n.width,o=n.height,i=n.left,a=n.top,s=n.bottom,l=n.right,c=e.clientX,u=e.clientY;switch(Y){case"btt":t=(s-u)/o;break;case"ttb":t=(u-a)/o;break;case"rtl":t=(l-c)/r;break;default:t=(c-i)/r}ge(ae(Z+t*(ee-Z)))}},u.createElement("div",{className:"".concat(i,"-rail"),style:F}),u.createElement(C$,{prefixCls:i,style:D,values:Ie,startPoint:B,onStartMove:xe?ke:null}),u.createElement(O$,{prefixCls:i,marks:re,dots:G,style:z,activeStyle:U}),u.createElement(M$,{ref:X,prefixCls:i,style:j,values:Ae,draggingIndex:_e,onStartMove:ke,onOffsetChange:function(e,t){if(!c){var n=se(fe,e,t);null==E||E(pe(fe)),me(n.values),null==A||A(pe(n.values)),we(n.value)}},onFocus:f,onBlur:h,handleRender:W}),u.createElement(T$,{prefixCls:i,marks:re,onClick:ge})))})),N$=P$;u=a("85Hg2"),JH=a("ae6os"),WH=a("1w3TK"),u=a("85Hg2");var L$=(u=a("85Hg2")).forwardRef(((e,t)=>{const{open:n}=e,r=(0,u.useRef)(null),o=(0,u.useRef)(null);function i(){JH.default.cancel(o.current),o.current=null}return u.useEffect((()=>(n?o.current=(0,JH.default)((()=>{var e;null===(e=r.current)||void 0===e||e.forcePopupAlign(),o.current=null})):i(),i)),[n,e.title]),u.createElement(Eq.default,Object.assign({ref:(0,WH.composeRef)(r,t)},e))}));Bz=a("LDfY3");const B$=e=>{const{componentCls:t,controlSize:n,dotSize:r,marginFull:o,marginPart:i,colorFillContentHover:a}=e;return{[t]:Object.assign(Object.assign({},eU(e)),{position:"relative",height:n,margin:`${i}px ${o}px`,padding:0,cursor:"pointer",touchAction:"none","&-vertical":{margin:`${o}px ${i}px`},[`${t}-rail`]:{position:"absolute",backgroundColor:e.colorFillTertiary,borderRadius:e.borderRadiusXS,transition:`background-color ${e.motionDurationMid}`},[`${t}-track`]:{position:"absolute",backgroundColor:e.colorPrimaryBorder,borderRadius:e.borderRadiusXS,transition:`background-color ${e.motionDurationMid}`},"&:hover":{[`${t}-rail`]:{backgroundColor:e.colorFillSecondary},[`${t}-track`]:{backgroundColor:e.colorPrimaryBorderHover},[`${t}-dot`]:{borderColor:a},[`${t}-handle::after`]:{boxShadow:`0 0 0 ${e.handleLineWidth}px ${e.colorPrimaryBorderHover}`},[`${t}-dot-active`]:{borderColor:e.colorPrimary}},[`${t}-handle`]:{position:"absolute",width:e.handleSize,height:e.handleSize,outline:"none",[`${t}-dragging`]:{zIndex:1},"&::before":{content:'""',position:"absolute",insetInlineStart:-e.handleLineWidth,insetBlockStart:-e.handleLineWidth,width:e.handleSize+2*e.handleLineWidth,height:e.handleSize+2*e.handleLineWidth,backgroundColor:"transparent"},"&::after":{content:'""',position:"absolute",insetBlockStart:0,insetInlineStart:0,width:e.handleSize,height:e.handleSize,backgroundColor:e.colorBgElevated,boxShadow:`0 0 0 ${e.handleLineWidth}px ${e.colorPrimaryBorder}`,borderRadius:"50%",cursor:"pointer",transition:`\n inset-inline-start ${e.motionDurationMid},\n inset-block-start ${e.motionDurationMid},\n width ${e.motionDurationMid},\n height ${e.motionDurationMid},\n box-shadow ${e.motionDurationMid}\n `},"&:hover, &:active, &:focus":{"&::before":{insetInlineStart:-((e.handleSizeHover-e.handleSize)/2+e.handleLineWidthHover),insetBlockStart:-((e.handleSizeHover-e.handleSize)/2+e.handleLineWidthHover),width:e.handleSizeHover+2*e.handleLineWidthHover,height:e.handleSizeHover+2*e.handleLineWidthHover},"&::after":{boxShadow:`0 0 0 ${e.handleLineWidthHover}px ${e.colorPrimary}`,width:e.handleSizeHover,height:e.handleSizeHover,insetInlineStart:(e.handleSize-e.handleSizeHover)/2,insetBlockStart:(e.handleSize-e.handleSizeHover)/2}}},[`${t}-mark`]:{position:"absolute",fontSize:e.fontSize},[`${t}-mark-text`]:{position:"absolute",display:"inline-block",color:e.colorTextDescription,textAlign:"center",wordBreak:"keep-all",cursor:"pointer",userSelect:"none","&-active":{color:e.colorText}},[`${t}-step`]:{position:"absolute",background:"transparent",pointerEvents:"none"},[`${t}-dot`]:{position:"absolute",width:r,height:r,backgroundColor:e.colorBgElevated,border:`${e.handleLineWidth}px solid ${e.colorBorderSecondary}`,borderRadius:"50%",cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,"&-active":{borderColor:e.colorPrimaryBorder}},"&&-disabled":{cursor:"not-allowed",[`${t}-rail`]:{backgroundColor:`${e.colorFillSecondary} !important`},[`${t}-track`]:{backgroundColor:`${e.colorTextDisabled} !important`},[`\n ${t}-dot\n `]:{backgroundColor:e.colorBgElevated,borderColor:e.colorTextDisabled,boxShadow:"none",cursor:"not-allowed"},[`${t}-handle::after`]:{backgroundColor:e.colorBgElevated,cursor:"not-allowed",width:e.handleSize,height:e.handleSize,boxShadow:`0 0 0 ${e.handleLineWidth}px ${new(0,Bz.TinyColor)(e.colorTextDisabled).onBackground(e.colorBgContainer).toHexString()}`,insetInlineStart:0,insetBlockStart:0},[`\n ${t}-mark-text,\n ${t}-dot\n `]:{cursor:"not-allowed !important"}}})}},D$=(e,t)=>{const{componentCls:n,railSize:r,handleSize:o,dotSize:i}=e,a=t?"width":"height",s=t?"height":"width",l=t?"insetBlockStart":"insetInlineStart",c=t?"top":"insetInlineStart";return{[t?"paddingBlock":"paddingInline"]:r,[s]:3*r,[`${n}-rail`]:{[a]:"100%",[s]:r},[`${n}-track`]:{[s]:r},[`${n}-handle`]:{[l]:(3*r-o)/2},[`${n}-mark`]:{insetInlineStart:0,top:0,[c]:o,[a]:"100%"},[`${n}-step`]:{insetInlineStart:0,top:0,[c]:r,[a]:"100%",[s]:r},[`${n}-dot`]:{position:"absolute",[l]:(r-i)/2}}},j$=e=>{const{componentCls:t,marginPartWithMark:n}=e;return{[`${t}-horizontal`]:Object.assign(Object.assign({},D$(e,!0)),{[`&${t}-with-marks`]:{marginBottom:n}})}},F$=e=>{const{componentCls:t}=e;return{[`${t}-vertical`]:Object.assign(Object.assign({},D$(e,!1)),{height:"100%"})}};var z$=pU("Slider",(e=>{const t=uU(e,{marginPart:(e.controlHeight-e.controlSize)/2,marginFull:e.controlSize/2,marginPartWithMark:e.controlHeightLG-e.controlSize});return[B$(t),j$(t),F$(t)]}),(e=>{const t=e.controlHeightLG/4;return{controlSize:t,railSize:4,handleSize:t,handleSizeHover:e.controlHeightSM/2,dotSize:8,handleLineWidth:e.lineWidth+1,handleLineWidthHover:e.lineWidth+3}})),U$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};const H$=e=>"number"==typeof e?e.toString():"";var G$=u.forwardRef(((e,t)=>{const{prefixCls:n,range:o,className:i,tooltipPrefixCls:a,tipFormatter:s,tooltipVisible:l,getTooltipPopupContainer:c,tooltipPlacement:d}=e,f=U$(e,["prefixCls","range","className","tooltipPrefixCls","tipFormatter","tooltipVisible","getTooltipPopupContainer","tooltipPlacement"]),{getPrefixCls:h,direction:p,getPopupContainer:m}=u.useContext(aU),[g,v]=u.useState({}),b=(e,t)=>{v((n=>Object.assign(Object.assign({},n),{[e]:t})))},y=(e,t)=>e||(t?"rtl"===p?"left":"right":"top"),w=h("slider",n),[x,S]=z$(w),M=r(Xd)(i,{[`${w}-rtl`]:"rtl"===p},S);"rtl"!==p||f.vertical||(f.reverse=!f.reverse);const[_,E]=u.useMemo((()=>o?"object"==typeof o?[!0,o.draggableTrack]:[!0,!1]:[!1]),[o]);return x(u.createElement(N$,Object.assign({},f,{step:f.step,range:_,draggableTrack:E,className:M,ref:t,prefixCls:w,handleRender:(t,n)=>{var r;const{index:o,dragging:i}=n,{tooltip:f={},vertical:p}=e,v=Object.assign({},f),{open:x,placement:S,getPopupContainer:M,prefixCls:_,formatter:E}=v;let A;A=E||null===E?E:s||null===s?s:H$;const C=!!A&&(g[o]||i),k=null!==(r=null!=x?x:l)&&void 0!==r?r:void 0===x&&C,T=Object.assign(Object.assign({},t.props),{onMouseEnter:()=>b(o,!0),onMouseLeave:()=>b(o,!1)}),I=h("tooltip",null!=_?_:a);return u.createElement(L$,{prefixCls:I,title:A?A(n.value):"",open:k,placement:y(null!=S?S:d,p),key:o,overlayClassName:`${w}-tooltip`,getPopupContainer:M||c||m},u.cloneElement(t,T))}})))}));const W$="img-crop",V$=.1,q$=(0,u.forwardRef)(((e,t)=>{const{cropperRef:n,image:r,aspect:o,shape:i,grid:a,zoom:l,rotate:c,minZoom:d,maxZoom:f,cropperProps:h}=e,[p,m]=(0,u.useState)({x:0,y:0}),[g,v]=(0,u.useState)({width:0,height:0}),[b,y]=(0,u.useState)(1),[w,x]=(0,u.useState)(0),S=(0,u.useRef)({width:0,height:0,x:0,y:0}),M=(0,u.useCallback)((e=>{const{width:t,height:n}=e,r=n*o;v(t>r?{width:r,height:n}:{width:t,height:t/o})}),[o]),_=(0,u.useCallback)(((e,t)=>{S.current=t}),[]);return(0,u.useImperativeHandle)(t,(()=>({rotateVal:w,setZoomVal:y,setRotateVal:x,cropPixelsRef:S}))),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u$,Object.assign({},h,{ref:n,image:r,crop:p,cropSize:g,onCropChange:m,aspect:o,cropShape:i,showGrid:a,zoomWithScroll:l,zoom:b,rotation:w,onZoomChange:y,onRotationChange:x,minZoom:d,maxZoom:f,onMediaLoaded:M,onCropComplete:_,classes:{containerClassName:`${W$}-container`,mediaClassName:`${W$}-media`}})),l&&(0,s.jsxs)("section",Object.assign({className:`${W$}-control ${W$}-control-zoom`},{children:[(0,s.jsx)("button",Object.assign({onClick:()=>y(b-V$),disabled:b-V$<d},{children:"-"})),(0,s.jsx)(d$.default,{min:d,max:f,step:V$,value:b,onChange:y}),(0,s.jsx)("button",Object.assign({onClick:()=>y(b+V$),disabled:b+V$>f},{children:"+"}))]})),c&&(0,s.jsxs)("section",Object.assign({className:`${W$}-control ${W$}-control-rotate`},{children:[(0,s.jsx)("button",Object.assign({onClick:()=>x(w-1),disabled:-180===w},{children:"↺"})),(0,s.jsx)(d$.default,{min:-180,max:180,step:1,value:w,onChange:x}),(0,s.jsx)("button",Object.assign({onClick:()=>x(w+1),disabled:180===w},{children:"↻"}))]}))]})}));var K$=(0,u.memo)(q$);!function(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");t.setAttribute("media","screen"),t.innerHTML=e,document.head.appendChild(t)}}(".img-crop-modal .img-crop-container {\n position: relative;\n width: 100%;\n height: 40vh;\n}\n.img-crop-modal .img-crop-control {\n display: flex;\n align-items: center;\n width: 60%;\n margin-left: auto;\n margin-right: auto;\n}\n.img-crop-modal .img-crop-control:first-of-type {\n margin-top: 16px;\n}\n.img-crop-modal .img-crop-control:last-of-type {\n margin-bottom: -8px;\n}\n.img-crop-modal .img-crop-control button {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 34px;\n height: 34px;\n padding: 0;\n font-style: normal;\n background: transparent;\n border: 0;\n outline: 0;\n cursor: pointer;\n}\n.img-crop-modal .img-crop-control button[disabled] {\n cursor: default;\n}\n.img-crop-modal .img-crop-control button + div:only-of-type {\n flex: 1;\n margin: 0 8px;\n}\n.img-crop-modal .img-crop-control-zoom button {\n font-size: 18px;\n}\n.img-crop-modal .img-crop-control-rotate button {\n font-size: 16px;\n}\n.img-crop-modal .img-crop-control-rotate button:first-of-type {\n transform: rotate(-20deg);\n}\n.img-crop-modal .img-crop-control-rotate button:last-of-type {\n transform: rotate(20deg);\n}\n");const $$=-1===DK(qF,"4.23.0")?{visible:!0}:{open:!0},J$=(0,u.forwardRef)(((e,t)=>{const{aspect:n=1,shape:r="rect",grid:o=!1,quality:i=.4,fillColor:a="white",zoom:l=!0,rotate:c=!1,minZoom:d=1,maxZoom:f=3,modalTitle:h,modalWidth:p,modalOk:m,modalCancel:g,modalMaskTransitionName:v,modalTransitionName:b,modalClassName:y,onModalOk:w,onModalCancel:x,beforeCrop:S,onUploadFail:M,cropperProps:_,children:E}=e,A=(0,u.useRef)({});A.current.onModalOk=w,A.current.onModalCancel=x,A.current.beforeCrop=S,A.current.onUploadFail=M;const[C,k]=(0,u.useState)(""),T=(0,u.useRef)({}),I=(0,u.useRef)(),O=(0,u.useRef)((()=>{})),R=(0,u.useRef)((()=>{})),P=(0,u.useMemo)((()=>{const e=Array.isArray(E)?E[0]:E,t=e.props,{beforeUpload:n,accept:r}=t,o=WF(t,["beforeUpload","accept"]);return I.current=n,Object.assign(Object.assign({},e),{props:Object.assign(Object.assign({},o),{accept:r||"image/*",beforeUpload:(e,t)=>new Promise(((n,r)=>VF(void 0,void 0,void 0,(function*(){if(A.current.beforeCrop){if(!(yield A.current.beforeCrop(e,t)))return r()}T.current=e,O.current=e=>{var t,r;null===(r=(t=A.current).onModalOk)||void 0===r||r.call(t,e),n(e)},R.current=e=>{var t,n;null===(n=(t=A.current).onUploadFail)||void 0===n||n.call(t,e),r()};const o=new FileReader;o.addEventListener("load",(()=>{"string"==typeof o.result&&k(o.result)})),o.readAsDataURL(e)}))))})})}),[E]),N=(0,u.useRef)({}),L=(0,u.useMemo)((()=>{const e={width:p,okText:m,cancelText:g,maskTransitionName:v,transitionName:b};return Object.keys(e).forEach((t=>{const n=t;void 0===e[n]&&delete e[n]})),e}),[g,v,m,b,p]),B=()=>{k(""),N.current.setZoomVal(1),N.current.setRotateVal(0)},D=(0,u.useCallback)((()=>{var e,t;null===(t=(e=A.current).onModalCancel)||void 0===t||t.call(e),B()}),[]),j=(0,u.useCallback)((e=>VF(void 0,void 0,void 0,(function*(){var t;B();const n=document.createElement("canvas"),r=n.getContext("2d"),o=e.target,s=((null===(t=null==o?void 0:o.getRootNode)||void 0===t?void 0:t.call(o))||document).querySelector(`.${W$}-media`),{width:l,height:u,x:d,y:f}=N.current.cropPixelsRef.current;if(c&&0!==N.current.rotateVal){const{naturalWidth:e,naturalHeight:t}=s,o=N.current.rotateVal*(Math.PI/180),i=Math.abs(Math.sin(o)),c=Math.abs(Math.cos(o)),h=e*c+t*i,p=t*c+e*i;n.width=h,n.height=p,r.fillStyle=a,r.fillRect(0,0,h,p);const m=h/2,g=p/2;r.translate(m,g),r.rotate(o),r.translate(-m,-g);const v=(h-e)/2,b=(p-t)/2;r.drawImage(s,0,0,e,t,v,b,e,t);const y=r.getImageData(0,0,h,p);n.width=l,n.height=u,r.putImageData(y,-d,-f)}else n.width=l,n.height=u,r.fillStyle=a,r.fillRect(0,0,l,u),r.drawImage(s,d,f,l,u,0,0,l,u);const{type:h,name:p,uid:m}=T.current;n.toBlob((e=>VF(void 0,void 0,void 0,(function*(){const t=Object.assign(new File([e],p,{type:h}),{uid:m});if(!I.current)return O.current(t);const n=t,r=yield I.current(n,[n]);return!0===r?O.current(t):!1===r?R.current(new Error("beforeUpload return false")):(delete t[BK.LIST_IGNORE],r===BK.LIST_IGNORE?(Object.defineProperty(t,BK.LIST_IGNORE,{value:!0,configurable:!0}),R.current(new Error("beforeUpload return LIST_IGNORE"))):"object"==typeof r&&null!==r?O.current(r):void 0)}))),h,i)}))),[a,i,c]),F=e=>(0,s.jsxs)(s.Fragment,{children:[P,C&&(0,s.jsx)(FV,Object.assign({},$$,{wrapClassName:`${W$}-modal ${y||""}`,title:e,onOk:j,onCancel:D,maskClosable:!1,destroyOnClose:!0},L,{children:(0,s.jsx)(K$,{ref:N,cropperRef:t,image:C,aspect:n,shape:r,grid:o,zoom:l,rotate:c,minZoom:d,maxZoom:f,cropperProps:_})}))]});return h?F(h):(0,s.jsx)(ez,{children:(e,t)=>F("zh-cn"===t?"编辑图片":"Edit image")})}));u=a("85Hg2");var X$=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}));const Q$=["image/jpeg","image/png","image/jpg","image/gif"],Y$=({originNode:e,file:t,tenantID:n,actions:o,resourceType:i})=>{var a,s,l,c;const{t:d}=ea();return r(u).createElement("div",{className:"memori--list-item-wrapper"+("uploading"===t.status?" listItemUploading":"")},r(u).createElement(fp,{spinning:"uploading"===t.status},"error"===t.status?r(u).createElement(Ey,{content:d("media.uploadError")},e.props.children):r(u).createElement(_b,{item:{mediumID:t.uid,mimeType:"uploading"===t.status?"image/png":(null===(a=t.name)||void 0===a?void 0:a.endsWith(".glb"))?"model/gltf-binary":t.type||"image/png",title:null!==(s=t.name)&&void 0!==s?s:"",url:"uploading"===t.status?"":(null===(c=null===(l=t.response)||void 0===l?void 0:l.asset)||void 0===c?void 0:c.assetURL)?t.response.asset.assetURL:Fm({type:i,resourceURI:t.thumbUrl,tenantID:n}),content:`${Fm({resourceURI:t.thumbUrl,type:i})}`},preview:!1})),("success"===t.status||"done"===t.status)&&r(u).createElement("div",{className:"list-item-actions"},r(u).createElement(Zd,{outlined:!0,shape:"circle",icon:r(u).createElement(aj,null),className:"action-button",title:d("edit")||"Edit",onClick:()=>null==o?void 0:o.download(t)}),r(u).createElement(Zd,{outlined:!0,shape:"circle",icon:r(u).createElement(X$,null),className:"action-button",title:d("delete")||"Delete",onClick:()=>null==o?void 0:o.remove(t)})))};var Z$=({uploadMultipleImages:e,maxNumberOfVisualizedUploads:t,uploadUrl:n,tenantID:o,fileList:i,maxFileSizeInMB:a=2,fileResolution:s,useImageCrop:l,uploadMessage:c,imageProportions:d=1,imageProportionsHelper:f,allowedMimeTypes:h,onRemove:p,onFileChanged:m,onUploadFinished:g,onFileNotValid:v,disabled:b,showHelper:y,additionalHelper:w,resourceType:x})=>{var S;const{t:M}=ea(),[_,E]=(0,u.useState)(null!=i?i:[]),[A,C]=(0,u.useState)(),k=r(u).createElement(r(EF),{className:"memori--upload",disabled:null!=b&&b,accept:(null===(S=null!=h?h:Q$)||void 0===S?void 0:S.join(","))+";capture=camera,camcorder",action:n,listType:"picture-card",showUploadList:{showPreviewIcon:!0,showRemoveIcon:!0,showDownloadIcon:!0,downloadIcon:r(u).createElement(aj,{title:M("edit")||"Edit"})},beforeUpload:e=>{if(!(null!=h?h:Q$).find((t=>t===e.type))&&e.type)return console.debug("File not allowed",e,null!=h?h:Q$),Qd.error(M("media.uploadMimeTypeNotAllowed")),v&&v(),Promise.reject(M("media.uploadMimeTypeNotAllowed"));if(!(e.size/1024/1024<(null!=a?a:2)))return Qd.error(M("media.uploadSizeLimitMessage",{size:a})),v&&v(),Promise.reject(M("media.uploadSizeLimitMessage",{size:a}));if(s&&s.length){const t=new FileReader;return t.readAsDataURL(e),new Promise(((n,r)=>{t.addEventListener("load",(t=>{var o,i,a,l=new Image;l.style.padding="0px",l.style.margin="0px",l.onload=()=>{l.width===s[0]&&l.height===s[1]?n(e):(Qd.error(M("media.uploadWrongResolutionMessage",{width:s[0],height:s[1]})),r(),v&&v())},l.src=null!==(a=null===(i=null===(o=t.target)||void 0===o?void 0:o.result)||void 0===i?void 0:i.toString())&&void 0!==a?a:""}))}))}return Promise.resolve(e)},supportServerRender:!0,fileList:_,multiple:e,maxCount:t||(e?100:1),onChange:e=>{E(e.fileList.map((e=>{var t;return{...e,status:null!==(t=e.status)&&void 0!==t?t:"error"}}))),"done"===e.file.status&&g&&g(e.file)},onRemove:p,onDownload:e=>{var t,n;let r=null===(t=e.response)||void 0===t?void 0:t.asset;if(r){let t=r.originalFileName&&e.name.includes(r.originalFileName)?r.originalFileName:e.name;C({...r,title:null!=t?t:r.title})}else C({assetID:e.uid,title:null!==(n=e.name)&&void 0!==n?n:e.fileName})},itemRender:(e,t,n,i)=>r(u).createElement(Y$,{resourceType:x,originNode:e,file:t,fileList:_||n,actions:i,tenantID:o})},c);return r(u).createElement("div",{"aria-live":"polite"},l?r(u).createElement(J$,{rotate:!0,aspect:d,fillColor:"transparent",modalCancel:M("cancel")||"Cancel",modalMaskTransitionName:"none",modalTransitionName:"none"},k):k,r(u).createElement(pp,{open:!!A,title:M("media.editAttributes"),onClose:()=>{C(void 0)},footer:r(u).createElement(r(u).Fragment,null),width:"100%"},r(u).createElement("label",{htmlFor:"media-title-input",className:"media-title-label"},M("media.title")),r(u).createElement("input",{id:"media-title-input",className:"media-title-input",type:"text",name:"title",defaultValue:(null==A?void 0:A.title)||"",onChange:e=>{C({...A,title:e.target.value})}}),r(u).createElement("div",{className:"memori-modal--footer"},r(u).createElement(Zd,{onClick:()=>{C(void 0)}},M("cancel")),r(u).createElement(Zd,{primary:!0,onClick:()=>{m&&(null==A?void 0:A.assetID)&&m(A.assetID,{...A}),E((e=>e.map((e=>{var t,n;return e.uid===(null==A?void 0:A.assetID)||(null===(n=null===(t=e.response)||void 0===t?void 0:t.asset)||void 0===n?void 0:n.assetID)===(null==A?void 0:A.assetID)?{...e,title:null==A?void 0:A.title,name:null==A?void 0:A.title}:e})))),C(void 0)}},M("confirm")))),y&&r(u).createElement("legend",{className:"helper"},r(u).createElement("p",null,M(h?"media.uploadHelper":"media.uploadHelperImages").replace("@size@",(null!=a?a:2).toString())),f&&l&&r(u).createElement("p",null,M("media.scaleRatio"),": ",f),w&&r(u).createElement("p",null,w)))};var eJ=({visible:e,authToken:t,sessionID:n,tenantID:o,uploadAssetURL:i,deleteAsset:a,onCancel:s,onOk:l})=>{const{t:c}=ea(),[d,f]=(0,u.useState)();return r(u).createElement(pp,{open:e,title:c("media.addMediaLabel"),className:"attachment-media-modal",closable:!0,width:"100%",widthMd:"100%",onClose:()=>{s&&s()},footer:r(u).createElement(r(u).Fragment,null,r(u).createElement(Zd,{onClick:s},c("cancel")),r(u).createElement(Zd,{primary:!0,onClick:()=>{d&&l(d),f(void 0)},disabled:!d},c("confirm")))},r(u).createElement(Z$,{tenantID:o,uploadMultipleImages:!1,maxNumberOfVisualizedUploads:1,maxFileSizeInMB:100,uploadUrl:i,useImageCrop:!1,allowedMimeTypes:Qm,fileList:d?[{uid:"-1",name:d.assetID,status:"done",thumbUrl:Fm({resourceURI:d.assetURL,tenantID:o,sessionID:n})}]:[],uploadMessage:c("media.mediaUploadMessage"),imageProportions:1,onUploadFinished:e=>{let t=e.response.asset,n=e.response;0===n.resultCode?f(t):(console.error(n,e),Qd.error(c(gF(n.resultCode))))},onFileChanged:(e,t)=>{f((e=>({...e||{},...t})))},onRemove:async e=>{const n=await a(t,e.thumbUrl);return 0===n.resultCode?f(void 0):(console.error(n,e),Qd.error(c(gF(n.resultCode)))),0===n.resultCode}}))};u=a("85Hg2");var tJ=({visible:e,onCancel:t,onOk:n})=>{var o,i,a;const{t:s}=ea(),[l,c]=(0,u.useState)({url:"",title:""}),d=e=>{if("Enter"===e.key){if(0===(null==l?void 0:l.url.length)||0===(null==l?void 0:l.title.length))return;let e=document.getElementById("save-link-button");e&&e.click()}};return r(u).createElement(pp,{open:e,title:s("media.addLinkLabel"),className:"attachment-link-modal",closable:!0,width:"100%",widthMd:"80%",onClose:()=>{t&&t()},footer:r(u).createElement(r(u).Fragment,null,r(u).createElement(Zd,{onClick:t},s("cancel")),r(u).createElement(Zd,{id:"save-link-button",primary:!0,onClick:()=>{0!==(null==l?void 0:l.url.length)&&0!==(null==l?void 0:l.title.length)&&(n(l),c({url:"",title:""}))},disabled:0===(null==l?void 0:l.url.length)||0===(null==l?void 0:l.title.length)},s("confirm")))},r(u).createElement("div",{className:"attachment-link-modal--row"},r(u).createElement("div",{className:"attachment-link-modal--column"},r(u).createElement("label",{htmlFor:"new-link-url",className:"attachment-link-modal--label"},s("media.linkKey"),":"),r(u).createElement("input",{type:"url",className:"attachment-link-modal--input ",onChange:e=>{let t=e.target.value.startsWith("http")||0===e.target.value.length?e.target.value:`https://${e.target.value}`;c((e=>{var n;return{title:null!==(n=null==e?void 0:e.title)&&void 0!==n?n:"",url:t}}))},placeholder:"https://memori.ai/...",value:null==l?void 0:l.url,name:"url",onKeyDown:d}),r(u).createElement("label",{htmlFor:"new-link-title",className:"attachment-link-modal--label"},s("media.linkValue"),":"),r(u).createElement("input",{type:"text",className:"attachment-link-modal--input ",onChange:e=>c((t=>{var n;return{url:null!==(n=null==t?void 0:t.url)&&void 0!==n?n:"",title:e.target.value}})),value:null==l?void 0:l.title,name:"title",onKeyDown:d})),r(u).createElement("div",{className:"attachment-link-modal--column"},r(u).createElement("div",{className:"attachment-link-modal--centered"},r(u).createElement(qm,{key:null!==(o=null==l?void 0:l.url)&&void 0!==o?o:"",item:{title:null!==(i=null==l?void 0:l.title)&&void 0!==i?i:"",url:null!==(a=null==l?void 0:l.url)&&void 0!==a?a:"",mediumID:"",mimeType:"text/html"},onLinkPreviewInfo:e=>{var t;(null===(t=null==l?void 0:l.title)||void 0===t?void 0:t.length)||c((t=>{var n;return{...t,title:null!==(n=null==e?void 0:e.title)&&void 0!==n?n:""}}))}})))))};window.getMemoriState=e=>{var t,n,r,o,i;let a=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null===(o=null===(r=document.querySelector("memori-client"))||void 0===r?void 0:r.shadowRoot)||void 0===o?void 0:o.querySelector(".memori-widget"));if(!a)return null;let s=null===(i=a.dataset)||void 0===i?void 0:i.memoriEngineState;return s?JSON.parse(s):null},window.typeMessage=e=>{var t,n;let r=document.querySelector("fieldset#chat-fieldset textarea")||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector("fieldset#chat-fieldset textarea"));r&&(!function(e,t){var n,r,o,i;const a=null===(r=null===(n=null==Object?void 0:Object.getOwnPropertyDescriptor)||void 0===n?void 0:n.call(Object,e,"value"))||void 0===r?void 0:r.set,s=Object.getPrototypeOf(e),l=null===(i=null===(o=null==Object?void 0:Object.getOwnPropertyDescriptor)||void 0===o?void 0:o.call(Object,s,"value"))||void 0===i?void 0:i.set;l&&a&&a!==l?l.call(e,t):a&&a.call(e,t)}(r,e),r.dispatchEvent(new Event("input",{bubbles:!0})),setTimeout((()=>{var e,t;let n=document.querySelector("button.memori-chat-inputs--send")||(null===(t=null===(e=document.querySelector("memori-client"))||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("button.memori-chat-inputs--send"));n&&n.click()}),100))};let nJ,rJ,oJ,iJ;var aJ=({memori:e,memoriConfigs:t,memoriLang:n,integration:o,showInstruct:i=!1,showShare:a=!0,preview:s=!1,embed:l=!1,showInputs:c=!0,showDates:d=!1,showContextPerLine:f=!1,showSettings:h=!1,height:p="100vh",secret:m,baseUrl:g="https://app.twincreator.com",apiUrl:v="https://backend.memori.ai",initialContextVars:b,initialQuestion:y,ogImage:w,sessionID:x,tenant:S,personification:M,authToken:_,AZURE_COGNITIVE_SERVICES_TTS_KEY:E,onStateChange:A})=>{var C,k,T,I,O,R,P,N,L,B,D,j,F,z,U,H,G,W;const{t:V,i18n:q}=ea(),[K,$]=(0,u.useState)(!1);(0,u.useEffect)((()=>{$(!0)}),[]);const J=mi(v),{initSession:X,postTextEnteredEvent:Q,postPlaceChangedEvent:Y,postTimeoutEvent:Z,postTagChangedEvent:ee,getSession:te,getContentQualityIndexes:ne}=J,{uploadAsset:re,getUploadAssetURL:oe,deleteAsset:ie}=J.backend,[ae,se]=(0,u.useState)(!1),[le,ce]=(0,u.useState)(!1),[ue,de]=(0,u.useState)(!1),fe=null===(I=null===(T=null===(k=null===(C=null==t?void 0:t.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===C?void 0:C.culture)||void 0===k?void 0:k.split("-"))||void 0===T?void 0:T[0])||void 0===I?void 0:I.toUpperCase(),[he,pe]=(0,u.useState)(null!==(L=null!==(N=null!==(P=null!=n?n:null===(R=null===(O=null==e?void 0:e.culture)||void 0===O?void 0:O.split("-"))||void 0===R?void 0:R[0])&&void 0!==P?P:fe)&&void 0!==N?N:q.language)&&void 0!==L?L:"IT"),me=(null==o?void 0:o.customData)?JSON.parse(o.customData):null,ge=!!(null==me?void 0:me.multilanguage),[ve,be]=(0,u.useState)(!1),[ye,we]=(0,u.useState)(!1),[xe,Se]=(0,u.useState)(!1),[Me,_e]=(0,u.useState)(!1),[Ee,Ae]=(0,u.useState)(!1),[Ce,ke]=(0,u.useState)(!1),[Te,Ie]=(0,u.useState)(!1),[Oe,Re]=(0,u.useState)(!1),[Pe,Ne]=(0,u.useState)(3),[Le,Be]=(0,u.useState)(!1);(0,u.useEffect)((()=>{Be(!!oJ)}),[oJ]),(0,u.useEffect)((()=>{Ie(hF("muteSpeaker",!1)),Re(hF("continuousSpeech",!1)),Ne(hF("continuousSpeechTimeout",3))}),[]);const[De,je]=(0,u.useState)(m),[Fe,ze]=(0,u.useState)(),[Ue,He]=(0,u.useState)(null),[Ge,Ve]=(0,u.useState)(),qe=async(e,t)=>{var n;const r=null!=t?t:nt;if(e&&r){const{currentState:t,...o}=await Y({sessionId:r,placeName:e.placeName,latitude:e.latitude,longitude:e.longitude,uncertaintyKm:null!==(n=e.uncertainty)&&void 0!==n?n:0});t&&0===o.resultCode&&at({...ot,...t})}},[Ke,$e]=(0,u.useState)(""),[Je,Xe]=(0,u.useState)(!1),[Qe,Ye]=(0,u.useState)([]),Ze=e=>{Ye((t=>[...t,{...e}]))},et=async(t,n,r,o=!0,i)=>{var a,s,l,c,u;if(!nt||!(null==t?void 0:t.length))return;Ze({text:t,translatedText:i,fromUser:!0,media:null!=n?n:[],initial:!!r}),we(!0);const d=null!==(c=null!==(l=null===(s=null===(a=e.culture)||void 0===a?void 0:a.split("-"))||void 0===s?void 0:s[0])&&void 0!==l?l:q.language)&&void 0!==c?c:"IT";let f=t;if(o&&!ae&&ge&&he.toUpperCase()!==d.toUpperCase()){f=(await Jm(t,d,he,g)).text}const{currentState:h,...p}=await Q({sessionId:null!=r?r:nt,text:f});if(0===p.resultCode&&h){const t=null!==(u=h.emission)&&void 0!==u?u:null==ot?void 0:ot.emission;if("X4"===h.state&&e.giverTag){const{currentState:t,...n}=await ee(nt,e.giverTag);0===n.resultCode?(at(t),t.emission&&Ze({text:t.emission,media:t.media,fromUser:!1})):(console.error(p,n),Qd.error(V(gF(n.resultCode))))}else if("X2d"===h.state&&e.giverTag){const{currentState:t,...n}=await Q({sessionId:null!=r?r:nt,text:Math.random().toString().substring(2,8)});if(0===n.resultCode){const{currentState:t,...n}=await ee(nt,e.giverTag);0===n.resultCode?(at(t),t.emission&&Ze({text:t.emission,media:t.media,fromUser:!1})):(console.error(p,n),Qd.error(V(gF(n.resultCode))))}else console.error(p,n),Qd.error(V(gF(n.resultCode)))}else he.toLowerCase()!==d.toLowerCase()&&t&&!ae&&ge?tt(h,he):(at({...h,emission:t}),t&&Ze({text:t,media:h.media,fromUser:!1}))}else 404===p.resultCode&&(Ye((e=>[...e.slice(0,e.length-1)])),lt(!1,De||e.secretToken,Fe,ae&&e.giverTag?e.giverTag:void 0,ae&&e.giverPIN?e.giverPIN:void 0,b,y).then((e=>{console.info("session timeout"),e&&setTimeout((()=>{et(t,n,e)}),500)})));we(!1)},tt=async(t,n)=>{var r,o,i,a,s,l;const c=null!==(a=null!==(i=null===(o=null===(r=e.culture)||void 0===r?void 0:r.split("-"))||void 0===o?void 0:o[0])&&void 0!==i?i:q.language)&&void 0!==a?a:"IT",u=null!==(s=t.emission)&&void 0!==s?s:null==ot?void 0:ot.emission;let d={...t},f=null;if(u&&!ae&&c.toUpperCase()!==n.toUpperCase()&&ge){const e=await Jm(u,n,c,g);if(t.hints&&t.hints.length>0){const r=await Promise.all((null!==(l=t.hints)&&void 0!==l?l:[]).map((async e=>{var t;const r=await Jm(e,n,c,g);return{text:null!==(t=null==r?void 0:r.text)&&void 0!==t?t:e,originalText:e}})));d={...t,emission:e.text,translatedHints:r}}else d={...t,emission:e.text};e.text.length>0&&(f={text:e.text,media:t.media,fromUser:!1})}else d={...t,emission:u},u&&(f={text:u,media:t.media,fromUser:!1});return at(d),f&&Ze(f),d},[nt,rt]=(0,u.useState)(x),[ot,it]=(0,u.useState)(),at=e=>{it(e),A&&A(e)},st=async t=>{var n,r,o,i,a;if("PUBLIC"===e.privacyType||e.secretToken||De||Fe){be(!0);try{if(!e.giverTag&&(null===(n=e.receivedInvitations)||void 0===n?void 0:n.length)){let t=e.receivedInvitations.find((e=>"GIVER"===e.type&&"ACCEPTED"===e.state));t&&(e.giverTag=t.tag,e.giverPIN=t.pin)}const s=await X(t);if((null==s?void 0:s.sessionID)&&(null==s?void 0:s.currentState)&&0===s.resultCode){rt(s.sessionID);const t=null!==(a=null!==(i=null===(o=null===(r=e.culture)||void 0===r?void 0:r.split("-"))||void 0===o?void 0:o[0])&&void 0!==i?i:q.language)&&void 0!==a?a:"IT";return!ae&&ge&&he.toLowerCase()!==t.toLowerCase()?tt(s.currentState,he).then((e=>{(null==e?void 0:e.emission)&&(Qe.length<=1?Ye([{text:e.emission,media:e.media,fromUser:!1,initial:!0}]):Ze({text:e.emission,media:e.media,fromUser:!1,initial:!0}))})):(at(s.currentState),s.currentState.emission&&(Qe.length<=1?Ye([{text:s.currentState.emission,media:s.currentState.media,fromUser:!1,initial:!0}]):Ze({text:s.currentState.emission,media:s.currentState.media,fromUser:!1,initial:!0}))),Ge&&qe(Ge,s.sessionID),be(!1),{dialogState:s.currentState,sessionID:s.sessionID}}console.error(s),Qd.error(V(gF(null==s?void 0:s.resultCode))),de(!0)}catch(e){console.error(e),new Error("Error fetching session")}}else He("password")},lt=async(t=!1,n,r,o,i,a,s)=>{var l;be(!0);try{const{sessionID:c,currentState:u,...d}=await X({memoriID:null!==(l=e.engineMemoriID)&&void 0!==l?l:"",password:n,recoveryTokens:r,tag:o,pin:i,initialContextVars:a,initialQuestion:s});if(c&&u&&0===d.resultCode)return rt(c),t&&(at(u),u.emission&&(Qe.length<=1?Ye([{text:u.emission,media:u.media,fromUser:!1}]):Ze({text:u.emission,media:u.media,fromUser:!1}))),Ge&&qe(Ge,c),be(!1),c;console.error(d),Qd.error(V(gF(d.resultCode))),de(!0)}catch(e){console.error(e)}return be(!1),null},ct=async(t,n,r,o)=>{var i;if(!t||!n)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState:t,resultCode:a}=await ee(n,null!=r?r:Ym);if(0===a){let s=0;if(r!==Ym&&o&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await Q({sessionId:n,text:null!=o?o:""});s=e}if(0===s){const{currentState:e,...t}=await te(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(a))console.warn("[APPCONTEXT/CHANGETAG]",a),st({memoriID:null!==(i=e.engineMemoriID)&&void 0!==i?i:"",password:m||e.secretToken,tag:e.giverTag,pin:e.giverPIN,initialContextVars:b,initialQuestion:y});else if(t)return{currentState:t,sessionId:n,resultCode:a}}}catch(e){let t=e;return console.error("[APPCONTEXT/CHANGETAG]",t),Promise.reject(t)}return null};(0,u.useEffect)((()=>()=>{ot&&(null==ot?void 0:ot.currentTag)===e.giverTag||(async()=>{nt&&e.giverTag&&e.giverPIN&&(Ye([]),await ct(e.engineMemoriID,nt,e.giverTag,e.giverPIN))})()}),[]);const[ut,dt]=(0,u.useState)(),ft=(0,u.useRef)(),ht=()=>{ut&&(clearTimeout(ut),dt(void 0)),(null==ft?void 0:ft.current)&&(clearTimeout(ft.current),ft.current=void 0)},pt=()=>{ht(),!(null==ot?void 0:ot.acceptsTimeout)||oJ||Le||Ke.length||Je||gt()},mt=async()=>{if(oJ||Le||Ke.length||Je)pt();else if(nt&&xe&&(null==ot?void 0:ot.acceptsTimeout)){const{currentState:e,...t}=await Z(nt);if(0===t.resultCode&&e){const t=e.emission;!ae&&ge&&he!==(null==q?void 0:q.language)&&t&&t.length>0?tt({...e,emission:t},he):t&&t.length>0&&(Ze({text:t,media:e.media,fromUser:!1}),at(e))}}},gt=()=>{let e=null==ot?void 0:ot.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==ot?void 0:ot.emission){e+=ot.emission.length/26.5}}let t=setTimeout(mt,1e3*e);dt(t),ft.current=t};(0,u.useEffect)((()=>{(Ke.length||Le)&&ht(),nt&&!Ke.length&&pt()}),[null==ot?void 0:ot.acceptsTimeout,null==ot?void 0:ot.timeout,null==ot?void 0:ot.state,Le,nt,Qe,Ke]),(0,u.useEffect)((()=>()=>{Se(!1),ce(!1),ht(),ft.current=void 0}),[]);(0,u.useEffect)((()=>()=>{iJ&&iJ.pause(),oJ&&(oJ.close(),oJ=null)}),[]);const vt=(0,u.useCallback)((t=>{var n,r,o,i;let a="";switch((null!==(i=null!==(o=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==o?o:q.language)&&void 0!==i?i:"IT").toUpperCase()){case"IT":a=""+("MALE"===e.voiceType?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":a=""+("MALE"===e.voiceType?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":a=""+("MALE"===e.voiceType?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":a=""+("MALE"===e.voiceType?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":a=""+("MALE"===e.voiceType?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":a=""+("MALE"===e.voiceType?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":a=""+("MALE"===e.voiceType?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":a=""+("MALE"===e.voiceType?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;default:a=""+("MALE"===e.voiceType?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return a}),[e.voiceType,q.language,e.culture]),yt=t=>{var n,r,o;let i="";switch((null!==(o=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==o||q.language,"IT").toUpperCase()){case"IT":default:i="it-IT";break;case"DE":i="de-DE";break;case"EN":i="en-GB";break;case"ES":i="es-ES";break;case"FR":i="fr-FR";break;case"PT":i="pt-PT";break;case"UK":i="uk-UK";break;case"RU":i="ru-RU"}return i},[wt,xt]=(0,u.useState)();(0,u.useEffect)((()=>{(async()=>{try{const e=await fetch(`${g||"https://app.twincreator.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{xt(e)}))}),[]);const St=(e,t=!0)=>{if(console.log(E,xe,s),!E)return;if(s||!xe)return;if(iJ&&iJ.pause(),oJ&&(oJ.close(),oJ=null),Te&&t)return void setTimeout((()=>{document.dispatchEvent(new Event("endSpeakStartListen"))}),3e3);if(Te)return;iJ=new uo.SpeakerAudioDestination;let n=vo.fromSpeakerOutput(iJ);oJ=new Io.SpeechSynthesizer(rJ,n),iJ.onAudioEnd=()=>{Be(!1),t&&document.dispatchEvent(new Event("endSpeakStartListen"))},Be(!0),console.log("speaking",e),console.log("speechSynthesizer",oJ),console.log("audioDestination",iJ),console.log("speechConfig",rJ),console.log("audioConfig",n),oJ.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${yt(he)}"><voice name="${vt(he)}"><s>${((e,t)=>{var n;if(!wt)return e;const r={...null!==(n=wt.common)&&void 0!==n?n:{},...(null==S?void 0:S.id)&&wt[S.id]?wt[S.id]:{}},o=Object.keys(r).map((e=>{var n;return{word:e,phoneme:null!==(n=r[e][t])&&void 0!==n?n:r[e].default}}));return o.reduce(((e,{word:t,phoneme:n})=>e.replace(new RegExp(t,"gi"),`<phoneme alphabet="ipa" ph="${n}">${t}</phoneme>`)),e)})(e,he.toLowerCase())}</s></voice></speak>`,(t=>{if(t)try{oJ&&(oJ.close(),oJ=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),Be(!1)}else window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),Be(!1)}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),Be(!1)})),Be(!1)};(0,u.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==ot?void 0:ot.emission]);const[Mt,_t]=(0,u.useState)(""),Et=()=>_t(""),[At,Ct]=(0,u.useState)(null),kt=()=>{At&&(clearTimeout(At),Ct(null))},Tt=()=>{kt(),Oe&&(()=>{let e=setTimeout((async()=>{Rt();const e=jm(Mt);e.length>0?(et(e),Et(),$e("")):Je&&pt()}),1e3*Pe);Ct(e)})()};(0,u.useEffect)((()=>{if(Tt(),pt(),(null==Mt?void 0:Mt.length)>0){const e=jm(Mt);e.length>0&&$e(e)}}),[Mt]);const It=()=>{if(console.log("start listening"),E){Rt(),_t("");try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){console.log("is listening"),_e(!0),rJ||(rJ=hn.fromSubscription(E,"eastus"),rJ.speechRecognitionLanguage=yt(he),rJ.speechSynthesisLanguage=yt(he),rJ.speechSynthesisVoiceName=vt(he));const t=vo.fromDefaultMicrophoneInput();nJ=new wo.SpeechRecognizer(rJ,t),Xe(!0),nJ.recognized=(e,t)=>{var n;t.result.reason===bt.RecognizedSpeech?_t(null!==(n=t.result.text)&&void 0!==n?n:""):t.result.reason===bt.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},nJ.canceled=(e,t)=>{t.reason===We.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),Ot()},nJ.sessionStopped=(e,t)=>{nJ&&nJ.stopContinuousRecognitionAsync()},nJ.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},Ot=()=>{nJ&&(nJ.stopContinuousRecognitionAsync(),nJ.close(),nJ=null,Xe(!1))},Rt=()=>{_e(!1),Ot(),kt()};(0,u.useEffect)((()=>()=>Rt()),[]),(0,u.useEffect)((()=>{"Z0"===(null==ot?void 0:ot.state)&&Rt()}),[null==ot?void 0:ot.state]),(0,u.useEffect)((()=>{xe&&!s&&!Te&&Qe.length>0&&(null==ot?void 0:ot.emission)&&St(ot.emission,"Z0"!==ot.state)}),[ot,xe]);const[Pt,Nt]=(0,u.useState)(!1),Lt=(0,u.useCallback)((e=>{Le&&oJ&&(oJ.close(),oJ=null),!Oe||!Me&&Pt||(Nt(!0),It())}),[Oe,Me]);(0,u.useEffect)((()=>{!Le&&Oe&&Me?It():Le&&Je&&Ot()}),[Le]),(0,u.useEffect)((()=>(document.addEventListener("endSpeakStartListen",Lt),()=>{document.removeEventListener("endSpeakStartListen",Lt)})),[Lt]),(0,u.useEffect)((()=>{Je&&(Rt(),Et(),$e(""),It())}),[fe]);const[Bt,Dt]=(0,u.useState)("keypress");(0,u.useEffect)((()=>{const e=hF("sendOnEnter","keypress");Dt(e)}),[]),(0,u.useEffect)((()=>{pF("sendOnEnter",Bt)}),[Bt]);const[jt,Ft]=(0,u.useState)(),zt=null==me?void 0:me.globalBackground,Ut=zt?`url(${zt})`:null,Ht=o?{"--memori-chat-bubble-bg":"#fff",...me&&!i?{"--memori-text-color":null!==(B=me.textColor)&&void 0!==B?B:"#000"}:{},...(null==me?void 0:me.buttonBgColor)?{"--memori-button-bg":me.buttonBgColor,"--memori-primary":me.buttonBgColor}:{},...(null==me?void 0:me.buttonTextColor)?{"--memori-button-text":me.buttonTextColor}:{},...(null==me?void 0:me.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==me?void 0:me.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===me.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(D=me.innerBgAlpha)&&void 0!==D?D:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===me.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(j=null==me?void 0:me.innerBgAlpha)&&void 0!==j?j:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},Gt=`\n ${s?"#preview":":root"}, .memori-widget {\n ${Object.entries(Ht).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,[Wt,Vt]=(0,u.useState)(!0),[qt,Kt]=(0,u.useState)();(0,u.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:o,unansweredQuestions:i,...a}=await ne(e);0===a.resultCode&&(t=r,n=i)}catch(e){let t=e;console.error("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",t)}return{points:null!=t?t:0,unansweredQuestions:null!=n?n:0}})(e.engineMemoriID).then((e=>{Kt(_F(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,u.useEffect)((()=>{if(null==me?void 0:me.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",me.seoTitle),document.head.append(e)}if(null==me?void 0:me.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",me.seoDescription),document.head.append(e)}if(null==me?void 0:me.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",me.seoUrl),document.head.append(e)}let t=w||e.avatarURL;if((null==me?void 0:me.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[me,e.avatarURL,w]);const $t=async t=>{const n=(null==t?void 0:t.sessionID)||nt,r=(null==t?void 0:t.dialogState)||ot;if(ce(!0),console.log("onClickStart"),!n&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!De&&!Fe||!n&&ue)return He("password"),void ce(!1);if(n)if(x){const{currentState:t,...r}=await te(n);if(0!==r.resultCode||!t)return console.debug("session expired, opening new session"),de(!0),rt(void 0),ce(!1),void $t();if(Ye([]),ae&&e.giverTag&&(null==ot?void 0:ot.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await ct(e.engineMemoriID,n,"-");const t=await ct(e.engineMemoriID,n,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");tt(t.currentState,he).finally((()=>{Se(!0)}))}catch(t){console.error("session #2",t),lt(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,b,y).then((()=>{Se(!0)}))}else if(!ae&&M&&(null==ot?void 0:ot.currentTag)!==M.tag)try{console.debug("change tag #3"),await ct(e.engineMemoriID,n,"-");const t=await ct(e.engineMemoriID,n,M.tag,M.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");tt(t.currentState,he).finally((()=>{Se(!0)}))}catch(t){console.error("session #5",t),lt(!0,null==e?void 0:e.secretToken,void 0,M.tag,M.pin,b,y).then((()=>{Se(!0)}))}else if(ae||M||(null==ot?void 0:ot.currentTag)===Ym)tt(t,he).finally((()=>{Se(!0)}));else try{console.debug("change tag #6"),await ct(e.engineMemoriID,n,"-");const t=await ct(e.engineMemoriID,n,Ym);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");tt(t.currentState,he).finally((()=>{Se(!0)}))}catch(t){console.error("session #8",t),lt(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,b,y).then((()=>{Se(!0)}))}}else Ye([]),tt(r,he).finally((()=>{Se(!0)}));else{ce(!1),de(!1);const t=await st({memoriID:e.engineMemoriID,password:m||e.secretToken,tag:null==M?void 0:M.tag,pin:null==M?void 0:M.pin,initialContextVars:b,initialQuestion:y});$t(t||void 0)}},[Jt,Xt]=(0,u.useState)(_);(0,u.useEffect)((()=>{const t=document.querySelector(`memori-client[memoriname="${e.name}"]`)||document.querySelector(`memori-client[memoriid="${e.memoriID}"]`)||document.querySelector("memori-client");if(!t)return;const n=new MutationObserver(((e,t)=>{var n,r,o;for(const t of e)"attributes"===t.type&&"authtoken"===(null===(n=t.attributeName)||void 0===n?void 0:n.toLowerCase())&&(console.log("FUCK",t),"MEMORI-CLIENT"===t.target.nodeName?Xt(t.target.getAttribute("authtoken")||void 0):Xt((null===(o=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===o?void 0:o.getAttribute("authtoken"))||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const Qt=r(u).createElement(uF,{memori:e,history:Qe,showShare:a,position:Ge,setShowPositionDrawer:Ae,setShowSettingsDrawer:ke,speakerMuted:Te,setSpeakerMuted:Ie,showSettings:h,hasUserActivatedSpeak:xe}),Zt=r(u).createElement(sj,{memori:e,integration:o,integrationConfig:me,tenant:S,instruct:ae,avatar3dVisible:Wt,setAvatar3dVisible:Vt,hasUserActivatedSpeak:xe,isPlayingAudio:Le,baseUrl:g}),en=r(u).createElement(Ty,{memori:e,tenant:S,gamificationLevel:qt,language:fe,userLang:he,setUserLang:pe,baseUrl:g,position:Ge,openPositionDrawer:()=>Ae(!0),integrationConfig:me,instruct:ae,sessionId:nt,clickedStart:le,onClickStart:$t,initializeTTS:()=>{if(!E)return;rJ=hn.fromSubscription(E,"eastus"),rJ.speechSynthesisLanguage=yt(he),rJ.speechSynthesisVoiceName=vt(he),rJ.speechRecognitionLanguage=yt(he),Dm()&&(rJ.speechSynthesisOutputFormat=Yt.Audio16Khz32KBitRateMonoMp3);let e=document.getElementById("memori-audio");e&&window.navigator.userAgent.includes("Safari")&&(e.muted=!1,e.play().then((()=>{console.log("played intro audio");try{const e=new Ad;let t=e.createBuffer(1,1,22050),n=e.createBufferSource();n.buffer=t,n.connect(e.destination)}catch(e){console.error(e)}})).catch((e=>{console.error("error playing intro audio",e)})))}}),tn=nt?r(u).createElement(_y,{memori:e,sessionID:nt,tenant:S,translateTo:ge&&he.toUpperCase()!==(null===(G=null!==(H=null!==(U=null===(z=null===(F=e.culture)||void 0===F?void 0:F.split("-"))||void 0===z?void 0:z[0])&&void 0!==U?U:q.language)&&void 0!==H?H:"IT")||void 0===G?void 0:G.toUpperCase())?he:void 0,baseUrl:g,memoriTyping:ye,history:Qe,authToken:Jt,dialogState:ot,setDialogState:at,pushMessage:Ze,simulateUserPrompt:(e,t)=>{Ot(),et(e,void 0,void 0,!1,t)},showDates:d,showContextPerLine:f,client:J,selectReceiverTag:async t=>{var n;if(nt)try{const{currentState:r,...o}=await ee(nt,t);if(0===o.resultCode)if(Ze({text:t,fromUser:!0}),"X4"===r.state&&e.giverTag){const{currentState:t,...n}=await J.postTagChangedEvent(nt,e.giverTag);0===n.resultCode?(at(t),t.emission&&Ze({text:t.emission,media:t.media,fromUser:!1})):(console.error(n),Qd.error(V(gF(n.resultCode))))}else at(r),r.emission&&Ze({text:r.emission,media:r.media,fromUser:!1});else console.error(o,t,null===(n=null==ot?void 0:ot.knownTags)||void 0===n?void 0:n[t]),Qd.error(V(gF(o.resultCode)))}catch(e){let t=e;console.error(t),Qd.error(t.message)}},preview:s,sendOnEnter:Bt,setSendOnEnter:Dt,attachmentsMenuOpen:jt,setAttachmentsMenuOpen:Ft,instruct:ae,showInputs:c,showMicrophone:!!E,userMessage:Ke,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return $e(""),void pt();$e(e),ht()},sendMessage:e=>{Ot(),et(e),$e(""),Et()},stopListening:Rt,startListening:It,stopAudio:()=>{oJ&&(oJ.close(),oJ=null)},resetTranscript:Et,listening:Je,isPlayingAudio:Le}):null,nn=o&&Ut?r(u).createElement("div",{className:"memori--global-background"},r(u).createElement("div",{className:"memori--global-background-image",style:{backgroundImage:Ut}})):null,rn=o?r(u).createElement("style",{dangerouslySetInnerHTML:{__html:Gt}}):null,on=r(u).createElement(lj,{canInstruct:!!e.giverTag,instruct:ae,onChangeMode:e=>{se("instruct"===e),Se(!1),ce(!1)}});return r(u).createElement("div",{className:r(Xd)("memori","memori-widget",{"memori--preview":s,"memori--embed":l,"memori--with-integration":o,"memori--active":xe}),"data-memori-name":null==e?void 0:e.name,"data-memori-id":null==e?void 0:e.engineMemoriID,"data-memori-secondary-id":null==e?void 0:e.memoriID,"data-memori-session-id":nt,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...ot,sessionID:nt}),style:{height:p}},r(u).createElement(dF,{header:Qt,avatar:Zt,chat:tn,startPanel:en,integrationStyle:rn,integrationBackground:nn,changeMode:on,sessionId:nt,hasUserActivatedSpeak:xe,showInstruct:i,loading:ve}),r(u).createElement("audio",{id:"memori-audio",style:{display:"none"},src:"https://app.twincreator.com/intro.mp3"}),K&&r(u).createElement(Bm,{withModal:!0,pwdOrTokens:Ue,openModal:!!Ue,setPwdOrTokens:He,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{t.password&&je(t.password),t.tokens&&ze(t.tokens),lt(!nt,t.password,t.tokens,ae?e.giverTag:void 0,ae?e.giverPIN:void 0,b,y).then((()=>{He(null),Se(!0)})).catch((()=>{He(null),de(!0)}))},minimumNumberOfRecoveryTokens:null!==(W=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==W?W:1}),nt&&r(u).createElement(tJ,{visible:"link"===jt,onCancel:()=>Ft(void 0),onOk:async e=>{if(!nt)return;let t={mediumID:"",mimeType:"text/html",url:e.url,title:e.title};Ze({text:V("media.insertThisLink",{url:t.url,title:t.title}),fromUser:!0,media:[t]});try{const{currentState:e,...n}=await J.postMediumSelectedEvent(nt,t);e&&0===n.resultCode?(at(e),e.emission&&Ze({text:e.emission,media:e.media,fromUser:!1})):(console.error(n,e,t),Qd.error(V(gF(n.resultCode),{ns:"common"})))}catch(e){let t=e;console.error(t),Qd.error(t.message)}Ft(void 0)}}),Jt&&nt&&(null==S?void 0:S.id)&&r(u).createElement(eJ,{visible:"media"===jt,authToken:Jt,tenantID:null==S?void 0:S.id,sessionID:nt,uploadAssetURL:J.backend.getUploadAssetURL(Jt,e.memoriID),deleteAsset:J.backend.deleteAsset,onCancel:()=>Ft(void 0),onOk:async e=>{if(!nt)return;let t={mediumID:"",mimeType:e.mimeType,url:e.assetURL,title:e.title||e.assetID};Ze({text:V("media.insertThisMediaMsg"),fromUser:!0,media:[t]});try{const{currentState:e,...n}=await J.postMediumSelectedEvent(nt,t);e&&0===n.resultCode?(at(e),e.emission&&Ze({text:e.emission,media:e.media,fromUser:!1})):(console.error(n,e,t),Qd.error(V(gF(n.resultCode),{ns:"common"})))}catch(e){let t=e;console.error(t),Qd.error(t.message)}Ft(void 0)}}))};function sJ(e){return sJ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sJ(e)}function lJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cJ(e,t){if("object"!==sJ(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==sJ(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function uJ(e){var t=cJ(e,"string");return"symbol"===sJ(t)?t:String(t)}function dJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,uJ(r.key),r)}}function fJ(e,t,n){return t&&dJ(e.prototype,t),n&&dJ(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hJ(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pJ(e,t){return pJ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pJ(e,t)}function mJ(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pJ(e,t)}function gJ(e,t){if(t&&("object"===sJ(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return hJ(e)}function vJ(e){return vJ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vJ(e)}function bJ(e,t,n){return(t=uJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yJ(e){if(Array.isArray(e))return e}function wJ(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function xJ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function SJ(e,t){if(e){if("string"==typeof e)return xJ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xJ(e,t):void 0}}function MJ(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _J(e){return yJ(e)||wJ(e)||SJ(e)||MJ()}function EJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function AJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EJ(Object(n),!0).forEach((function(t){bJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var CJ={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},kJ=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};lJ(this,e),this.init(t,n)}return fJ(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||CJ,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,AJ(AJ({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),TJ=new kJ,IJ=function(){function e(){lJ(this,e),this.observers={}}return fJ(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var o=[].concat(this.observers[e]);o.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var i=[].concat(this.observers["*"]);i.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function OJ(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function RJ(e){return null==e?"":""+e}function PJ(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function NJ(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function LJ(e,t,n){var r=NJ(e,t,Object);r.obj[r.k]=n}function BJ(e,t){var n=NJ(e,t),r=n.obj,o=n.k;if(r)return r[o]}function DJ(e,t,n){var r=BJ(e,n);return void 0!==r?r:BJ(t,n)}function jJ(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):jJ(e[r],t[r],n):e[r]=t[r]);return e}function FJ(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var zJ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function UJ(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return zJ[e]})):e}var HJ="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,GJ=[" ",",","?","!",";"];function WJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function VJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?WJ(Object(n),!0).forEach((function(t){bJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qJ(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=vJ(e);if(t){var o=vJ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return gJ(this,n)}}function KJ(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;++i){if(!o)return;if("string"==typeof o[r[i]]&&i+1<r.length)return;if(void 0===o[r[i]]){for(var a=2,s=r.slice(i,i+a).join(n),l=o[s];void 0===l&&r.length>i+a;)a++,l=o[s=r.slice(i,i+a).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(s)){if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s]}var c=r.slice(i+a).join(n);return c?KJ(l,c,n):void 0}o=o[r[i]]}return o}}var $J=function(e){mJ(n,e);var t=qJ(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return lJ(this,n),r=t.call(this),HJ&&IJ.call(hJ(r)),r.data=e||{},r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return fJ(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=BJ(this.data,a);return s||!i||"string"!=typeof n?s:KJ(this.data&&this.data[e]&&this.data[e][t],n,o)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),LJ(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=BJ(this.data,a)||{};r?jJ(s,n,o):s=VJ(VJ({},s),n),LJ(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?VJ(VJ({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(IJ),JJ={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}};function XJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function QJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XJ(Object(n),!0).forEach((function(t){bJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function YJ(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=vJ(e);if(t){var o=vJ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return gJ(this,n)}}var ZJ={},eX=function(e){mJ(n,e);var t=YJ(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return lJ(this,n),r=t.call(this),HJ&&IJ.call(hJ(r)),PJ(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,hJ(r)),r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=TJ.create("translator"),r}return fJ(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=GJ.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}(e,n,r));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:o};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(o=l.shift()),e=l.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,t,r){var o=this;if("object"!==sJ(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,c=s.namespaces,u=c[c.length-1],d=t.lng||this.language,f=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(f){var h=t.nsSeparator||this.options.nsSeparator;return i?(p.res="".concat(u).concat(h).concat(l),p):"".concat(u).concat(h).concat(l)}return i?(p.res=l,p):l}var p=this.resolve(e,t),m=p&&p.res,g=p&&p.usedKey||l,v=p&&p.exactUsedKey||l,b=Object.prototype.toString.apply(m),y=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,S="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&S&&y.indexOf(b)<0&&("string"!=typeof w||"[object Array]"!==b)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,QJ(QJ({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return i?(p.res=M,p):M}if(a){var _="[object Array]"===b,E=_?[]:{},A=_?v:g;for(var C in m)if(Object.prototype.hasOwnProperty.call(m,C)){var k="".concat(A).concat(a).concat(C);E[C]=this.translate(k,QJ(QJ({},t),{joinArrays:!1,ns:c})),E[C]===k&&(E[C]=m[C])}m=E}}else if(x&&"string"==typeof w&&"[object Array]"===b)(m=m.join(w))&&(m=this.extendTranslation(m,e,t,r));else{var T=!1,I=!1,O=void 0!==t.count&&"string"!=typeof t.count,R=n.hasDefaultValue(t),P=O?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(P)]||t.defaultValue;!this.isValidLookup(m)&&R&&(T=!0,m=N),this.isValidLookup(m)||(I=!0,m=l);var L=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,B=L&&I?void 0:m,D=R&&N!==m&&this.options.updateMissing;if(I||T||D){if(this.logger.log(D?"updateKey":"missingKey",d,u,l,D?N:m),a){var j=this.resolve(l,QJ(QJ({},t),{},{keySeparator:!1}));j&&j.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&z&&z[0])for(var U=0;U<z.length;U++)F.push(z[U]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var i=R&&r!==m?r:B;o.options.missingKeyHandler?o.options.missingKeyHandler(e,u,n,i,D,t):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(e,u,n,i,D,t),o.emit("missingKey",e,u,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?F.forEach((function(e){o.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,p,r),I&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(I||T)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,T?m:void 0):this.options.parseMissingKeyHandler(m))}return i?(p.res=m,p):m}},{key:"extendTranslation",value:function(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,QJ(QJ({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(QJ(QJ({},n),{interpolation:QJ(QJ({},this.options.interpolation),n.interpolation)}));var a,s="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var l=e.match(this.interpolator.nestingRegexp);a=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=QJ(QJ({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),s){var u=e.match(this.interpolator.nestingRegexp);a<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):i.translate.apply(i,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,f="string"==typeof d?[d]:d;return null!=e&&f&&f.length&&!1!==n.applyPostProcessor&&(e=JJ.handle(f,e,t,this.options&&this.options.postProcessPassResolved?QJ({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,o,i,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),c=l.key;n=c;var u=l.namespaces;a.options.fallbackNS&&(u=u.concat(a.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,f=d&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),h=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);u.forEach((function(e){a.isValidLookup(t)||(i=e,!ZJ["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(ZJ["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,l=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,c,n,e,s);else{var u;d&&(u=a.pluralResolver.getSuffix(n,s.count,s));var p="".concat(a.options.pluralSeparator,"zero");if(d&&(l.push(c+u),f&&l.push(c+p)),h){var m="".concat(c).concat(a.options.contextSeparator).concat(s.context);l.push(m),d&&(l.push(m+u),f&&l.push(m+p))}}for(;i=l.pop();)a.isValidLookup(t)||(r=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(IJ);function tX(e){return e.charAt(0).toUpperCase()+e.slice(1)}var nX=function(){function e(t){lJ(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=TJ.create("languageUtils")}return fJ(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=tX(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=tX(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=tX(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),rX=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],oX={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},iX=["v1","v2","v3"],aX={zero:0,one:1,two:2,few:3,many:4,other:5};function sX(){var e={};return rX.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:oX[t.fc]}}))})),e}var lX=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};lJ(this,e),this.languageUtils=t,this.options=n,this.logger=TJ.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=sX()}return fJ(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return aX[e]-aX[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),o=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!iX.includes(this.options.compatibilityJSON)}}]),e}();function cX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cX(Object(n),!0).forEach((function(t){bJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var dX=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};lJ(this,e),this.logger=TJ.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return fJ(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:UJ,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?FJ(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?FJ(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?FJ(t.nestingPrefix):t.nestingPrefixEscaped||FJ("$t("),this.nestingSuffix=t.nestingSuffix?FJ(t.nestingSuffix):t.nestingSuffixEscaped||FJ(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(s.formatSeparator)<0){var o=DJ(t,l,e);return s.alwaysFormat?s.format(o,void 0,n,uX(uX(uX({},r),t),{},{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),c=i.join(s.formatSeparator).trim();return s.format(DJ(t,l,a),c,n,uX(uX(uX({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach((function(t){for(a=0;o=t.regex.exec(e);){var n=o[1].trim();if(void 0===(i=u(n)))if("function"==typeof d){var l=d(e,o,r);i="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))i="";else{if(f){i=o[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=RJ(i));var c=t.safeValue(i);if(e=e.replace(o[0],c),f?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=uX({},i);function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);e=r[0];var i=(o=this.interpolate(o,a)).match(/'/g),s=o.match(/"/g);(i&&i.length%2==0&&!s||s.length%2!=0)&&(o=o.replace(/'/g,'"'));try{a=JSON.parse(o),t&&(a=uX(uX({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(o)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=RJ(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return o.format(e,t,i.lng,uX(uX({},i),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function fX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fX(Object(n),!0).forEach((function(t){bJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pX(e){var t={};return function(n,r,o){var i=r+JSON.stringify(o),a=t[i];return a||(a=e(r,o),t[i]=a),a(n)}}var mX=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};lJ(this,e),this.logger=TJ.create("formatter"),this.options=t,this.formats={number:pX((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:pX((function(e,t){var n=new Intl.NumberFormat(e,hX(hX({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:pX((function(e,t){var n=new Intl.DateTimeFormat(e,hX({},t));return function(e){return n.format(e)}})),relativetime:pX((function(e,t){var n=new Intl.RelativeTimeFormat(e,hX({},t));return function(e){return n.format(e,t.range||"day")}})),list:pX((function(e,t){var n=new Intl.ListFormat(e,hX({},t));return function(e){return n.format(e)}}))},this.init(t)}return fJ(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=pX(t)}},{key:"format",value:function(e,t,n,r){var o=this,i=t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=_J(e.split(":")),r=t[0],o=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,s=i.formatOptions;if(o.formats[a]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=o.formats[a](e,u,hX(hX(hX({},s),r),c))}catch(e){o.logger.warn(e)}return l}return o.logger.warn("there was no format function for ".concat(a)),e}),e);return i}}]),e}();function gX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gX(Object(n),!0).forEach((function(t){bJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bX(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=vJ(e);if(t){var o=vJ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return gJ(this,n)}}var yX=function(e){mJ(n,e);var t=bX(n);function n(e,r,o){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return lJ(this,n),i=t.call(this),HJ&&IJ.call(hJ(i)),i.backend=e,i.store=r,i.services=o,i.languageUtils=o.languageUtils,i.options=a,i.logger=TJ.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,a.backend,a),i}return fJ(n,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i={},a={},s={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?void 0===a[s]&&(a[s]=!0):(o.state[s]=1,r=!1,void 0===a[s]&&(a[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){var r,s,l,c,u,d;r=n.loaded,s=i,c=NJ(r,[o],Object),u=c.obj,d=c.k,u[d]=u[d]||[],l&&(u[d]=u[d].concat(s)),l||u[d].push(s),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:i,callback:a}):(this.readingCalls++,this.backend[n](e,t,(function(s,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}s&&l&&o<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,o+1,2*i,a)}),i):a(s,l)}))):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,vX(vX({},i),{},{isUpdate:o})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(IJ);function wX(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===sJ(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===sJ(e[2])||"object"===sJ(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function xX(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function SX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function MX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?SX(Object(n),!0).forEach((function(t){bJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _X(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=vJ(e);if(t){var o=vJ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return gJ(this,n)}}function EX(){}function AX(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var CX=function(e){mJ(n,e);var t=_X(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(lJ(this,n),e=t.call(this),HJ&&IJ.call(hJ(e)),e.options=xX(r),e.services={},e.logger=TJ,e.modules={external:[]},AX(hJ(e)),o&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,o),gJ(e,hJ(e));setTimeout((function(){e.init(r,o)}),0)}return e}return fJ(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=wX();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options=MX(MX(MX({},r),this.options),xX(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=MX(MX({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?TJ.init(o(this.modules.logger),this.options):TJ.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=mX);var a=new nX(this.options);this.store=new $J(this.options.resources,this.options);var s=this.services;s.logger=TJ,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new lX(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=o(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new dX(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new yX(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(s.languageDetector=o(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=o(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new eX(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=EX),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=OJ(),f=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:EX,r=n,o="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return r();var i=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};if(o)a(o);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(i,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=OJ();return e||(e=this.languages),t||(t=this.options.ns),n||(n=EX),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&JJ.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=OJ();this.emit("languageChanging",e);var o=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,o=function e(t,o){var i;if("object"!==sJ(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l<a;l++)s[l-2]=arguments[l];i=r.options.overloadTranslationOptionHandler([t,o].concat(s))}else i=MX({},o);i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns,i.keyPrefix=i.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",u=i.keyPrefix?"".concat(i.keyPrefix).concat(c).concat(t):t;return r.t(u,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=OJ();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=OJ();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:EX,o=MX(MX(MX({},this.options),t),{isClone:!0}),i=new n(o);void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t));var a=["store","services","language"];return a.forEach((function(t){i[t]=e[t]})),i.services=MX({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new eX(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i.emit.apply(i,[e].concat(n))})),i.init(o,r),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(IJ);bJ(CX,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new CX(e,t)}));var kX=CX.createInstance();kX.createInstance=CX.createInstance;kX.createInstance,kX.init,kX.loadResources,kX.reloadResources,kX.use,kX.changeLanguage,kX.getFixedT,kX.t,kX.exists,kX.setDefaultNamespace,kX.hasLoadedNamespace,kX.loadNamespaces,kX.loadLanguages;var TX,IX=kX;TX=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","close":"Chiudi","edit":"Modifica","delete":"Elimina","loading":"Caricamento","copy":"Copia","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Memori bloccato fino al {{date}}","memoriBlockedAnon":"Attualmente \\"{{name}}\\" non può rispondere, torna qui il {{date}}","memoriBlockedReasonExceedChats":"perchè ha superato la soglia mensile di chat ammesse.","memoriBlockedGiverHelper":"Puoi sempre gestirlo in qualità di amministratore, ma altri utenti non potranno interrogarlo.","auth":{"useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","position":"Posizione","settings":"Impostazioni","share":"Condividi","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca sul bottone di invio","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica"},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per parlare con me clicca sul pulsante INIZIAMO per cominciare","instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","chatHistory":"Cronologia chat","exportChatHistory":"Esporta la cronologia chat","exportChatHistoryMessage":"Vuoi esportare la cronologia chat?","chatBotButtonText":"CLICCA QUI PER APRIRE LA CHAT","conversationStartedLabel":"Conversazione avvenuta il","settingsHeaderLabel":"Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","secondsLabel":"Secondi","tryMeHeaderLabel":"PROVA","unknownPosition":"Posizione sconosciuta","fieldPlace":"Indica la posizione (es \'Milano\')","showMapLinkFor":"Visualizza sulla mappa la posizione","useMyPosition":"Usa la mia posizione","myPosition":"Posizione corrente","updatingPosition":"Aggiorno la posizione...","placeNotFound":"Luogo sconosciuto!","requirePosition":"Inserisci la posizione prima di iniziare","attachmentsLabel":"Arricchisci il tuo messaggio","iWantToTalkToIn":"Voglio parlare con {{name}} in"},"media":{"title":"Titolo","editAttributes":"Modifica attributi media","uploadMimeTypeNotAllowed":"Il tipo di file non è permesso","uploadSizeLimitMessage":"Il file caricato è troppo grande (max {{size}}MB)","uploadWrongResolutionMessage":"La risoluzione deve essere {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"Hai già un Twin con questo nome","uploadHelperImages":"Caricare un file con estensione png, jpg, jpeg o gif e con dimensione massima di {{size}}MB","uploadHelper":"Caricare un file di dimensione massima di {{size}}MB","uploadError":"Errore nel caricamento","square":"quadrato","scaleRatio":"Proporzioni","addMediaLabel":"Aggiungi media","insertThisMediaMsg":"Inserisci questi media","mediaUploadMessage":"Clicca per caricare un nuovo media","addLinkLabel":"Aggiungi un link","linkKey":"URL","linkValue":"Titolo link","insertThisLink":"Inserisci un link a {{url}} con titolo {{title}}"},"gamification":{"level":"Livello","points":"punti","memoriReachedLevel":"è diventato più evoluto ed ha raggiunto il livello","levelGoToStatistics":"{{memori}} è al livello {{level}} con {{points}} punti. Clicca per andare alle statistiche.","congratulationsNewLevel":"Congratulazioni, hai raggiunto un nuovo livello!","congratulationsNewLevelDescription":"Il tuo Memori è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_CANT_EDIT_INTEGRATIONS":"Utente non abilitato a gestire integrazioni","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","INTEGRATION_NOT_FOUND":"Integrazione non trovata","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido"}}');const OX={en:{translation:r(JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","close":"Close","edit":"Edit","delete":"Delete","loading":"Loading","copy":"Copy","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Memori blocked until {{date}}","memoriBlockedAnon":"Currently \\"{{name}}\\" can\'t answer, come back here on {{date}}","memoriBlockedReasonExceedChats":"because it has exceeded the monthly threshold of allowed chats.","memoriBlockedGiverHelper":"You can still manage it as administrator, but other users will not be able to interact with it.","auth":{"useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Sound","position":"Position","settings":"Settings","share":"Share","sendOnKeypress":"Hit Enter to send","sendOnClick":"Click on Submit","goToIntegrationsToCustomizeAvatar":"To customize the avatar, go to Share and customize the public page"},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To talk to me click on the START button to get started","instructButton":"INSTRUCT ME","tryMeButton":"START","chatHistory":"Chat history","exportChatHistory":"Export chat history","exportChatHistoryMessage":"Do you want to export chat history?","chatBotButtonText":"CLICK HERE TO OPEN CHATBOT","conversationStartedLabel":"Conversation started on","settingsHeaderLabel":"Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","secondsLabel":"Set seconds","tryMeHeaderLabel":"TRY","unknownPosition":"Unknown position","fieldPlace":"Write the place (eg \'Milano\')","showMapLinkFor":"Show the position on the map","useMyPosition":"Use my position","myPosition":"Your position","updatingPosition":"Updating position...","placeNotFound":"Place not found!","requirePosition":"Insert your position before start","attachmentsLabel":"Enrich your message","iWantToTalkToIn":"I want to talk to {{name}} in"},"media":{"title":"Title","editAttributes":"Edit media attributes","uploadMimeTypeNotAllowed":"The file type is not allowed","uploadSizeLimitMessage":"The uploaded size is too big (max {{size}}MB)","uploadWrongResolutionMessage":"The resolution must be {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"You already have a Twin with this name","uploadHelperImages":"Upload a file with extension png, jpg, jpeg or gif, and having at maximum a size of {{size}}MB","uploadHelper":"Upload a file having at maximum a size of {{size}}MB","uploadError":"Upload failed","square":"square","scaleRatio":"Scale ratio","addMediaLabel":"Add a media","insertThisMediaMsg":"Insert these media","mediaUploadMessage":"Click to load a new media","addLinkLabel":"Add a link","linkKey":"URL","linkValue":"Link title","insertThisLink":"Insert a link to {{url}} with title {{title}}"},"gamification":{"level":"Level","points":"points","memoriReachedLevel":"became more evolved and reached level","levelGoToStatistics":"{{memori}} is at level {{level}} with {{points}} points. Click to go to statistics.","congratulationsNewLevel":"Congratulations, you have reached a new level!","congratulationsNewLevelDescription":"Your Memori became more evolved with {{points}} points, look at the","statistics":"statistics"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_CANT_EDIT_INTEGRATIONS":"User not allowed to manage integrations","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID"}}'))},it:{translation:r(TX)}};IX.use(Gi).init({resources:OX,lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});var RX=IX;const PX=({ownerUserName:e,ownerUserID:t,memoriName:n,memoriID:o,integrationID:i,tenantID:a,secretToken:s,sessionID:l,showShare:c=!0,showSettings:d=!1,showInstruct:f=!1,height:h="100%",baseURL:p,apiURL:m="https://backend.memori.ai",tag:g,pin:v,context:b,initialQuestion:y,uiLang:w,spokenLang:x,authToken:S,AZURE_COGNITIVE_SERVICES_TTS_KEY:M,onStateChange:_})=>{var E,A,C;const[k,T]=(0,u.useState)(),{t:I}=ea();if(!(o&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const O=mi(m),R=(0,u.useCallback)((async()=>{if(o&&t){const{memori:e,...n}=await O.backend.getMemoriByUserAndId(a,t,o);0===n.resultCode&&e?T(e):console.error("[MEMORI]",n,e)}else if(n&&e){const{memori:t,...r}=await O.backend.getMemori(a,e,n);0===r.resultCode&&t?T(t):console.error("[MEMORI]",r,t)}}),[o,t,n,e,a]);return(0,u.useEffect)((()=>{R()}),[R,a]),(0,u.useEffect)((()=>{if(w)RX.changeLanguage(w.toLowerCase());else{const{lng:e,fallbackLng:t}=(()=>{const e=navigator.language;if(e){let t=e.split("-")[0];if(["en","it"].includes(t))return{lng:t,fallbackLng:"en"===t?"it":"en"}}return{lng:"en",fallbackLng:"it"}})();RX.changeLanguage(e).catch((()=>{RX.changeLanguage(t)}))}}),[w]),k?r(u).createElement(aJ,{height:h,baseUrl:p||(a.startsWith("https://")?a:`https://${a}`),apiUrl:m,memori:{...k,secretToken:s},memoriLang:null!=x?x:null===(A=null===(E=k.culture)||void 0===E?void 0:E.split("-"))||void 0===A?void 0:A[0],tenant:{id:a,theme:"twincreator",config:{name:a,showNewUser:!1,requirePosition:!!k.needsPosition}},secret:s,sessionID:l,showShare:c,showSettings:d,showInstruct:f,integration:null===(C=null==k?void 0:k.integrations)||void 0===C?void 0:C.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:b,initialQuestion:y,authToken:S,AZURE_COGNITIVE_SERVICES_TTS_KEY:M,onStateChange:_,...g&&v?{personification:{tag:g,pin:v}}:{}}):r(u).createElement("div",null,r(u).createElement("p",{style:{textAlign:"center",margin:"2rem auto"}},I("loading"),"..."))};PX.propTypes={memoriName:r(l).string,memoriID:r(l).string,ownerUserName:r(l).string,ownerUserID:r(l).string,integrationID:r(l).string,tenantID:r(l).string.isRequired,secretToken:r(l).string,sessionID:r(l).string,showShare:r(l).bool,showSettings:r(l).bool,showInstruct:r(l).bool,height:r(l).oneOfType([r(l).string,r(l).number]),baseURL:r(l).string,apiURL:r(l).string,tag:r(l).string,pin:r(l).string,context:r(l).objectOf(r(l).any),initialQuestion:r(l).string,uiLang:r(l).oneOf(["en","it"]),spokenLang:r(l).string,authToken:r(l).string,AZURE_COGNITIVE_SERVICES_TTS_KEY:r(l).string,onStateChange:r(l).func};var NX=PX;class LX extends HTMLElement{connectedCallback(){const e=document.createElement("div"),t=document.createElement("div");t.setAttribute("id","memori-root");const n=document.createElement("style");n.innerHTML="\n @import url('https://unpkg.com/@memori.ai/memori-webcomponent/dist/memori-webcomponent.css');\n ",e.appendChild(n),e.appendChild(t),this.appendChild(e);const o=Object.keys(NX.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t)),e)),{}),i=this.getAttribute("tenantId"),a=this.getAttribute("context")?.split(",")?.reduce(((e,t)=>{const[n,r]=t.split(":").map((e=>e.trim()));return{...e,[n]:r}}),{});i?r(c).render((0,s.jsx)(NX,{...o,context:a,tenantID:i}),t):console.error("No tenantId attribute found")}}customElements.define("memori-client",LX)})();
115
+ ***************************************************************************** */var VK=function(e,t){return VK=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},VK(e,t)};function qK(e,t){function n(){this.constructor=e}VK(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var KK=function(){return KK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},KK.apply(this,arguments)};Object.create;Object.create;var $K;u=a("85Hg2");function JK(e,t,n,r,o,i){void 0===i&&(i=0);var a=a$(e,t,i),s=a.width,l=a.height,c=Math.min(s,n),u=Math.min(l,r);return c>u*o?{width:u*o,height:u}:{width:c,height:c/o}}function XK(e,t,n,r,o){void 0===o&&(o=0);var i=a$(t.width,t.height,o),a=i.width,s=i.height;return{x:QK(e.x,a,n.width,r),y:QK(e.y,s,n.height,r)}}function QK(e,t,n,r){var o=t*r/2-n/2;return s$(e,-o,o)}function YK(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function ZK(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function e$(e,t,n,r,o,i,a){void 0===i&&(i=0),void 0===a&&(a=!0);var s=a?t$:n$,l=a$(t.width,t.height,i),c=a$(t.naturalWidth,t.naturalHeight,i),u={x:s(100,((l.width-n.width/o)/2-e.x/o)/l.width*100),y:s(100,((l.height-n.height/o)/2-e.y/o)/l.height*100),width:s(100,n.width/l.width*100/o),height:s(100,n.height/l.height*100/o)},d=Math.round(s(c.width,u.width*c.width/100)),f=Math.round(s(c.height,u.height*c.height/100)),h=c.width>=c.height*r?{width:Math.round(f*r),height:f}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:u,croppedAreaPixels:KK(KK({},h),{x:Math.round(s(c.width-h.width,u.x*c.width/100)),y:Math.round(s(c.height-h.height,u.y*c.height/100))})}}function t$(e,t){return Math.min(e,Math.max(0,t))}function n$(e,t){return t}function r$(e,t,n,r,o,i){var a=a$(t.width,t.height,n),s=s$(r.width/a.width*(100/e.width),o,i);return{crop:{x:s*a.width/2-r.width/2-a.width*s*(e.x/100),y:s*a.height/2-r.height/2-a.height*s*(e.y/100)},zoom:s}}function o$(e,t,n,r,o,i){void 0===n&&(n=0);var a=a$(t.naturalWidth,t.naturalHeight,n),s=s$(function(e,t,n){var r=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}(e,t,r),o,i),l=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((a.width-e.width)/2-e.x)*l,y:((a.height-e.height)/2-e.y)*l},zoom:s}}function i$(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function a$(e,t,n){var r=n*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function s$(e,t,n){return Math.min(Math.max(e,t),n)}function l$(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}$K=a("lmpx0");var c$=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=r(u).createRef(),n.videoRef=r(u).createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=document,n.currentWindow=window,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=r$(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),r=t.crop,o=t.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}else if(n.props.initialCroppedAreaPixels){var i=o$(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);r=i.crop,o=i.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}},n.computeSizes=function(){var e,t,r,o,i,a,s=n.imageRef.current||n.videoRef.current;if(s&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var l=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(r=n.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(o=n.videoRef.current)||void 0===o?void 0:o.videoHeight)||0,d=c/u,f=void 0;if(s.offsetWidth<c||s.offsetHeight<u)switch(n.props.objectFit){default:case"contain":f=l>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":f={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":f={width:n.containerRect.height*d,height:n.containerRect.height};break;case"auto-cover":f=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else f={width:s.offsetWidth,height:s.offsetHeight};n.mediaSize=KK(KK({},f),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var h=n.props.cropSize?n.props.cropSize:JK(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(i=n.state.cropSize)||void 0===i?void 0:i.height)===h.height&&(null===(a=n.state.cropSize)||void 0===a?void 0:a.width)===h.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(h),n.setState({cropSize:h},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(h),h}},n.onMouseDown=function(e){e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0])))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var r=t.getMousePoint(e),o=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(o,r,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+e.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,r,o=e.x,i=e.y;n.dragStartPosition={x:o,y:i},n.dragStartCrop=KK({},n.props.crop),null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t)},n.onDrag=function(e){var t=e.x,r=e.y;n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==r){var e=t-n.dragStartPosition.x,o=r-n.dragStartPosition.y,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+o},a=n.props.restrictPosition?XK(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(a)}}))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(!n.props.onWheelRequest||n.props.onWheelRequest(e)){e.preventDefault();var o=t.getMousePoint(e),i=r($K)(e).pixelY,a=n.props.zoom-i*n.props.zoomSpeed/200;n.setNewZoom(a,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e){var t=e.x,r=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(r-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,r=e.y,o=n.props,i=o.crop,a=o.zoom;return{x:(t+i.x)/a,y:(r+i.y)/a}},n.setNewZoom=function(e,t,r){var o=(void 0===r?{}:r).shouldUpdatePosition,i=void 0===o||o;if(n.state.cropSize&&n.props.onZoomChange){var a=s$(e,n.props.minZoom,n.props.maxZoom);if(i){var s=n.getPointOnContainer(t),l=n.getPointOnMedia(s),c={x:l.x*a-s.x,y:l.y*a-s.y},u=n.props.restrictPosition?XK(c,n.mediaSize,n.state.cropSize,a,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(a)}},n.getCropData=function(){return n.state.cropSize?e$(n.props.restrictPosition?XK(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,r),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?XK(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return qK(t,e),t.prototype.componentDidMount=function(){this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef)},t.prototype.componentWillUnmount=function(){var e;this.currentWindow.removeEventListener("resize",this.computeSizes),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,n,r,o,i,a,s,l,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.width)?this.computeSizes():(null===(i=e.crop)||void 0===i?void 0:i.x)===(null===(a=this.props.crop)||void 0===a?void 0:a.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(l=this.props.crop)||void 0===l?void 0:l.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=YK(n,r),this.lastPinchRotation=ZK(n,r),this.onDragStart(i$(n,r))},t.prototype.onPinchMove=function(e){var n=this,r=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]),i=i$(r,o);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=YK(r,o),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var a=ZK(r,o),s=n.props.rotation+(a-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=a}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,i=t.mediaProps,a=t.transform,s=t.crop,l=s.x,c=s.y,d=t.rotation,f=t.zoom,h=t.cropShape,p=t.showGrid,m=t.style,g=m.containerStyle,v=m.cropAreaStyle,b=m.mediaStyle,y=t.classes,w=y.containerClassName,x=y.cropAreaClassName,S=y.mediaClassName,M=t.objectFit;return r(u).createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:l$("reactEasyCrop_Container",w)},n?r(u).createElement("img",KK({alt:"",className:l$("reactEasyCrop_Image","contain"===M&&"reactEasyCrop_Contain","horizontal-cover"===M&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===M&&"reactEasyCrop_Cover_Vertical","auto-cover"===M&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),S)},i,{src:n,ref:this.imageRef,style:KK(KK({},b),{transform:a||"translate("+l+"px, "+c+"px) rotate("+d+"deg) scale("+f+")"}),onLoad:this.onMediaLoad})):o&&r(u).createElement("video",KK({autoPlay:!0,loop:!0,muted:!0,className:l$("reactEasyCrop_Video","contain"===M&&"reactEasyCrop_Contain","horizontal-cover"===M&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===M&&"reactEasyCrop_Cover_Vertical","auto-cover"===M&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),S)},i,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:KK(KK({},b),{transform:a||"translate("+l+"px, "+c+"px) rotate("+d+"deg) scale("+f+")"}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return r(u).createElement("source",KK({key:e.src},e))}))),this.state.cropSize&&r(u).createElement("div",{style:KK(KK({},v),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:l$("reactEasyCrop_CropArea","round"===h&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",x)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(r(u).Component),u$=c$,d$={};e(d$,"default",(()=>G$),(e=>G$=e));Xd=a("4IUwl");var f$,h$=a("3ju0v");rz=a("hCRLo"),sW=a("a0mDm"),az=a("jp3pO"),u=a("85Hg2"),Xd=a("4IUwl");f$=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var c=i[l];if(!s(c))return!1;var u=e[c],d=t[c];if(!1===(o=n?n.call(r,u,d,c):void 0)||void 0===o&&u!==d)return!1}return!0};aW=a("98I6H");var p$=a("3b0np"),m$=(u=a("85Hg2"),aW=a("98I6H"),sz=a("jfn1H"),h$=a("3ju0v"),p$=a("3b0np"),u=a("85Hg2"),Xd=a("4IUwl"),(u=a("85Hg2")).createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0}));function g$(e,t,n){return(e-t)/(n-t)}function v$(e,t,n,r){var o=g$(t,n,r),i={};switch(e){case"rtl":i.right="".concat(100*o,"%"),i.transform="translateX(50%)";break;case"btt":i.bottom="".concat(100*o,"%"),i.transform="translateY(50%)";break;case"ttb":i.top="".concat(100*o,"%"),i.transform="translateY(-50%)";break;default:i.left="".concat(100*o,"%"),i.transform="translateX(-50%)"}return i}function b$(e,t){return Array.isArray(e)?e[t]:e}var y$=["prefixCls","value","valueIndex","onStartMove","style","render","dragging","onOffsetChange"],w$=u.forwardRef((function(e,t){var n,o,i=e.prefixCls,a=e.value,s=e.valueIndex,l=e.onStartMove,c=e.style,d=e.render,f=e.dragging,h=e.onOffsetChange,p=(0,p$.default)(e,y$),m=u.useContext(m$),g=m.min,v=m.max,b=m.direction,y=m.disabled,w=m.range,x=m.tabIndex,S=m.ariaLabelForHandle,M=m.ariaLabelledByForHandle,_=m.ariaValueTextFormatterForHandle,E="".concat(i,"-handle"),A=function(e){y||l(e,s)},C=v$(b,a,g,v),k=u.createElement("div",(0,aW.default)({ref:t,className:r(Xd)(E,(n={},(0,h$.default)(n,"".concat(E,"-").concat(s+1),w),(0,h$.default)(n,"".concat(E,"-dragging"),f),n)),style:(0,sz.default)((0,sz.default)({},C),c),onMouseDown:A,onTouchStart:A,onKeyDown:function(e){if(!y){var t=null;switch(e.which||e.keyCode){case xW.LEFT:t="ltr"===b||"btt"===b?-1:1;break;case xW.RIGHT:t="ltr"===b||"btt"===b?1:-1;break;case xW.UP:t="ttb"!==b?1:-1;break;case xW.DOWN:t="ttb"!==b?-1:1;break;case xW.HOME:t="min";break;case xW.END:t="max";break;case xW.PAGE_UP:t=2;break;case xW.PAGE_DOWN:t=-2}null!==t&&(e.preventDefault(),h(t,s))}},tabIndex:y?null:b$(x,s),role:"slider","aria-valuemin":g,"aria-valuemax":v,"aria-valuenow":a,"aria-disabled":y,"aria-label":b$(S,s),"aria-labelledby":b$(M,s),"aria-valuetext":null===(o=b$(_,s))||void 0===o?void 0:o(a)},p));return d&&(k=d(k,{index:s,prefixCls:i,value:a,dragging:f})),k})),x$=w$,S$=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","draggingIndex"],M$=u.forwardRef((function(e,t){var n=e.prefixCls,r=e.style,o=e.onStartMove,i=e.onOffsetChange,a=e.values,s=e.handleRender,l=e.draggingIndex,c=(0,p$.default)(e,S$),d=u.useRef({});return u.useImperativeHandle(t,(function(){return{focus:function(e){var t;null===(t=d.current[e])||void 0===t||t.focus()}}})),u.createElement(u.Fragment,null,a.map((function(e,t){return u.createElement(x$,(0,aW.default)({ref:function(e){e?d.current[t]=e:delete d.current[t]},dragging:l===t,prefixCls:n,style:b$(r,t),key:t,value:e,valueIndex:t,onStartMove:o,onOffsetChange:i,render:s},c))})))}));rz=a("hCRLo"),sW=a("a0mDm"),u=a("85Hg2");function _$(e){var t="touches"in e?e.touches[0]:e;return{pageX:t.pageX,pageY:t.pageY}}function E$(e,t,n,r,o,i,a,s,l){var c=u.useState(null),d=(0,sW.default)(c,2),f=d[0],h=d[1],p=u.useState(-1),m=(0,sW.default)(p,2),g=m[0],v=m[1],b=u.useState(n),y=(0,sW.default)(b,2),w=y[0],x=y[1],S=u.useState(n),M=(0,sW.default)(S,2),_=M[0],E=M[1],A=u.useRef(null),C=u.useRef(null);u.useEffect((function(){-1===g&&x(n)}),[n,g]),u.useEffect((function(){return function(){document.removeEventListener("mousemove",A.current),document.removeEventListener("mouseup",C.current),document.removeEventListener("touchmove",A.current),document.removeEventListener("touchend",C.current)}}),[]);var k=function(e,t){w.some((function(t,n){return t!==e[n]}))&&(void 0!==t&&h(t),x(e),a(e))},T=function(e,t){if(-1===e){var n=_[0],a=_[_.length-1],s=r-n,c=o-a,u=t*(o-r);u=Math.max(u,s),u=Math.min(u,c);var d=i(n+u);u=d-n;var f=_.map((function(e){return e+u}));k(f)}else{var h=(o-r)*t,p=(0,rz.default)(w);p[e]=_[e];var m=l(p,h,e,"dist");k(m.values,m.value)}},I=u.useRef(T);I.current=T;var O=u.useMemo((function(){var e=(0,rz.default)(n).sort((function(e,t){return e-t})),t=(0,rz.default)(w).sort((function(e,t){return e-t}));return e.every((function(e,n){return e===t[n]}))?w:n}),[n,w]);return[g,f,O,function(r,o){r.stopPropagation();var i=n[o];v(o),h(i),E(n);var a=_$(r),l=a.pageX,c=a.pageY,u=function(n){n.preventDefault();var r,i=_$(n),a=i.pageX,s=i.pageY,u=a-l,d=s-c,f=e.current.getBoundingClientRect(),h=f.width,p=f.height;switch(t){case"btt":r=-d/p;break;case"ttb":r=d/p;break;case"rtl":r=-u/h;break;default:r=u/h}I.current(o,r)},d=function e(t){t.preventDefault(),document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",u),document.removeEventListener("touchend",e),document.removeEventListener("touchmove",u),A.current=null,C.current=null,v(-1),s()};document.addEventListener("mouseup",d),document.addEventListener("mousemove",u),document.addEventListener("touchend",d),document.addEventListener("touchmove",u),A.current=u,C.current=d}]}u=a("85Hg2"),sz=a("jfn1H"),u=a("85Hg2"),Xd=a("4IUwl");function A$(e){var t=e.prefixCls,n=e.style,o=e.start,i=e.end,a=e.index,s=e.onStartMove,l=u.useContext(m$),c=l.direction,d=l.min,f=l.max,h=l.disabled,p=l.range,m="".concat(t,"-track"),g=g$(o,d,f),v=g$(i,d,f),b=function(e){!h&&s&&s(e,-1)},y={};switch(c){case"rtl":y.right="".concat(100*g,"%"),y.width="".concat(100*v-100*g,"%");break;case"btt":y.bottom="".concat(100*g,"%"),y.height="".concat(100*v-100*g,"%");break;case"ttb":y.top="".concat(100*g,"%"),y.height="".concat(100*v-100*g,"%");break;default:y.left="".concat(100*g,"%"),y.width="".concat(100*v-100*g,"%")}return u.createElement("div",{className:r(Xd)(m,p&&"".concat(m,"-").concat(a+1)),style:(0,sz.default)((0,sz.default)({},y),n),onMouseDown:b,onTouchStart:b})}function C$(e){var t=e.prefixCls,n=e.style,r=e.values,o=e.startPoint,i=e.onStartMove,a=u.useContext(m$),s=a.included,l=a.range,c=a.min,d=u.useMemo((function(){if(!l){if(0===r.length)return[];var e=null!=o?o:c,t=r[0];return[{start:Math.min(e,t),end:Math.max(e,t)}]}for(var n=[],i=0;i<r.length-1;i+=1)n.push({start:r[i],end:r[i+1]});return n}),[r,l,o,c]);return s?d.map((function(e,r){var o=e.start,a=e.end;return u.createElement(A$,{index:r,prefixCls:t,style:b$(n,r),start:o,end:a,key:r,onStartMove:i})})):null}u=a("85Hg2"),sz=a("jfn1H"),h$=a("3ju0v"),u=a("85Hg2"),Xd=a("4IUwl");function k$(e){var t=e.prefixCls,n=e.style,o=e.children,i=e.value,a=e.onClick,s=u.useContext(m$),l=s.min,c=s.max,d=s.direction,f=s.includedStart,h=s.includedEnd,p=s.included,m="".concat(t,"-text"),g=v$(d,i,l,c);return u.createElement("span",{className:r(Xd)(m,(0,h$.default)({},"".concat(m,"-active"),p&&f<=i&&i<=h)),style:(0,sz.default)((0,sz.default)({},g),n),onMouseDown:function(e){e.stopPropagation()},onClick:function(){a(i)}},o)}function T$(e){var t=e.prefixCls,n=e.marks,r=e.onClick,o="".concat(t,"-mark");return n.length?u.createElement("div",{className:o},n.map((function(e){var t=e.value,n=e.style,i=e.label;return u.createElement(k$,{key:t,prefixCls:o,style:n,value:t,onClick:r},i)}))):null}u=a("85Hg2"),h$=a("3ju0v"),sz=a("jfn1H"),u=a("85Hg2"),Xd=a("4IUwl");function I$(e){var t=e.prefixCls,n=e.value,o=e.style,i=e.activeStyle,a=u.useContext(m$),s=a.min,l=a.max,c=a.direction,d=a.included,f=a.includedStart,h=a.includedEnd,p="".concat(t,"-dot"),m=d&&f<=n&&n<=h,g=(0,sz.default)((0,sz.default)({},v$(c,n,s,l)),"function"==typeof o?o(n):o);return m&&(g=(0,sz.default)((0,sz.default)({},g),"function"==typeof i?i(n):i)),u.createElement("span",{className:r(Xd)(p,(0,h$.default)({},"".concat(p,"-active"),m)),style:g})}function O$(e){var t=e.prefixCls,n=e.marks,r=e.dots,o=e.style,i=e.activeStyle,a=u.useContext(m$),s=a.min,l=a.max,c=a.step,d=u.useMemo((function(){var e=new Set;if(n.forEach((function(t){e.add(t.value)})),r&&null!==c)for(var t=s;t<=l;)e.add(t),t+=c;return Array.from(e)}),[s,l,c,r,n]);return u.createElement("div",{className:"".concat(t,"-step")},d.map((function(e){return u.createElement(I$,{prefixCls:t,key:e,value:e,style:o,activeStyle:i})})))}rz=a("hCRLo"),u=a("85Hg2");function R$(e,t,n,r,o,i){var a=u.useCallback((function(n){var r=isFinite(n)?n:e;return r=Math.min(t,n),r=Math.max(e,r)}),[e,t]),s=u.useCallback((function(r){if(null!==n){var o=e+Math.round((a(r)-e)/n)*n,i=function(e){return(String(e).split(".")[1]||"").length},s=Math.max(i(n),i(t),i(e)),l=Number(o.toFixed(s));return e<=l&&l<=t?l:null}return null}),[n,e,t,a]),l=u.useCallback((function(o){var i=a(o),l=r.map((function(e){return e.value}));null!==n&&l.push(s(o)),l.push(e,t);var c=l[0],u=t-e;return l.forEach((function(e){var t=Math.abs(i-e);t<=u&&(c=e,u=t)})),c}),[e,t,r,n,a,s]),c=function o(i,a,l){var c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit";if("number"==typeof a){var u,d=i[l],f=d+a,h=[];r.forEach((function(e){h.push(e.value)})),h.push(e,t),h.push(s(d));var p=a>0?1:-1;"unit"===c?h.push(s(d+p*n)):h.push(s(f)),h=h.filter((function(e){return null!==e})).filter((function(e){return a<0?e<=d:e>=d})),"unit"===c&&(h=h.filter((function(e){return e!==d})));var m="unit"===c?d:f;u=h[0];var g=Math.abs(u-m);if(h.forEach((function(e){var t=Math.abs(e-m);t<g&&(u=e,g=t)})),void 0===u)return a<0?e:t;if("dist"===c)return u;if(Math.abs(a)>1){var v=(0,rz.default)(i);return v[l]=u,o(v,a-p,l,c)}return u}return"min"===a?e:"max"===a?t:void 0},d=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",o=e[n],i=c(e,t,n,r);return{value:i,changed:i!==o}},f=function(e){return null===i&&0===e||"number"==typeof i&&e<i};return[l,function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",a=e.map(l),s=a[n],u=c(a,t,n,r);if(a[n]=u,!1===o){var h=i||0;n>0&&a[n-1]!==s&&(a[n]=Math.max(a[n],a[n-1]+h)),n<a.length-1&&a[n+1]!==s&&(a[n]=Math.min(a[n],a[n+1]-h))}else if("number"==typeof i||null===i){for(var p=n+1;p<a.length;p+=1)for(var m=!0;f(a[p]-a[p-1])&&m;){var g=d(a,1,p);a[p]=g.value,m=g.changed}for(var v=n;v>0;v-=1)for(var b=!0;f(a[v]-a[v-1])&&b;){var y=d(a,-1,v-1);a[v-1]=y.value,b=y.changed}for(var w=a.length-1;w>0;w-=1)for(var x=!0;f(a[w]-a[w-1])&&x;){var S=d(a,-1,w-1);a[w-1]=S.value,x=S.changed}for(var M=0;M<a.length-1;M+=1)for(var _=!0;f(a[M+1]-a[M])&&_;){var E=d(a,1,M+1);a[M+1]=E.value,_=E.changed}}return{value:a[n],values:a}}]}a("irlKZ");var P$=u.forwardRef((function(e,t){var n,o=e.prefixCls,i=void 0===o?"rc-slider":o,a=e.className,s=e.style,l=e.disabled,c=void 0!==l&&l,d=e.autoFocus,f=e.onFocus,h=e.onBlur,p=e.min,m=void 0===p?0:p,g=e.max,v=void 0===g?100:g,b=e.step,y=void 0===b?1:b,w=e.value,x=e.defaultValue,S=e.range,M=e.count,_=e.onChange,E=e.onBeforeChange,A=e.onAfterChange,C=e.allowCross,k=void 0===C||C,T=e.pushable,I=void 0!==T&&T,O=e.draggableTrack,R=e.reverse,P=e.vertical,N=e.included,L=void 0===N||N,B=e.startPoint,D=e.trackStyle,j=e.handleStyle,F=e.railStyle,z=e.dotStyle,U=e.activeDotStyle,H=e.marks,G=e.dots,W=e.handleRender,V=e.tabIndex,q=void 0===V?0:V,K=e.ariaLabelForHandle,$=e.ariaLabelledByForHandle,J=e.ariaValueTextFormatterForHandle,X=u.useRef(),Q=u.useRef(),Y=u.useMemo((function(){return P?R?"ttb":"btt":R?"rtl":"ltr"}),[R,P]),Z=u.useMemo((function(){return isFinite(m)?m:0}),[m]),ee=u.useMemo((function(){return isFinite(v)?v:100}),[v]),te=u.useMemo((function(){return null!==y&&y<=0?1:y}),[y]),ne=u.useMemo((function(){return!0===I?te:I>=0&&I}),[I,te]),re=u.useMemo((function(){return Object.keys(H||{}).map((function(e){var t=H[e],n={value:Number(e)};return t&&"object"===(0,az.default)(t)&&!u.isValidElement(t)&&("label"in t||"style"in t)?(n.style=t.style,n.label=t.label):n.label=t,n})).filter((function(e){var t=e.label;return t||"number"==typeof t})).sort((function(e,t){return e.value-t.value}))}),[H]),oe=R$(Z,ee,te,re,k,ne),ie=(0,sW.default)(oe,2),ae=ie[0],se=ie[1],le=VV(x,{value:w}),ce=(0,sW.default)(le,2),ue=ce[0],de=ce[1],fe=u.useMemo((function(){var e=null==ue?[]:Array.isArray(ue)?ue:[ue],t=(0,sW.default)(e,1)[0],n=null===ue?[]:[void 0===t?Z:t];if(S){if(n=(0,rz.default)(e),M||void 0===ue){var r=M>=0?M+1:2;for(n=n.slice(0,r);n.length<r;){var o;n.push(null!==(o=n[n.length-1])&&void 0!==o?o:Z)}}n.sort((function(e,t){return e-t}))}return n.forEach((function(e,t){n[t]=ae(e)})),n}),[ue,S,Z,M,ae]),he=u.useRef(fe);he.current=fe;var pe=function(e){return S?e:e[0]},me=function(e){var t=(0,rz.default)(e).sort((function(e,t){return e-t}));_&&!r(f$)(t,he.current)&&_(pe(t)),de(t)},ge=function(e){if(!c){var t=0,n=ee-Z;fe.forEach((function(r,o){var i=Math.abs(e-r);i<=n&&(n=i,t=o)}));var r=(0,rz.default)(fe);r[t]=e,S&&!fe.length&&void 0===M&&r.push(e),null==E||E(pe(r)),me(r),null==A||A(pe(r))}},ve=u.useState(null),be=(0,sW.default)(ve,2),ye=be[0],we=be[1];u.useEffect((function(){if(null!==ye){var e=fe.indexOf(ye);e>=0&&X.current.focus(e)}we(null)}),[ye]);var xe=u.useMemo((function(){return(!O||null!==te)&&O}),[O,te]),Se=E$(Q,Y,fe,Z,ee,ae,me,(function(){null==A||A(pe(he.current))}),se),Me=(0,sW.default)(Se,4),_e=Me[0],Ee=Me[1],Ae=Me[2],Ce=Me[3],ke=function(e,t){Ce(e,t),null==E||E(pe(he.current))},Te=-1!==_e;u.useEffect((function(){if(!Te){var e=fe.lastIndexOf(Ee);X.current.focus(e)}}),[Te]);var Ie=u.useMemo((function(){return(0,rz.default)(Ae).sort((function(e,t){return e-t}))}),[Ae]),Oe=u.useMemo((function(){return S?[Ie[0],Ie[Ie.length-1]]:[Z,Ie[0]]}),[Ie,S,Z]),Re=(0,sW.default)(Oe,2),Pe=Re[0],Ne=Re[1];u.useImperativeHandle(t,(function(){return{focus:function(){X.current.focus(0)},blur:function(){var e=document.activeElement;Q.current.contains(e)&&(null==e||e.blur())}}})),u.useEffect((function(){d&&X.current.focus(0)}),[]);var Le=u.useMemo((function(){return{min:Z,max:ee,direction:Y,disabled:c,step:te,included:L,includedStart:Pe,includedEnd:Ne,range:S,tabIndex:q,ariaLabelForHandle:K,ariaLabelledByForHandle:$,ariaValueTextFormatterForHandle:J}}),[Z,ee,Y,c,te,L,Pe,Ne,S,q,K,$,J]);return u.createElement(m$.Provider,{value:Le},u.createElement("div",{ref:Q,className:r(Xd)(i,a,(n={},(0,h$.default)(n,"".concat(i,"-disabled"),c),(0,h$.default)(n,"".concat(i,"-vertical"),P),(0,h$.default)(n,"".concat(i,"-horizontal"),!P),(0,h$.default)(n,"".concat(i,"-with-marks"),re.length),n)),style:s,onMouseDown:function(e){e.preventDefault();var t,n=Q.current.getBoundingClientRect(),r=n.width,o=n.height,i=n.left,a=n.top,s=n.bottom,l=n.right,c=e.clientX,u=e.clientY;switch(Y){case"btt":t=(s-u)/o;break;case"ttb":t=(u-a)/o;break;case"rtl":t=(l-c)/r;break;default:t=(c-i)/r}ge(ae(Z+t*(ee-Z)))}},u.createElement("div",{className:"".concat(i,"-rail"),style:F}),u.createElement(C$,{prefixCls:i,style:D,values:Ie,startPoint:B,onStartMove:xe?ke:null}),u.createElement(O$,{prefixCls:i,marks:re,dots:G,style:z,activeStyle:U}),u.createElement(M$,{ref:X,prefixCls:i,style:j,values:Ae,draggingIndex:_e,onStartMove:ke,onOffsetChange:function(e,t){if(!c){var n=se(fe,e,t);null==E||E(pe(fe)),me(n.values),null==A||A(pe(n.values)),we(n.value)}},onFocus:f,onBlur:h,handleRender:W}),u.createElement(T$,{prefixCls:i,marks:re,onClick:ge})))})),N$=P$;u=a("85Hg2"),JH=a("ae6os"),WH=a("1w3TK"),u=a("85Hg2");var L$=(u=a("85Hg2")).forwardRef(((e,t)=>{const{open:n}=e,r=(0,u.useRef)(null),o=(0,u.useRef)(null);function i(){JH.default.cancel(o.current),o.current=null}return u.useEffect((()=>(n?o.current=(0,JH.default)((()=>{var e;null===(e=r.current)||void 0===e||e.forcePopupAlign(),o.current=null})):i(),i)),[n,e.title]),u.createElement(Eq.default,Object.assign({ref:(0,WH.composeRef)(r,t)},e))}));Bz=a("LDfY3");const B$=e=>{const{componentCls:t,controlSize:n,dotSize:r,marginFull:o,marginPart:i,colorFillContentHover:a}=e;return{[t]:Object.assign(Object.assign({},eU(e)),{position:"relative",height:n,margin:`${i}px ${o}px`,padding:0,cursor:"pointer",touchAction:"none","&-vertical":{margin:`${o}px ${i}px`},[`${t}-rail`]:{position:"absolute",backgroundColor:e.colorFillTertiary,borderRadius:e.borderRadiusXS,transition:`background-color ${e.motionDurationMid}`},[`${t}-track`]:{position:"absolute",backgroundColor:e.colorPrimaryBorder,borderRadius:e.borderRadiusXS,transition:`background-color ${e.motionDurationMid}`},"&:hover":{[`${t}-rail`]:{backgroundColor:e.colorFillSecondary},[`${t}-track`]:{backgroundColor:e.colorPrimaryBorderHover},[`${t}-dot`]:{borderColor:a},[`${t}-handle::after`]:{boxShadow:`0 0 0 ${e.handleLineWidth}px ${e.colorPrimaryBorderHover}`},[`${t}-dot-active`]:{borderColor:e.colorPrimary}},[`${t}-handle`]:{position:"absolute",width:e.handleSize,height:e.handleSize,outline:"none",[`${t}-dragging`]:{zIndex:1},"&::before":{content:'""',position:"absolute",insetInlineStart:-e.handleLineWidth,insetBlockStart:-e.handleLineWidth,width:e.handleSize+2*e.handleLineWidth,height:e.handleSize+2*e.handleLineWidth,backgroundColor:"transparent"},"&::after":{content:'""',position:"absolute",insetBlockStart:0,insetInlineStart:0,width:e.handleSize,height:e.handleSize,backgroundColor:e.colorBgElevated,boxShadow:`0 0 0 ${e.handleLineWidth}px ${e.colorPrimaryBorder}`,borderRadius:"50%",cursor:"pointer",transition:`\n inset-inline-start ${e.motionDurationMid},\n inset-block-start ${e.motionDurationMid},\n width ${e.motionDurationMid},\n height ${e.motionDurationMid},\n box-shadow ${e.motionDurationMid}\n `},"&:hover, &:active, &:focus":{"&::before":{insetInlineStart:-((e.handleSizeHover-e.handleSize)/2+e.handleLineWidthHover),insetBlockStart:-((e.handleSizeHover-e.handleSize)/2+e.handleLineWidthHover),width:e.handleSizeHover+2*e.handleLineWidthHover,height:e.handleSizeHover+2*e.handleLineWidthHover},"&::after":{boxShadow:`0 0 0 ${e.handleLineWidthHover}px ${e.colorPrimary}`,width:e.handleSizeHover,height:e.handleSizeHover,insetInlineStart:(e.handleSize-e.handleSizeHover)/2,insetBlockStart:(e.handleSize-e.handleSizeHover)/2}}},[`${t}-mark`]:{position:"absolute",fontSize:e.fontSize},[`${t}-mark-text`]:{position:"absolute",display:"inline-block",color:e.colorTextDescription,textAlign:"center",wordBreak:"keep-all",cursor:"pointer",userSelect:"none","&-active":{color:e.colorText}},[`${t}-step`]:{position:"absolute",background:"transparent",pointerEvents:"none"},[`${t}-dot`]:{position:"absolute",width:r,height:r,backgroundColor:e.colorBgElevated,border:`${e.handleLineWidth}px solid ${e.colorBorderSecondary}`,borderRadius:"50%",cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,"&-active":{borderColor:e.colorPrimaryBorder}},"&&-disabled":{cursor:"not-allowed",[`${t}-rail`]:{backgroundColor:`${e.colorFillSecondary} !important`},[`${t}-track`]:{backgroundColor:`${e.colorTextDisabled} !important`},[`\n ${t}-dot\n `]:{backgroundColor:e.colorBgElevated,borderColor:e.colorTextDisabled,boxShadow:"none",cursor:"not-allowed"},[`${t}-handle::after`]:{backgroundColor:e.colorBgElevated,cursor:"not-allowed",width:e.handleSize,height:e.handleSize,boxShadow:`0 0 0 ${e.handleLineWidth}px ${new(0,Bz.TinyColor)(e.colorTextDisabled).onBackground(e.colorBgContainer).toHexString()}`,insetInlineStart:0,insetBlockStart:0},[`\n ${t}-mark-text,\n ${t}-dot\n `]:{cursor:"not-allowed !important"}}})}},D$=(e,t)=>{const{componentCls:n,railSize:r,handleSize:o,dotSize:i}=e,a=t?"width":"height",s=t?"height":"width",l=t?"insetBlockStart":"insetInlineStart",c=t?"top":"insetInlineStart";return{[t?"paddingBlock":"paddingInline"]:r,[s]:3*r,[`${n}-rail`]:{[a]:"100%",[s]:r},[`${n}-track`]:{[s]:r},[`${n}-handle`]:{[l]:(3*r-o)/2},[`${n}-mark`]:{insetInlineStart:0,top:0,[c]:o,[a]:"100%"},[`${n}-step`]:{insetInlineStart:0,top:0,[c]:r,[a]:"100%",[s]:r},[`${n}-dot`]:{position:"absolute",[l]:(r-i)/2}}},j$=e=>{const{componentCls:t,marginPartWithMark:n}=e;return{[`${t}-horizontal`]:Object.assign(Object.assign({},D$(e,!0)),{[`&${t}-with-marks`]:{marginBottom:n}})}},F$=e=>{const{componentCls:t}=e;return{[`${t}-vertical`]:Object.assign(Object.assign({},D$(e,!1)),{height:"100%"})}};var z$=pU("Slider",(e=>{const t=uU(e,{marginPart:(e.controlHeight-e.controlSize)/2,marginFull:e.controlSize/2,marginPartWithMark:e.controlHeightLG-e.controlSize});return[B$(t),j$(t),F$(t)]}),(e=>{const t=e.controlHeightLG/4;return{controlSize:t,railSize:4,handleSize:t,handleSizeHover:e.controlHeightSM/2,dotSize:8,handleLineWidth:e.lineWidth+1,handleLineWidthHover:e.lineWidth+3}})),U$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};const H$=e=>"number"==typeof e?e.toString():"";var G$=u.forwardRef(((e,t)=>{const{prefixCls:n,range:o,className:i,tooltipPrefixCls:a,tipFormatter:s,tooltipVisible:l,getTooltipPopupContainer:c,tooltipPlacement:d}=e,f=U$(e,["prefixCls","range","className","tooltipPrefixCls","tipFormatter","tooltipVisible","getTooltipPopupContainer","tooltipPlacement"]),{getPrefixCls:h,direction:p,getPopupContainer:m}=u.useContext(aU),[g,v]=u.useState({}),b=(e,t)=>{v((n=>Object.assign(Object.assign({},n),{[e]:t})))},y=(e,t)=>e||(t?"rtl"===p?"left":"right":"top"),w=h("slider",n),[x,S]=z$(w),M=r(Xd)(i,{[`${w}-rtl`]:"rtl"===p},S);"rtl"!==p||f.vertical||(f.reverse=!f.reverse);const[_,E]=u.useMemo((()=>o?"object"==typeof o?[!0,o.draggableTrack]:[!0,!1]:[!1]),[o]);return x(u.createElement(N$,Object.assign({},f,{step:f.step,range:_,draggableTrack:E,className:M,ref:t,prefixCls:w,handleRender:(t,n)=>{var r;const{index:o,dragging:i}=n,{tooltip:f={},vertical:p}=e,v=Object.assign({},f),{open:x,placement:S,getPopupContainer:M,prefixCls:_,formatter:E}=v;let A;A=E||null===E?E:s||null===s?s:H$;const C=!!A&&(g[o]||i),k=null!==(r=null!=x?x:l)&&void 0!==r?r:void 0===x&&C,T=Object.assign(Object.assign({},t.props),{onMouseEnter:()=>b(o,!0),onMouseLeave:()=>b(o,!1)}),I=h("tooltip",null!=_?_:a);return u.createElement(L$,{prefixCls:I,title:A?A(n.value):"",open:k,placement:y(null!=S?S:d,p),key:o,overlayClassName:`${w}-tooltip`,getPopupContainer:M||c||m},u.cloneElement(t,T))}})))}));const W$="img-crop",V$=.1,q$=(0,u.forwardRef)(((e,t)=>{const{cropperRef:n,image:r,aspect:o,shape:i,grid:a,zoom:l,rotate:c,minZoom:d,maxZoom:f,cropperProps:h}=e,[p,m]=(0,u.useState)({x:0,y:0}),[g,v]=(0,u.useState)({width:0,height:0}),[b,y]=(0,u.useState)(1),[w,x]=(0,u.useState)(0),S=(0,u.useRef)({width:0,height:0,x:0,y:0}),M=(0,u.useCallback)((e=>{const{width:t,height:n}=e,r=n*o;v(t>r?{width:r,height:n}:{width:t,height:t/o})}),[o]),_=(0,u.useCallback)(((e,t)=>{S.current=t}),[]);return(0,u.useImperativeHandle)(t,(()=>({rotateVal:w,setZoomVal:y,setRotateVal:x,cropPixelsRef:S}))),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u$,Object.assign({},h,{ref:n,image:r,crop:p,cropSize:g,onCropChange:m,aspect:o,cropShape:i,showGrid:a,zoomWithScroll:l,zoom:b,rotation:w,onZoomChange:y,onRotationChange:x,minZoom:d,maxZoom:f,onMediaLoaded:M,onCropComplete:_,classes:{containerClassName:`${W$}-container`,mediaClassName:`${W$}-media`}})),l&&(0,s.jsxs)("section",Object.assign({className:`${W$}-control ${W$}-control-zoom`},{children:[(0,s.jsx)("button",Object.assign({onClick:()=>y(b-V$),disabled:b-V$<d},{children:"-"})),(0,s.jsx)(d$.default,{min:d,max:f,step:V$,value:b,onChange:y}),(0,s.jsx)("button",Object.assign({onClick:()=>y(b+V$),disabled:b+V$>f},{children:"+"}))]})),c&&(0,s.jsxs)("section",Object.assign({className:`${W$}-control ${W$}-control-rotate`},{children:[(0,s.jsx)("button",Object.assign({onClick:()=>x(w-1),disabled:-180===w},{children:"↺"})),(0,s.jsx)(d$.default,{min:-180,max:180,step:1,value:w,onChange:x}),(0,s.jsx)("button",Object.assign({onClick:()=>x(w+1),disabled:180===w},{children:"↻"}))]}))]})}));var K$=(0,u.memo)(q$);!function(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");t.setAttribute("media","screen"),t.innerHTML=e,document.head.appendChild(t)}}(".img-crop-modal .img-crop-container {\n position: relative;\n width: 100%;\n height: 40vh;\n}\n.img-crop-modal .img-crop-control {\n display: flex;\n align-items: center;\n width: 60%;\n margin-left: auto;\n margin-right: auto;\n}\n.img-crop-modal .img-crop-control:first-of-type {\n margin-top: 16px;\n}\n.img-crop-modal .img-crop-control:last-of-type {\n margin-bottom: -8px;\n}\n.img-crop-modal .img-crop-control button {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 34px;\n height: 34px;\n padding: 0;\n font-style: normal;\n background: transparent;\n border: 0;\n outline: 0;\n cursor: pointer;\n}\n.img-crop-modal .img-crop-control button[disabled] {\n cursor: default;\n}\n.img-crop-modal .img-crop-control button + div:only-of-type {\n flex: 1;\n margin: 0 8px;\n}\n.img-crop-modal .img-crop-control-zoom button {\n font-size: 18px;\n}\n.img-crop-modal .img-crop-control-rotate button {\n font-size: 16px;\n}\n.img-crop-modal .img-crop-control-rotate button:first-of-type {\n transform: rotate(-20deg);\n}\n.img-crop-modal .img-crop-control-rotate button:last-of-type {\n transform: rotate(20deg);\n}\n");const $$=-1===DK(qF,"4.23.0")?{visible:!0}:{open:!0},J$=(0,u.forwardRef)(((e,t)=>{const{aspect:n=1,shape:r="rect",grid:o=!1,quality:i=.4,fillColor:a="white",zoom:l=!0,rotate:c=!1,minZoom:d=1,maxZoom:f=3,modalTitle:h,modalWidth:p,modalOk:m,modalCancel:g,modalMaskTransitionName:v,modalTransitionName:b,modalClassName:y,onModalOk:w,onModalCancel:x,beforeCrop:S,onUploadFail:M,cropperProps:_,children:E}=e,A=(0,u.useRef)({});A.current.onModalOk=w,A.current.onModalCancel=x,A.current.beforeCrop=S,A.current.onUploadFail=M;const[C,k]=(0,u.useState)(""),T=(0,u.useRef)({}),I=(0,u.useRef)(),O=(0,u.useRef)((()=>{})),R=(0,u.useRef)((()=>{})),P=(0,u.useMemo)((()=>{const e=Array.isArray(E)?E[0]:E,t=e.props,{beforeUpload:n,accept:r}=t,o=WF(t,["beforeUpload","accept"]);return I.current=n,Object.assign(Object.assign({},e),{props:Object.assign(Object.assign({},o),{accept:r||"image/*",beforeUpload:(e,t)=>new Promise(((n,r)=>VF(void 0,void 0,void 0,(function*(){if(A.current.beforeCrop){if(!(yield A.current.beforeCrop(e,t)))return r()}T.current=e,O.current=e=>{var t,r;null===(r=(t=A.current).onModalOk)||void 0===r||r.call(t,e),n(e)},R.current=e=>{var t,n;null===(n=(t=A.current).onUploadFail)||void 0===n||n.call(t,e),r()};const o=new FileReader;o.addEventListener("load",(()=>{"string"==typeof o.result&&k(o.result)})),o.readAsDataURL(e)}))))})})}),[E]),N=(0,u.useRef)({}),L=(0,u.useMemo)((()=>{const e={width:p,okText:m,cancelText:g,maskTransitionName:v,transitionName:b};return Object.keys(e).forEach((t=>{const n=t;void 0===e[n]&&delete e[n]})),e}),[g,v,m,b,p]),B=()=>{k(""),N.current.setZoomVal(1),N.current.setRotateVal(0)},D=(0,u.useCallback)((()=>{var e,t;null===(t=(e=A.current).onModalCancel)||void 0===t||t.call(e),B()}),[]),j=(0,u.useCallback)((e=>VF(void 0,void 0,void 0,(function*(){var t;B();const n=document.createElement("canvas"),r=n.getContext("2d"),o=e.target,s=((null===(t=null==o?void 0:o.getRootNode)||void 0===t?void 0:t.call(o))||document).querySelector(`.${W$}-media`),{width:l,height:u,x:d,y:f}=N.current.cropPixelsRef.current;if(c&&0!==N.current.rotateVal){const{naturalWidth:e,naturalHeight:t}=s,o=N.current.rotateVal*(Math.PI/180),i=Math.abs(Math.sin(o)),c=Math.abs(Math.cos(o)),h=e*c+t*i,p=t*c+e*i;n.width=h,n.height=p,r.fillStyle=a,r.fillRect(0,0,h,p);const m=h/2,g=p/2;r.translate(m,g),r.rotate(o),r.translate(-m,-g);const v=(h-e)/2,b=(p-t)/2;r.drawImage(s,0,0,e,t,v,b,e,t);const y=r.getImageData(0,0,h,p);n.width=l,n.height=u,r.putImageData(y,-d,-f)}else n.width=l,n.height=u,r.fillStyle=a,r.fillRect(0,0,l,u),r.drawImage(s,d,f,l,u,0,0,l,u);const{type:h,name:p,uid:m}=T.current;n.toBlob((e=>VF(void 0,void 0,void 0,(function*(){const t=Object.assign(new File([e],p,{type:h}),{uid:m});if(!I.current)return O.current(t);const n=t,r=yield I.current(n,[n]);return!0===r?O.current(t):!1===r?R.current(new Error("beforeUpload return false")):(delete t[BK.LIST_IGNORE],r===BK.LIST_IGNORE?(Object.defineProperty(t,BK.LIST_IGNORE,{value:!0,configurable:!0}),R.current(new Error("beforeUpload return LIST_IGNORE"))):"object"==typeof r&&null!==r?O.current(r):void 0)}))),h,i)}))),[a,i,c]),F=e=>(0,s.jsxs)(s.Fragment,{children:[P,C&&(0,s.jsx)(FV,Object.assign({},$$,{wrapClassName:`${W$}-modal ${y||""}`,title:e,onOk:j,onCancel:D,maskClosable:!1,destroyOnClose:!0},L,{children:(0,s.jsx)(K$,{ref:N,cropperRef:t,image:C,aspect:n,shape:r,grid:o,zoom:l,rotate:c,minZoom:d,maxZoom:f,cropperProps:_})}))]});return h?F(h):(0,s.jsx)(ez,{children:(e,t)=>F("zh-cn"===t?"编辑图片":"Edit image")})}));u=a("85Hg2");var X$=({className:e,title:t})=>r(u).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},r(u).createElement("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}));const Q$=["image/jpeg","image/png","image/jpg","image/gif"],Y$=({originNode:e,file:t,tenantID:n,actions:o,resourceType:i})=>{var a,s,l,c;const{t:d}=ea();return r(u).createElement("div",{className:"memori--list-item-wrapper"+("uploading"===t.status?" listItemUploading":"")},r(u).createElement(fp,{spinning:"uploading"===t.status},"error"===t.status?r(u).createElement(Ey,{content:d("media.uploadError")},e.props.children):r(u).createElement(_b,{item:{mediumID:t.uid,mimeType:"uploading"===t.status?"image/png":(null===(a=t.name)||void 0===a?void 0:a.endsWith(".glb"))?"model/gltf-binary":t.type||"image/png",title:null!==(s=t.name)&&void 0!==s?s:"",url:"uploading"===t.status?"":(null===(c=null===(l=t.response)||void 0===l?void 0:l.asset)||void 0===c?void 0:c.assetURL)?t.response.asset.assetURL:Fm({type:i,resourceURI:t.thumbUrl,tenantID:n}),content:`${Fm({resourceURI:t.thumbUrl,type:i})}`},preview:!1})),("success"===t.status||"done"===t.status)&&r(u).createElement("div",{className:"list-item-actions"},r(u).createElement(Zd,{outlined:!0,shape:"circle",icon:r(u).createElement(aj,null),className:"action-button",title:d("edit")||"Edit",onClick:()=>null==o?void 0:o.download(t)}),r(u).createElement(Zd,{outlined:!0,shape:"circle",icon:r(u).createElement(X$,null),className:"action-button",title:d("delete")||"Delete",onClick:()=>null==o?void 0:o.remove(t)})))};var Z$=({uploadMultipleImages:e,maxNumberOfVisualizedUploads:t,uploadUrl:n,tenantID:o,fileList:i,maxFileSizeInMB:a=2,fileResolution:s,useImageCrop:l,uploadMessage:c,imageProportions:d=1,imageProportionsHelper:f,allowedMimeTypes:h,onRemove:p,onFileChanged:m,onUploadFinished:g,onFileNotValid:v,disabled:b,showHelper:y,additionalHelper:w,resourceType:x})=>{var S;const{t:M}=ea(),[_,E]=(0,u.useState)(null!=i?i:[]),[A,C]=(0,u.useState)(),k=r(u).createElement(r(EF),{className:"memori--upload",disabled:null!=b&&b,accept:(null===(S=null!=h?h:Q$)||void 0===S?void 0:S.join(","))+";capture=camera,camcorder",action:n,listType:"picture-card",showUploadList:{showPreviewIcon:!0,showRemoveIcon:!0,showDownloadIcon:!0,downloadIcon:r(u).createElement(aj,{title:M("edit")||"Edit"})},beforeUpload:e=>{if(!(null!=h?h:Q$).find((t=>t===e.type))&&e.type)return console.debug("File not allowed",e,null!=h?h:Q$),Qd.error(M("media.uploadMimeTypeNotAllowed")),v&&v(),Promise.reject(M("media.uploadMimeTypeNotAllowed"));if(!(e.size/1024/1024<(null!=a?a:2)))return Qd.error(M("media.uploadSizeLimitMessage",{size:a})),v&&v(),Promise.reject(M("media.uploadSizeLimitMessage",{size:a}));if(s&&s.length){const t=new FileReader;return t.readAsDataURL(e),new Promise(((n,r)=>{t.addEventListener("load",(t=>{var o,i,a,l=new Image;l.style.padding="0px",l.style.margin="0px",l.onload=()=>{l.width===s[0]&&l.height===s[1]?n(e):(Qd.error(M("media.uploadWrongResolutionMessage",{width:s[0],height:s[1]})),r(),v&&v())},l.src=null!==(a=null===(i=null===(o=t.target)||void 0===o?void 0:o.result)||void 0===i?void 0:i.toString())&&void 0!==a?a:""}))}))}return Promise.resolve(e)},supportServerRender:!0,fileList:_,multiple:e,maxCount:t||(e?100:1),onChange:e=>{E(e.fileList.map((e=>{var t;return{...e,status:null!==(t=e.status)&&void 0!==t?t:"error"}}))),"done"===e.file.status&&g&&g(e.file)},onRemove:p,onDownload:e=>{var t,n;let r=null===(t=e.response)||void 0===t?void 0:t.asset;if(r){let t=r.originalFileName&&e.name.includes(r.originalFileName)?r.originalFileName:e.name;C({...r,title:null!=t?t:r.title})}else C({assetID:e.uid,title:null!==(n=e.name)&&void 0!==n?n:e.fileName})},itemRender:(e,t,n,i)=>r(u).createElement(Y$,{resourceType:x,originNode:e,file:t,fileList:_||n,actions:i,tenantID:o})},c);return r(u).createElement("div",{"aria-live":"polite"},l?r(u).createElement(J$,{rotate:!0,aspect:d,fillColor:"transparent",modalCancel:M("cancel")||"Cancel",modalMaskTransitionName:"none",modalTransitionName:"none"},k):k,r(u).createElement(pp,{open:!!A,title:M("media.editAttributes"),onClose:()=>{C(void 0)},footer:r(u).createElement(r(u).Fragment,null),width:"100%"},r(u).createElement("label",{htmlFor:"media-title-input",className:"media-title-label"},M("media.title")),r(u).createElement("input",{id:"media-title-input",className:"media-title-input",type:"text",name:"title",defaultValue:(null==A?void 0:A.title)||"",onChange:e=>{C({...A,title:e.target.value})}}),r(u).createElement("div",{className:"memori-modal--footer"},r(u).createElement(Zd,{onClick:()=>{C(void 0)}},M("cancel")),r(u).createElement(Zd,{primary:!0,onClick:()=>{m&&(null==A?void 0:A.assetID)&&m(A.assetID,{...A}),E((e=>e.map((e=>{var t,n;return e.uid===(null==A?void 0:A.assetID)||(null===(n=null===(t=e.response)||void 0===t?void 0:t.asset)||void 0===n?void 0:n.assetID)===(null==A?void 0:A.assetID)?{...e,title:null==A?void 0:A.title,name:null==A?void 0:A.title}:e})))),C(void 0)}},M("confirm")))),y&&r(u).createElement("legend",{className:"helper"},r(u).createElement("p",null,M(h?"media.uploadHelper":"media.uploadHelperImages").replace("@size@",(null!=a?a:2).toString())),f&&l&&r(u).createElement("p",null,M("media.scaleRatio"),": ",f),w&&r(u).createElement("p",null,w)))};var eJ=({visible:e,authToken:t,sessionID:n,tenantID:o,uploadAssetURL:i,deleteAsset:a,onCancel:s,onOk:l})=>{const{t:c}=ea(),[d,f]=(0,u.useState)();return r(u).createElement(pp,{open:e,title:c("media.addMediaLabel"),className:"attachment-media-modal",closable:!0,width:"100%",widthMd:"100%",onClose:()=>{s&&s()},footer:r(u).createElement(r(u).Fragment,null,r(u).createElement(Zd,{onClick:s},c("cancel")),r(u).createElement(Zd,{primary:!0,onClick:()=>{d&&l(d),f(void 0)},disabled:!d},c("confirm")))},r(u).createElement(Z$,{tenantID:o,uploadMultipleImages:!1,maxNumberOfVisualizedUploads:1,maxFileSizeInMB:100,uploadUrl:i,useImageCrop:!1,allowedMimeTypes:Qm,fileList:d?[{uid:"-1",name:d.assetID,status:"done",thumbUrl:Fm({resourceURI:d.assetURL,tenantID:o,sessionID:n})}]:[],uploadMessage:c("media.mediaUploadMessage"),imageProportions:1,onUploadFinished:e=>{let t=e.response.asset,n=e.response;0===n.resultCode?f(t):(console.error(n,e),Qd.error(c(gF(n.resultCode))))},onFileChanged:(e,t)=>{f((e=>({...e||{},...t})))},onRemove:async e=>{const n=await a(t,e.thumbUrl);return 0===n.resultCode?f(void 0):(console.error(n,e),Qd.error(c(gF(n.resultCode)))),0===n.resultCode}}))};u=a("85Hg2");var tJ=({visible:e,onCancel:t,onOk:n})=>{var o,i,a;const{t:s}=ea(),[l,c]=(0,u.useState)({url:"",title:""}),d=e=>{if("Enter"===e.key){if(0===(null==l?void 0:l.url.length)||0===(null==l?void 0:l.title.length))return;let e=document.getElementById("save-link-button");e&&e.click()}};return r(u).createElement(pp,{open:e,title:s("media.addLinkLabel"),className:"attachment-link-modal",closable:!0,width:"100%",widthMd:"80%",onClose:()=>{t&&t()},footer:r(u).createElement(r(u).Fragment,null,r(u).createElement(Zd,{onClick:t},s("cancel")),r(u).createElement(Zd,{id:"save-link-button",primary:!0,onClick:()=>{0!==(null==l?void 0:l.url.length)&&0!==(null==l?void 0:l.title.length)&&(n(l),c({url:"",title:""}))},disabled:0===(null==l?void 0:l.url.length)||0===(null==l?void 0:l.title.length)},s("confirm")))},r(u).createElement("div",{className:"attachment-link-modal--row"},r(u).createElement("div",{className:"attachment-link-modal--column"},r(u).createElement("label",{htmlFor:"new-link-url",className:"attachment-link-modal--label"},s("media.linkKey"),":"),r(u).createElement("input",{type:"url",className:"attachment-link-modal--input ",onChange:e=>{let t=e.target.value.startsWith("http")||0===e.target.value.length?e.target.value:`https://${e.target.value}`;c((e=>{var n;return{title:null!==(n=null==e?void 0:e.title)&&void 0!==n?n:"",url:t}}))},placeholder:"https://memori.ai/...",value:null==l?void 0:l.url,name:"url",onKeyDown:d}),r(u).createElement("label",{htmlFor:"new-link-title",className:"attachment-link-modal--label"},s("media.linkValue"),":"),r(u).createElement("input",{type:"text",className:"attachment-link-modal--input ",onChange:e=>c((t=>{var n;return{url:null!==(n=null==t?void 0:t.url)&&void 0!==n?n:"",title:e.target.value}})),value:null==l?void 0:l.title,name:"title",onKeyDown:d})),r(u).createElement("div",{className:"attachment-link-modal--column"},r(u).createElement("div",{className:"attachment-link-modal--centered"},r(u).createElement(qm,{key:null!==(o=null==l?void 0:l.url)&&void 0!==o?o:"",item:{title:null!==(i=null==l?void 0:l.title)&&void 0!==i?i:"",url:null!==(a=null==l?void 0:l.url)&&void 0!==a?a:"",mediumID:"",mimeType:"text/html"},onLinkPreviewInfo:e=>{var t;(null===(t=null==l?void 0:l.title)||void 0===t?void 0:t.length)||c((t=>{var n;return{...t,title:null!==(n=null==e?void 0:e.title)&&void 0!==n?n:""}}))}})))))};window.getMemoriState=e=>{var t,n,r,o,i;let a=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null===(o=null===(r=document.querySelector("memori-client"))||void 0===r?void 0:r.shadowRoot)||void 0===o?void 0:o.querySelector(".memori-widget"));if(!a)return null;let s=null===(i=a.dataset)||void 0===i?void 0:i.memoriEngineState;return s?JSON.parse(s):null},window.typeMessage=e=>{var t,n;let r=document.querySelector("fieldset#chat-fieldset textarea")||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector("fieldset#chat-fieldset textarea"));r&&(!function(e,t){var n,r,o,i;const a=null===(r=null===(n=null==Object?void 0:Object.getOwnPropertyDescriptor)||void 0===n?void 0:n.call(Object,e,"value"))||void 0===r?void 0:r.set,s=Object.getPrototypeOf(e),l=null===(i=null===(o=null==Object?void 0:Object.getOwnPropertyDescriptor)||void 0===o?void 0:o.call(Object,s,"value"))||void 0===i?void 0:i.set;l&&a&&a!==l?l.call(e,t):a&&a.call(e,t)}(r,e),r.dispatchEvent(new Event("input",{bubbles:!0})),setTimeout((()=>{var e,t;let n=document.querySelector("button.memori-chat-inputs--send")||(null===(t=null===(e=document.querySelector("memori-client"))||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("button.memori-chat-inputs--send"));n&&n.click()}),100))};let nJ,rJ,oJ,iJ,aJ;var sJ=({memori:e,memoriConfigs:t,memoriLang:n,integration:o,showInstruct:i=!1,showShare:a=!0,preview:s=!1,embed:l=!1,showInputs:c=!0,showDates:d=!1,showContextPerLine:f=!1,showSettings:h=!1,height:p="100vh",secret:m,baseUrl:g="https://app.twincreator.com",apiUrl:v="https://backend.memori.ai",initialContextVars:b,initialQuestion:y,ogImage:w,sessionID:x,tenant:S,personification:M,authToken:_,AZURE_COGNITIVE_SERVICES_TTS_KEY:E,onStateChange:A})=>{var C,k,T,I,O,R,P,N,L,B,D,j,F,z,U,H,G,W;const{t:V,i18n:q}=ea(),[K,$]=(0,u.useState)(!1);(0,u.useEffect)((()=>{$(!0)}),[]);const J=mi(v),{initSession:X,postTextEnteredEvent:Q,postPlaceChangedEvent:Y,postTimeoutEvent:Z,postTagChangedEvent:ee,getSession:te,getContentQualityIndexes:ne}=J,{uploadAsset:re,getUploadAssetURL:oe,deleteAsset:ie}=J.backend,[ae,se]=(0,u.useState)(!1),[le,ce]=(0,u.useState)(!1),[ue,de]=(0,u.useState)(!1),fe=null===(I=null===(T=null===(k=null===(C=null==t?void 0:t.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===C?void 0:C.culture)||void 0===k?void 0:k.split("-"))||void 0===T?void 0:T[0])||void 0===I?void 0:I.toUpperCase(),[he,pe]=(0,u.useState)(null!==(L=null!==(N=null!==(P=null!=n?n:null===(R=null===(O=null==e?void 0:e.culture)||void 0===O?void 0:O.split("-"))||void 0===R?void 0:R[0])&&void 0!==P?P:fe)&&void 0!==N?N:q.language)&&void 0!==L?L:"IT"),me=(null==o?void 0:o.customData)?JSON.parse(o.customData):null,ge=!!(null==me?void 0:me.multilanguage),[ve,be]=(0,u.useState)(!1),[ye,we]=(0,u.useState)(!1),[xe,Se]=(0,u.useState)(!1),[Me,_e]=(0,u.useState)(!1),[Ee,Ae]=(0,u.useState)(!1),[Ce,ke]=(0,u.useState)(!1),[Te,Ie]=(0,u.useState)(!1),[Oe,Re]=(0,u.useState)(!0),[Pe,Ne]=(0,u.useState)(3),[Le,Be]=(0,u.useState)(!1);(0,u.useEffect)((()=>{Be(!!oJ)}),[oJ]),(0,u.useEffect)((()=>{Ie(hF("muteSpeaker",!1)),Re(hF("continuousSpeech",!0)),Ne(hF("continuousSpeechTimeout",3))}),[]);const[De,je]=(0,u.useState)(m),[Fe,ze]=(0,u.useState)(),[Ue,He]=(0,u.useState)(null),[Ge,Ve]=(0,u.useState)(),qe=async(e,t)=>{var n;const r=null!=t?t:nt;if(e&&r){const{currentState:t,...o}=await Y({sessionId:r,placeName:e.placeName,latitude:e.latitude,longitude:e.longitude,uncertaintyKm:null!==(n=e.uncertainty)&&void 0!==n?n:0});t&&0===o.resultCode&&at({...ot,...t})}},[Ke,$e]=(0,u.useState)(""),[Je,Xe]=(0,u.useState)(!1),[Qe,Ye]=(0,u.useState)([]),Ze=e=>{Ye((t=>[...t,{...e}]))},et=async(t,n,r,o=!0,i)=>{var a,s,l,c,u;if(!nt||!(null==t?void 0:t.length))return;Ze({text:t,translatedText:i,fromUser:!0,media:null!=n?n:[],initial:!!r}),we(!0);const d=null!==(c=null!==(l=null===(s=null===(a=e.culture)||void 0===a?void 0:a.split("-"))||void 0===s?void 0:s[0])&&void 0!==l?l:q.language)&&void 0!==c?c:"IT";let f=t;if(o&&!ae&&ge&&he.toUpperCase()!==d.toUpperCase()){f=(await Jm(t,d,he,g)).text}const{currentState:h,...p}=await Q({sessionId:null!=r?r:nt,text:f});if(0===p.resultCode&&h){const t=null!==(u=h.emission)&&void 0!==u?u:null==ot?void 0:ot.emission;if("X4"===h.state&&e.giverTag){const{currentState:t,...n}=await ee(nt,e.giverTag);0===n.resultCode?(at(t),t.emission&&(Ze({text:t.emission,media:t.media,fromUser:!1}),St(t.emission))):(console.error(p,n),Qd.error(V(gF(n.resultCode))))}else if("X2d"===h.state&&e.giverTag){const{currentState:t,...n}=await Q({sessionId:null!=r?r:nt,text:Math.random().toString().substring(2,8)});if(0===n.resultCode){const{currentState:t,...n}=await ee(nt,e.giverTag);0===n.resultCode?(at(t),t.emission&&(Ze({text:t.emission,media:t.media,fromUser:!1}),St(t.emission))):(console.error(p,n),Qd.error(V(gF(n.resultCode))))}else console.error(p,n),Qd.error(V(gF(n.resultCode)))}else he.toLowerCase()!==d.toLowerCase()&&t&&!ae&&ge?tt(h,he).then((e=>{e.emission&&St(e.emission)})):(at({...h,emission:t}),t&&(Ze({text:t,media:h.media,fromUser:!1}),St(t)))}else 404===p.resultCode&&(Ye((e=>[...e.slice(0,e.length-1)])),lt(!1,De||e.secretToken,Fe,ae&&e.giverTag?e.giverTag:void 0,ae&&e.giverPIN?e.giverPIN:void 0,b,y).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{et(t,n,null==e?void 0:e.sessionID)}),500)})));we(!1)},tt=async(t,n)=>{var r,o,i,a,s,l;const c=null!==(a=null!==(i=null===(o=null===(r=e.culture)||void 0===r?void 0:r.split("-"))||void 0===o?void 0:o[0])&&void 0!==i?i:q.language)&&void 0!==a?a:"IT",u=null!==(s=t.emission)&&void 0!==s?s:null==ot?void 0:ot.emission;let d={...t},f=null;if(u&&!ae&&c.toUpperCase()!==n.toUpperCase()&&ge){const e=await Jm(u,n,c,g);if(t.hints&&t.hints.length>0){const r=await Promise.all((null!==(l=t.hints)&&void 0!==l?l:[]).map((async e=>{var t;const r=await Jm(e,n,c,g);return{text:null!==(t=null==r?void 0:r.text)&&void 0!==t?t:e,originalText:e}})));d={...t,emission:e.text,translatedHints:r}}else d={...t,emission:e.text};e.text.length>0&&(f={text:e.text,media:t.media,fromUser:!1})}else d={...t,emission:u},u&&(f={text:u,media:t.media,fromUser:!1});return at(d),f&&Ze(f),d},[nt,rt]=(0,u.useState)(x),[ot,it]=(0,u.useState)(),at=e=>{it(e),A&&A(e)},st=async t=>{var n;if("PUBLIC"===e.privacyType||e.secretToken||De||Fe){be(!0);try{if(!e.giverTag&&(null===(n=e.receivedInvitations)||void 0===n?void 0:n.length)){let t=e.receivedInvitations.find((e=>"GIVER"===e.type&&"ACCEPTED"===e.state));t&&(e.giverTag=t.tag,e.giverPIN=t.pin)}const r=await X(t);if((null==r?void 0:r.sessionID)&&(null==r?void 0:r.currentState)&&0===r.resultCode)return rt(r.sessionID),Ge&&qe(Ge,r.sessionID),be(!1),{dialogState:r.currentState,sessionID:r.sessionID};console.error(r),Qd.error(V(gF(null==r?void 0:r.resultCode))),de(!0)}catch(e){console.error(e),new Error("Error fetching session")}}else He("password")},lt=async(t=!1,n,r,o,i,a,s)=>{var l;be(!0);try{const{sessionID:c,currentState:u,...d}=await X({memoriID:null!==(l=e.engineMemoriID)&&void 0!==l?l:"",password:n,recoveryTokens:r,tag:o,pin:i,initialContextVars:a,initialQuestion:s});if(c&&u&&0===d.resultCode)return rt(c),t&&(at(u),u.emission&&(Qe.length<=1?Ye([{text:u.emission,media:u.media,fromUser:!1}]):Ze({text:u.emission,media:u.media,fromUser:!1}))),Ge&&qe(Ge,c),be(!1),{dialogState:u,sessionID:c};console.error(d),Qd.error(V(gF(d.resultCode))),de(!0)}catch(e){console.error(e)}return be(!1),null},ct=async(t,n,r,o)=>{var i;if(!t||!n)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState:t,resultCode:a}=await ee(n,null!=r?r:Ym);if(0===a){let s=0;if(r!==Ym&&o&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await Q({sessionId:n,text:null!=o?o:""});s=e}if(0===s){const{currentState:e,...t}=await te(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(a))console.warn("[APPCONTEXT/CHANGETAG]",a),st({memoriID:null!==(i=e.engineMemoriID)&&void 0!==i?i:"",password:m||e.secretToken,tag:e.giverTag,pin:e.giverPIN,initialContextVars:b,initialQuestion:y});else if(t)return{currentState:t,sessionId:n,resultCode:a}}}catch(e){let t=e;return console.error("[APPCONTEXT/CHANGETAG]",t),Promise.reject(t)}return null};(0,u.useEffect)((()=>()=>{ot&&(null==ot?void 0:ot.currentTag)===e.giverTag||(async()=>{nt&&e.giverTag&&e.giverPIN&&(Ye([]),await ct(e.engineMemoriID,nt,e.giverTag,e.giverPIN))})()}),[]);const[ut,dt]=(0,u.useState)(),ft=(0,u.useRef)(),ht=()=>{ut&&(clearTimeout(ut),dt(void 0)),(null==ft?void 0:ft.current)&&(clearTimeout(ft.current),ft.current=void 0)},pt=()=>{ht(),!(null==ot?void 0:ot.acceptsTimeout)||oJ||Le||Ke.length||Je||gt()},mt=async()=>{if(oJ||Le||Ke.length||Je)pt();else if(nt&&xe&&(null==ot?void 0:ot.acceptsTimeout)){const{currentState:e,...t}=await Z(nt);if(0===t.resultCode&&e){const t=e.emission;!ae&&ge&&he!==(null==q?void 0:q.language)&&t&&t.length>0?tt({...e,emission:t},he).then((e=>{e.emission&&St(e.emission)})):t&&t.length>0&&(Ze({text:t,media:e.media,fromUser:!1}),St(t),at(e))}}},gt=()=>{let e=null==ot?void 0:ot.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==ot?void 0:ot.emission){e+=ot.emission.length/26.5}}let t=setTimeout(mt,1e3*e);dt(t),ft.current=t};(0,u.useEffect)((()=>{(Ke.length||Le)&&ht(),nt&&!Ke.length&&pt()}),[null==ot?void 0:ot.acceptsTimeout,null==ot?void 0:ot.timeout,null==ot?void 0:ot.state,Le,nt,Qe,Ke]),(0,u.useEffect)((()=>()=>{Se(!1),ce(!1),ht(),ft.current=void 0}),[]);const vt=(0,u.useCallback)((t=>{var n,r,o,i;let a="";switch((null!==(i=null!==(o=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==o?o:q.language)&&void 0!==i?i:"IT").toUpperCase()){case"IT":a=""+("MALE"===e.voiceType?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":a=""+("MALE"===e.voiceType?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":a=""+("MALE"===e.voiceType?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":a=""+("MALE"===e.voiceType?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":a=""+("MALE"===e.voiceType?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":a=""+("MALE"===e.voiceType?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":a=""+("MALE"===e.voiceType?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":a=""+("MALE"===e.voiceType?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;default:a=""+("MALE"===e.voiceType?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return a}),[e.voiceType,q.language,e.culture]),yt=t=>{var n,r;let o="";switch((t||(null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])||q.language||"IT").toUpperCase()){case"IT":default:o="it-IT";break;case"DE":o="de-DE";break;case"EN":o="en-GB";break;case"ES":o="es-ES";break;case"FR":o="fr-FR";break;case"PT":o="pt-PT";break;case"UK":o="uk-UK";break;case"RU":o="ru-RU"}return o},[wt,xt]=(0,u.useState)();(0,u.useEffect)((()=>{(async()=>{try{const e=await fetch(`${g||"https://app.twincreator.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{xt(e)}))}),[]);const St=e=>{if(console.log(E,xe,s),!E)return;if(s)return;iJ&&iJ.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if(n&&t)aJ.suspend();else if("suspended"===aJ.state){Mt(),aJ=new Ad;let e=aJ.createBuffer(1,1e4,22050),t=aJ.createBufferSource();t.buffer=e,t.connect(aJ.destination)}if(!oJ){iJ=new uo.SpeakerAudioDestination;let e=vo.fromSpeakerOutput(iJ);oJ=new Io.SpeechSynthesizer(rJ,e)}Te?Oe&&Tt():(iJ.onAudioEnd=()=>{Be(!1),Oe&&document.dispatchEvent(new Event("endSpeakStartListen"))},Be(!0),oJ.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${yt(he)}"><voice name="${vt(he)}"><s>${((e,t)=>{var n;if(!wt)return e;const r={...null!==(n=wt.common)&&void 0!==n?n:{},...(null==S?void 0:S.id)&&wt[S.id]?wt[S.id]:{}},o=Object.keys(r).map((e=>{var n;return{word:e,phoneme:null!==(n=r[e][t])&&void 0!==n?n:r[e].default}}));return o.reduce(((e,{word:t,phoneme:n})=>e.replace(new RegExp(t,"gi"),`<phoneme alphabet="ipa" ph="${n}">${t}</phoneme>`)),e)})(e,he.toLowerCase())}</s></voice></speak>`,(r=>{if(r){console.log("result",r);try{aJ.decodeAudioData(r.audioData,(function(e){const r=aJ.createBufferSource();r.buffer=e,r.connect(aJ.destination),(Qe.length<1||t&&n)&&r.start(0)})),aJ.resume(),oJ&&(oJ.close(),oJ=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),Be(!1),oJ&&(oJ.close(),oJ=null)}}else aJ.resume(),Be(!1)}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),Be(!1)})),Be(!1),we(!1))},Mt=()=>{oJ&&(oJ.close(),oJ=null),aJ&&aJ.close(),iJ&&(iJ.pause(),iJ.close())};(0,u.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==ot?void 0:ot.emission]);const[_t,Et]=(0,u.useState)(""),At=()=>Et(""),[Ct,kt]=(0,u.useState)(null),Tt=()=>{let e=setTimeout((async()=>{Pt();const e=jm(_t);e.length>0?(et(e),At(),$e("")):Je&&pt()}),1e3*Pe);kt(e)},It=()=>{Ct&&(clearTimeout(Ct),kt(null))};(0,u.useEffect)((()=>{It(),Oe&&Tt(),pt()}),[_t]);const Ot=()=>{if(console.log("start listening"),E){Pt(),Et("");try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){console.log("is listening"),_e(!0),rJ||(rJ=hn.fromSubscription(E,"eastus"),rJ.speechRecognitionLanguage=yt(he),rJ.speechSynthesisLanguage=yt(he),rJ.speechSynthesisVoiceName=vt(he));const t=vo.fromDefaultMicrophoneInput();nJ=new wo.SpeechRecognizer(rJ,t),Xe(!0),nJ.recognized=(e,t)=>{if(t.result.reason===bt.RecognizedSpeech){let e=t.result.text;if(Et(e||""),(null==e?void 0:e.length)>0){const t=jm(e);t.length>0&&$e(t)}}else t.result.reason===bt.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},nJ.canceled=(e,t)=>{t.reason===We.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),Rt()},nJ.sessionStopped=(e,t)=>{nJ&&nJ.stopContinuousRecognitionAsync()},nJ.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},Rt=()=>{nJ&&(nJ.stopContinuousRecognitionAsync(),nJ.close(),nJ=null,Xe(!1))},Pt=()=>{_e(!1),Rt(),It()};(0,u.useEffect)((()=>()=>Pt()),[]),(0,u.useEffect)((()=>{"Z0"===(null==ot?void 0:ot.state)&&Pt()}),[null==ot?void 0:ot.state]);const[Nt,Lt]=(0,u.useState)(!1),Bt=(0,u.useCallback)((e=>{Le&&oJ&&(oJ.close(),oJ=null),!Oe||!Me&&Nt||(Lt(!0),Ot())}),[Oe,Me]);(0,u.useEffect)((()=>{!Le&&Oe&&Me?Ot():Le&&Je&&Rt()}),[Le]),(0,u.useEffect)((()=>(document.addEventListener("endSpeakStartListen",Bt),()=>{document.removeEventListener("endSpeakStartListen",Bt)})),[Bt]),(0,u.useEffect)((()=>{Je&&(Pt(),At(),$e(""),Ot())}),[fe]);const[Dt,jt]=(0,u.useState)("keypress");(0,u.useEffect)((()=>{const e=hF("sendOnEnter","keypress");jt(e)}),[]),(0,u.useEffect)((()=>{pF("sendOnEnter",Dt)}),[Dt]);const[Ft,zt]=(0,u.useState)(),Ut=null==me?void 0:me.globalBackground,Ht=Ut?`url(${Ut})`:null,Gt=o?{"--memori-chat-bubble-bg":"#fff",...me&&!i?{"--memori-text-color":null!==(B=me.textColor)&&void 0!==B?B:"#000"}:{},...(null==me?void 0:me.buttonBgColor)?{"--memori-button-bg":me.buttonBgColor,"--memori-primary":me.buttonBgColor}:{},...(null==me?void 0:me.buttonTextColor)?{"--memori-button-text":me.buttonTextColor}:{},...(null==me?void 0:me.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==me?void 0:me.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===me.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(D=me.innerBgAlpha)&&void 0!==D?D:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===me.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(j=null==me?void 0:me.innerBgAlpha)&&void 0!==j?j:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},Wt=`\n ${s?"#preview":":root"}, .memori-widget {\n ${Object.entries(Gt).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,[Vt,qt]=(0,u.useState)(!0),[Kt,$t]=(0,u.useState)();(0,u.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:o,unansweredQuestions:i,...a}=await ne(e);0===a.resultCode&&(t=r,n=i)}catch(e){let t=e;console.error("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",t)}return{points:null!=t?t:0,unansweredQuestions:null!=n?n:0}})(e.engineMemoriID).then((e=>{$t(_F(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,u.useEffect)((()=>{if(null==me?void 0:me.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",me.seoTitle),document.head.append(e)}if(null==me?void 0:me.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",me.seoDescription),document.head.append(e)}if(null==me?void 0:me.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",me.seoUrl),document.head.append(e)}let t=w||e.avatarURL;if((null==me?void 0:me.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[me,e.avatarURL,w]);const Jt=async t=>{const n=(null==t?void 0:t.sessionID)||nt,r=(null==t?void 0:t.dialogState)||ot;ce(!0);let o=document.getElementById("memori-audio"),i=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");if(o&&i&&(o.muted=!1,o.play().catch((e=>{console.error("error playing intro audio",e)}))),!n&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!De&&!Fe||!n&&ue)return He("password"),void ce(!1);if(n)if(x){const{currentState:t,...r}=await te(n);if(0!==r.resultCode||!t)return console.debug("session expired, opening new session"),de(!0),rt(void 0),ce(!1),void await Jt();if(Ye([]),ae&&e.giverTag&&(null==ot?void 0:ot.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await ct(e.engineMemoriID,n,"-");const t=await ct(e.engineMemoriID,n,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");tt(t.currentState,he).then((e=>{e.emission&&St(e.emission)})).finally((()=>{Se(!0)}))}catch(t){console.error("session #2",t),lt(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,b,y).then((()=>{Se(!0)}))}else if(!ae&&M&&(null==ot?void 0:ot.currentTag)!==M.tag)try{console.debug("change tag #3"),await ct(e.engineMemoriID,n,"-");const t=await ct(e.engineMemoriID,n,M.tag,M.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");tt(t.currentState,he).then((e=>{e.emission&&St(e.emission)})).finally((()=>{Se(!0)}))}catch(t){console.error("session #5",t),lt(!0,null==e?void 0:e.secretToken,void 0,M.tag,M.pin,b,y).then((()=>{Se(!0)}))}else if(ae||M||(null==ot?void 0:ot.currentTag)===Ym)tt(t,he).then((e=>{e.emission&&St(e.emission)})).finally((()=>{Se(!0)}));else try{console.debug("change tag #6"),await ct(e.engineMemoriID,n,"-");const t=await ct(e.engineMemoriID,n,Ym);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");tt(t.currentState,he).then((e=>{e.emission&&St(e.emission)})).finally((()=>{Se(!0)}))}catch(t){console.error("session #8",t),lt(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,b,y).then((()=>{Se(!0)}))}}else Ye([]),tt(r,he).then((e=>{e.emission&&St(e.emission)})).finally((()=>{Se(!0)}));else{ce(!1),de(!1);const t=await st({memoriID:e.engineMemoriID,password:m||e.secretToken,tag:null==M?void 0:M.tag,pin:null==M?void 0:M.pin,initialContextVars:b,initialQuestion:y});await Jt(t||void 0)}},[Xt,Qt]=(0,u.useState)(_);(0,u.useEffect)((()=>{const t=document.querySelector(`memori-client[memoriname="${e.name}"]`)||document.querySelector(`memori-client[memoriid="${e.memoriID}"]`)||document.querySelector("memori-client");if(!t)return;const n=new MutationObserver(((e,t)=>{var n,r,o;for(const t of e)"attributes"===t.type&&"authtoken"===(null===(n=t.attributeName)||void 0===n?void 0:n.toLowerCase())&&(console.log("FUCK",t),"MEMORI-CLIENT"===t.target.nodeName?Qt(t.target.getAttribute("authtoken")||void 0):Qt((null===(o=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===o?void 0:o.getAttribute("authtoken"))||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const Zt=r(u).createElement(uF,{memori:e,history:Qe,showShare:a,position:Ge,setShowPositionDrawer:Ae,setShowSettingsDrawer:ke,speakerMuted:Te,setSpeakerMuted:e=>{if(Ie(e),e)Mt();else{aJ=new Ad;let e=aJ.createBuffer(1,1e4,22050),t=aJ.createBufferSource();t.buffer=e,t.connect(aJ.destination)}},showSettings:h,hasUserActivatedSpeak:xe}),en=r(u).createElement(sj,{memori:e,integration:o,integrationConfig:me,tenant:S,instruct:ae,avatar3dVisible:Vt,setAvatar3dVisible:qt,hasUserActivatedSpeak:xe,isPlayingAudio:Le,baseUrl:g}),tn=r(u).createElement(Ty,{memori:e,tenant:S,gamificationLevel:Kt,language:fe,userLang:he,setUserLang:pe,baseUrl:g,position:Ge,openPositionDrawer:()=>Ae(!0),integrationConfig:me,instruct:ae,sessionId:nt,clickedStart:le,onClickStart:Jt,initializeTTS:()=>{if(!E)return;rJ=hn.fromSubscription(E,"eastus"),rJ.speechSynthesisLanguage=yt(he),rJ.speechSynthesisVoiceName=vt(he),rJ.speechRecognitionLanguage=yt(he),Dm()&&(rJ.speechSynthesisOutputFormat=Yt.Audio16Khz32KBitRateMonoMp3),aJ=new Ad;let e=aJ.createBuffer(1,1e4,22050),t=aJ.createBufferSource();t.buffer=e,t.connect(aJ.destination),iJ=new uo.SpeakerAudioDestination;let n=vo.fromSpeakerOutput(iJ);oJ=new Io.SpeechSynthesizer(rJ,n)}}),nn=nt?r(u).createElement(_y,{memori:e,sessionID:nt,tenant:S,translateTo:ge&&he.toUpperCase()!==(null===(G=null!==(H=null!==(U=null===(z=null===(F=e.culture)||void 0===F?void 0:F.split("-"))||void 0===z?void 0:z[0])&&void 0!==U?U:q.language)&&void 0!==H?H:"IT")||void 0===G?void 0:G.toUpperCase())?he:void 0,baseUrl:g,memoriTyping:ye,history:Qe,authToken:Xt,dialogState:ot,setDialogState:at,pushMessage:Ze,simulateUserPrompt:(e,t)=>{Rt(),et(e,void 0,void 0,!1,t)},showDates:d,showContextPerLine:f,client:J,selectReceiverTag:async t=>{var n;if(nt)try{const{currentState:r,...o}=await ee(nt,t);if(0===o.resultCode)if(Ze({text:t,fromUser:!0}),"X4"===r.state&&e.giverTag){const{currentState:t,...n}=await J.postTagChangedEvent(nt,e.giverTag);0===n.resultCode?(at(t),t.emission&&Ze({text:t.emission,media:t.media,fromUser:!1})):(console.error(n),Qd.error(V(gF(n.resultCode))))}else at(r),r.emission&&Ze({text:r.emission,media:r.media,fromUser:!1});else console.error(o,t,null===(n=null==ot?void 0:ot.knownTags)||void 0===n?void 0:n[t]),Qd.error(V(gF(o.resultCode)))}catch(e){let t=e;console.error(t),Qd.error(t.message)}},preview:s,sendOnEnter:Dt,setSendOnEnter:jt,attachmentsMenuOpen:Ft,setAttachmentsMenuOpen:zt,instruct:ae,showInputs:c,showMicrophone:!!E,userMessage:Ke,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return $e(""),void pt();$e(e),ht()},sendMessage:e=>{Rt(),et(e),$e(""),At()},stopListening:Pt,startListening:Ot,stopAudio:Mt,resetTranscript:At,listening:Je,isPlayingAudio:Le}):null,rn=o&&Ht?r(u).createElement("div",{className:"memori--global-background"},r(u).createElement("div",{className:"memori--global-background-image",style:{backgroundImage:Ht}})):null,on=o?r(u).createElement("style",{dangerouslySetInnerHTML:{__html:Wt}}):null,an=r(u).createElement(lj,{canInstruct:!!e.giverTag,instruct:ae,onChangeMode:e=>{se("instruct"===e),Se(!1),ce(!1)}});return r(u).createElement("div",{className:r(Xd)("memori","memori-widget",{"memori--preview":s,"memori--embed":l,"memori--with-integration":o,"memori--active":xe}),"data-memori-name":null==e?void 0:e.name,"data-memori-id":null==e?void 0:e.engineMemoriID,"data-memori-secondary-id":null==e?void 0:e.memoriID,"data-memori-session-id":nt,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...ot,sessionID:nt}),style:{height:p}},r(u).createElement(dF,{header:Zt,avatar:en,chat:nn,startPanel:tn,integrationStyle:on,integrationBackground:rn,changeMode:an,sessionId:nt,hasUserActivatedSpeak:xe,showInstruct:i,loading:ve}),r(u).createElement("audio",{id:"memori-audio",style:{display:"none"},src:"https://app.twincreator.com/intro.mp3"}),K&&r(u).createElement(Bm,{withModal:!0,pwdOrTokens:Ue,openModal:!!Ue,setPwdOrTokens:He,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{t.password&&je(t.password),t.tokens&&ze(t.tokens),lt(!nt,t.password,t.tokens,ae?e.giverTag:void 0,ae?e.giverPIN:void 0,b,y).then((e=>{He(null),Jt(e||void 0)})).catch((()=>{He(null),de(!0)}))},minimumNumberOfRecoveryTokens:null!==(W=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==W?W:1}),nt&&r(u).createElement(tJ,{visible:"link"===Ft,onCancel:()=>zt(void 0),onOk:async e=>{if(!nt)return;let t={mediumID:"",mimeType:"text/html",url:e.url,title:e.title};Ze({text:V("media.insertThisLink",{url:t.url,title:t.title}),fromUser:!0,media:[t]});try{const{currentState:e,...n}=await J.postMediumSelectedEvent(nt,t);e&&0===n.resultCode?(at(e),e.emission&&(Ze({text:e.emission,media:e.media,fromUser:!1}),St(e.emission))):(console.error(n,e,t),Qd.error(V(gF(n.resultCode),{ns:"common"})))}catch(e){let t=e;console.error(t),Qd.error(t.message)}zt(void 0)}}),Xt&&nt&&(null==S?void 0:S.id)&&r(u).createElement(eJ,{visible:"media"===Ft,authToken:Xt,tenantID:null==S?void 0:S.id,sessionID:nt,uploadAssetURL:J.backend.getUploadAssetURL(Xt,e.memoriID),deleteAsset:J.backend.deleteAsset,onCancel:()=>zt(void 0),onOk:async e=>{if(!nt)return;let t={mediumID:"",mimeType:e.mimeType,url:e.assetURL,title:e.title||e.assetID};Ze({text:V("media.insertThisMediaMsg"),fromUser:!0,media:[t]});try{const{currentState:e,...n}=await J.postMediumSelectedEvent(nt,t);e&&0===n.resultCode?(at(e),e.emission&&(Ze({text:e.emission,media:e.media,fromUser:!1}),St(e.emission))):(console.error(n,e,t),Qd.error(V(gF(n.resultCode),{ns:"common"})))}catch(e){let t=e;console.error(t),Qd.error(t.message)}zt(void 0)}}))};function lJ(e){return lJ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lJ(e)}function cJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uJ(e,t){if("object"!==lJ(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==lJ(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function dJ(e){var t=uJ(e,"string");return"symbol"===lJ(t)?t:String(t)}function fJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,dJ(r.key),r)}}function hJ(e,t,n){return t&&fJ(e.prototype,t),n&&fJ(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function pJ(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mJ(e,t){return mJ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mJ(e,t)}function gJ(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mJ(e,t)}function vJ(e,t){if(t&&("object"===lJ(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pJ(e)}function bJ(e){return bJ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bJ(e)}function yJ(e,t,n){return(t=dJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wJ(e){if(Array.isArray(e))return e}function xJ(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function SJ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function MJ(e,t){if(e){if("string"==typeof e)return SJ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?SJ(e,t):void 0}}function _J(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function EJ(e){return wJ(e)||xJ(e)||MJ(e)||_J()}function AJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function CJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AJ(Object(n),!0).forEach((function(t){yJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var kJ={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},TJ=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};cJ(this,e),this.init(t,n)}return hJ(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||kJ,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,CJ(CJ({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),IJ=new TJ,OJ=function(){function e(){cJ(this,e),this.observers={}}return hJ(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var o=[].concat(this.observers[e]);o.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var i=[].concat(this.observers["*"]);i.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function RJ(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function PJ(e){return null==e?"":""+e}function NJ(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function LJ(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function BJ(e,t,n){var r=LJ(e,t,Object);r.obj[r.k]=n}function DJ(e,t){var n=LJ(e,t),r=n.obj,o=n.k;if(r)return r[o]}function jJ(e,t,n){var r=DJ(e,n);return void 0!==r?r:DJ(t,n)}function FJ(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):FJ(e[r],t[r],n):e[r]=t[r]);return e}function zJ(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var UJ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function HJ(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return UJ[e]})):e}var GJ="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,WJ=[" ",",","?","!",";"];function VJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VJ(Object(n),!0).forEach((function(t){yJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function KJ(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=bJ(e);if(t){var o=bJ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return vJ(this,n)}}function $J(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;++i){if(!o)return;if("string"==typeof o[r[i]]&&i+1<r.length)return;if(void 0===o[r[i]]){for(var a=2,s=r.slice(i,i+a).join(n),l=o[s];void 0===l&&r.length>i+a;)a++,l=o[s=r.slice(i,i+a).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(s)){if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s]}var c=r.slice(i+a).join(n);return c?$J(l,c,n):void 0}o=o[r[i]]}return o}}var JJ=function(e){gJ(n,e);var t=KJ(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return cJ(this,n),r=t.call(this),GJ&&OJ.call(pJ(r)),r.data=e||{},r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return hJ(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=DJ(this.data,a);return s||!i||"string"!=typeof n?s:$J(this.data&&this.data[e]&&this.data[e][t],n,o)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),BJ(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=DJ(this.data,a)||{};r?FJ(s,n,o):s=qJ(qJ({},s),n),BJ(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?qJ(qJ({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(OJ),XJ={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}};function QJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function YJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?QJ(Object(n),!0).forEach((function(t){yJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ZJ(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=bJ(e);if(t){var o=bJ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return vJ(this,n)}}var eX={},tX=function(e){gJ(n,e);var t=ZJ(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return cJ(this,n),r=t.call(this),GJ&&OJ.call(pJ(r)),NJ(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,pJ(r)),r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=IJ.create("translator"),r}return hJ(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=WJ.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}(e,n,r));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:o};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(o=l.shift()),e=l.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,t,r){var o=this;if("object"!==lJ(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,c=s.namespaces,u=c[c.length-1],d=t.lng||this.language,f=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(f){var h=t.nsSeparator||this.options.nsSeparator;return i?(p.res="".concat(u).concat(h).concat(l),p):"".concat(u).concat(h).concat(l)}return i?(p.res=l,p):l}var p=this.resolve(e,t),m=p&&p.res,g=p&&p.usedKey||l,v=p&&p.exactUsedKey||l,b=Object.prototype.toString.apply(m),y=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,S="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&S&&y.indexOf(b)<0&&("string"!=typeof w||"[object Array]"!==b)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,YJ(YJ({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return i?(p.res=M,p):M}if(a){var _="[object Array]"===b,E=_?[]:{},A=_?v:g;for(var C in m)if(Object.prototype.hasOwnProperty.call(m,C)){var k="".concat(A).concat(a).concat(C);E[C]=this.translate(k,YJ(YJ({},t),{joinArrays:!1,ns:c})),E[C]===k&&(E[C]=m[C])}m=E}}else if(x&&"string"==typeof w&&"[object Array]"===b)(m=m.join(w))&&(m=this.extendTranslation(m,e,t,r));else{var T=!1,I=!1,O=void 0!==t.count&&"string"!=typeof t.count,R=n.hasDefaultValue(t),P=O?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(P)]||t.defaultValue;!this.isValidLookup(m)&&R&&(T=!0,m=N),this.isValidLookup(m)||(I=!0,m=l);var L=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,B=L&&I?void 0:m,D=R&&N!==m&&this.options.updateMissing;if(I||T||D){if(this.logger.log(D?"updateKey":"missingKey",d,u,l,D?N:m),a){var j=this.resolve(l,YJ(YJ({},t),{},{keySeparator:!1}));j&&j.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&z&&z[0])for(var U=0;U<z.length;U++)F.push(z[U]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var i=R&&r!==m?r:B;o.options.missingKeyHandler?o.options.missingKeyHandler(e,u,n,i,D,t):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(e,u,n,i,D,t),o.emit("missingKey",e,u,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?F.forEach((function(e){o.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,p,r),I&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(I||T)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,T?m:void 0):this.options.parseMissingKeyHandler(m))}return i?(p.res=m,p):m}},{key:"extendTranslation",value:function(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,YJ(YJ({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(YJ(YJ({},n),{interpolation:YJ(YJ({},this.options.interpolation),n.interpolation)}));var a,s="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var l=e.match(this.interpolator.nestingRegexp);a=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=YJ(YJ({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),s){var u=e.match(this.interpolator.nestingRegexp);a<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):i.translate.apply(i,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,f="string"==typeof d?[d]:d;return null!=e&&f&&f.length&&!1!==n.applyPostProcessor&&(e=XJ.handle(f,e,t,this.options&&this.options.postProcessPassResolved?YJ({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,o,i,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),c=l.key;n=c;var u=l.namespaces;a.options.fallbackNS&&(u=u.concat(a.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,f=d&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),h=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);u.forEach((function(e){a.isValidLookup(t)||(i=e,!eX["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(eX["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,l=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,c,n,e,s);else{var u;d&&(u=a.pluralResolver.getSuffix(n,s.count,s));var p="".concat(a.options.pluralSeparator,"zero");if(d&&(l.push(c+u),f&&l.push(c+p)),h){var m="".concat(c).concat(a.options.contextSeparator).concat(s.context);l.push(m),d&&(l.push(m+u),f&&l.push(m+p))}}for(;i=l.pop();)a.isValidLookup(t)||(r=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(OJ);function nX(e){return e.charAt(0).toUpperCase()+e.slice(1)}var rX=function(){function e(t){cJ(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=IJ.create("languageUtils")}return hJ(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=nX(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=nX(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=nX(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),oX=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],iX={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},aX=["v1","v2","v3"],sX={zero:0,one:1,two:2,few:3,many:4,other:5};function lX(){var e={};return oX.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:iX[t.fc]}}))})),e}var cX=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};cJ(this,e),this.languageUtils=t,this.options=n,this.logger=IJ.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=lX()}return hJ(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return sX[e]-sX[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),o=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!aX.includes(this.options.compatibilityJSON)}}]),e}();function uX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uX(Object(n),!0).forEach((function(t){yJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fX=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};cJ(this,e),this.logger=IJ.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return hJ(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:HJ,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?zJ(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?zJ(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?zJ(t.nestingPrefix):t.nestingPrefixEscaped||zJ("$t("),this.nestingSuffix=t.nestingSuffix?zJ(t.nestingSuffix):t.nestingSuffixEscaped||zJ(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(s.formatSeparator)<0){var o=jJ(t,l,e);return s.alwaysFormat?s.format(o,void 0,n,dX(dX(dX({},r),t),{},{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),c=i.join(s.formatSeparator).trim();return s.format(jJ(t,l,a),c,n,dX(dX(dX({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach((function(t){for(a=0;o=t.regex.exec(e);){var n=o[1].trim();if(void 0===(i=u(n)))if("function"==typeof d){var l=d(e,o,r);i="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))i="";else{if(f){i=o[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=PJ(i));var c=t.safeValue(i);if(e=e.replace(o[0],c),f?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=dX({},i);function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);e=r[0];var i=(o=this.interpolate(o,a)).match(/'/g),s=o.match(/"/g);(i&&i.length%2==0&&!s||s.length%2!=0)&&(o=o.replace(/'/g,'"'));try{a=JSON.parse(o),t&&(a=dX(dX({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(o)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=PJ(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return o.format(e,t,i.lng,dX(dX({},i),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function hX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hX(Object(n),!0).forEach((function(t){yJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mX(e){var t={};return function(n,r,o){var i=r+JSON.stringify(o),a=t[i];return a||(a=e(r,o),t[i]=a),a(n)}}var gX=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};cJ(this,e),this.logger=IJ.create("formatter"),this.options=t,this.formats={number:mX((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:mX((function(e,t){var n=new Intl.NumberFormat(e,pX(pX({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:mX((function(e,t){var n=new Intl.DateTimeFormat(e,pX({},t));return function(e){return n.format(e)}})),relativetime:mX((function(e,t){var n=new Intl.RelativeTimeFormat(e,pX({},t));return function(e){return n.format(e,t.range||"day")}})),list:mX((function(e,t){var n=new Intl.ListFormat(e,pX({},t));return function(e){return n.format(e)}}))},this.init(t)}return hJ(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=mX(t)}},{key:"format",value:function(e,t,n,r){var o=this,i=t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=EJ(e.split(":")),r=t[0],o=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,s=i.formatOptions;if(o.formats[a]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=o.formats[a](e,u,pX(pX(pX({},s),r),c))}catch(e){o.logger.warn(e)}return l}return o.logger.warn("there was no format function for ".concat(a)),e}),e);return i}}]),e}();function vX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vX(Object(n),!0).forEach((function(t){yJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yX(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=bJ(e);if(t){var o=bJ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return vJ(this,n)}}var wX=function(e){gJ(n,e);var t=yX(n);function n(e,r,o){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return cJ(this,n),i=t.call(this),GJ&&OJ.call(pJ(i)),i.backend=e,i.store=r,i.services=o,i.languageUtils=o.languageUtils,i.options=a,i.logger=IJ.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,a.backend,a),i}return hJ(n,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i={},a={},s={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?void 0===a[s]&&(a[s]=!0):(o.state[s]=1,r=!1,void 0===a[s]&&(a[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){var r,s,l,c,u,d;r=n.loaded,s=i,c=LJ(r,[o],Object),u=c.obj,d=c.k,u[d]=u[d]||[],l&&(u[d]=u[d].concat(s)),l||u[d].push(s),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:i,callback:a}):(this.readingCalls++,this.backend[n](e,t,(function(s,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}s&&l&&o<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,o+1,2*i,a)}),i):a(s,l)}))):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,bX(bX({},i),{},{isUpdate:o})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(OJ);function xX(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===lJ(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===lJ(e[2])||"object"===lJ(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function SX(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function MX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?MX(Object(n),!0).forEach((function(t){yJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function EX(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=bJ(e);if(t){var o=bJ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return vJ(this,n)}}function AX(){}function CX(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var kX=function(e){gJ(n,e);var t=EX(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(cJ(this,n),e=t.call(this),GJ&&OJ.call(pJ(e)),e.options=SX(r),e.services={},e.logger=IJ,e.modules={external:[]},CX(pJ(e)),o&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,o),vJ(e,pJ(e));setTimeout((function(){e.init(r,o)}),0)}return e}return hJ(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=xX();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options=_X(_X(_X({},r),this.options),SX(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=_X(_X({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?IJ.init(o(this.modules.logger),this.options):IJ.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=gX);var a=new rX(this.options);this.store=new JJ(this.options.resources,this.options);var s=this.services;s.logger=IJ,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new cX(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=o(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new fX(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new wX(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(s.languageDetector=o(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=o(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new tX(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=AX),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=RJ(),f=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:AX,r=n,o="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return r();var i=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};if(o)a(o);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(i,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=RJ();return e||(e=this.languages),t||(t=this.options.ns),n||(n=AX),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&XJ.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=RJ();this.emit("languageChanging",e);var o=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,o=function e(t,o){var i;if("object"!==lJ(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l<a;l++)s[l-2]=arguments[l];i=r.options.overloadTranslationOptionHandler([t,o].concat(s))}else i=_X({},o);i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns,i.keyPrefix=i.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",u=i.keyPrefix?"".concat(i.keyPrefix).concat(c).concat(t):t;return r.t(u,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=RJ();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=RJ();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:AX,o=_X(_X(_X({},this.options),t),{isClone:!0}),i=new n(o);void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t));var a=["store","services","language"];return a.forEach((function(t){i[t]=e[t]})),i.services=_X({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new tX(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i.emit.apply(i,[e].concat(n))})),i.init(o,r),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(OJ);yJ(kX,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new kX(e,t)}));var TX=kX.createInstance();TX.createInstance=kX.createInstance;TX.createInstance,TX.init,TX.loadResources,TX.reloadResources,TX.use,TX.changeLanguage,TX.getFixedT,TX.t,TX.exists,TX.setDefaultNamespace,TX.hasLoadedNamespace,TX.loadNamespaces,TX.loadLanguages;var IX,OX=TX;IX=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","close":"Chiudi","edit":"Modifica","delete":"Elimina","loading":"Caricamento","copy":"Copia","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Memori bloccato fino al {{date}}","memoriBlockedAnon":"Attualmente \\"{{name}}\\" non può rispondere, torna qui il {{date}}","memoriBlockedReasonExceedChats":"perchè ha superato la soglia mensile di chat ammesse.","memoriBlockedGiverHelper":"Puoi sempre gestirlo in qualità di amministratore, ma altri utenti non potranno interrogarlo.","auth":{"useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","position":"Posizione","settings":"Impostazioni","share":"Condividi","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca sul bottone di invio","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica"},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per parlare con me clicca sul pulsante INIZIAMO per cominciare","instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","chatHistory":"Cronologia chat","exportChatHistory":"Esporta la cronologia chat","exportChatHistoryMessage":"Vuoi esportare la cronologia chat?","chatBotButtonText":"CLICCA QUI PER APRIRE LA CHAT","conversationStartedLabel":"Conversazione avvenuta il","settingsHeaderLabel":"Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","secondsLabel":"Secondi","tryMeHeaderLabel":"PROVA","unknownPosition":"Posizione sconosciuta","fieldPlace":"Indica la posizione (es \'Milano\')","showMapLinkFor":"Visualizza sulla mappa la posizione","useMyPosition":"Usa la mia posizione","myPosition":"Posizione corrente","updatingPosition":"Aggiorno la posizione...","placeNotFound":"Luogo sconosciuto!","requirePosition":"Inserisci la posizione prima di iniziare","attachmentsLabel":"Arricchisci il tuo messaggio","iWantToTalkToIn":"Voglio parlare con {{name}} in"},"media":{"title":"Titolo","editAttributes":"Modifica attributi media","uploadMimeTypeNotAllowed":"Il tipo di file non è permesso","uploadSizeLimitMessage":"Il file caricato è troppo grande (max {{size}}MB)","uploadWrongResolutionMessage":"La risoluzione deve essere {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"Hai già un Twin con questo nome","uploadHelperImages":"Caricare un file con estensione png, jpg, jpeg o gif e con dimensione massima di {{size}}MB","uploadHelper":"Caricare un file di dimensione massima di {{size}}MB","uploadError":"Errore nel caricamento","square":"quadrato","scaleRatio":"Proporzioni","addMediaLabel":"Aggiungi media","insertThisMediaMsg":"Inserisci questi media","mediaUploadMessage":"Clicca per caricare un nuovo media","addLinkLabel":"Aggiungi un link","linkKey":"URL","linkValue":"Titolo link","insertThisLink":"Inserisci un link a {{url}} con titolo {{title}}"},"gamification":{"level":"Livello","points":"punti","memoriReachedLevel":"è diventato più evoluto ed ha raggiunto il livello","levelGoToStatistics":"{{memori}} è al livello {{level}} con {{points}} punti. Clicca per andare alle statistiche.","congratulationsNewLevel":"Congratulazioni, hai raggiunto un nuovo livello!","congratulationsNewLevelDescription":"Il tuo Memori è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_CANT_EDIT_INTEGRATIONS":"Utente non abilitato a gestire integrazioni","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","INTEGRATION_NOT_FOUND":"Integrazione non trovata","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido"}}');const RX={en:{translation:r(JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","close":"Close","edit":"Edit","delete":"Delete","loading":"Loading","copy":"Copy","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Memori blocked until {{date}}","memoriBlockedAnon":"Currently \\"{{name}}\\" can\'t answer, come back here on {{date}}","memoriBlockedReasonExceedChats":"because it has exceeded the monthly threshold of allowed chats.","memoriBlockedGiverHelper":"You can still manage it as administrator, but other users will not be able to interact with it.","auth":{"useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Sound","position":"Position","settings":"Settings","share":"Share","sendOnKeypress":"Hit Enter to send","sendOnClick":"Click on Submit","goToIntegrationsToCustomizeAvatar":"To customize the avatar, go to Share and customize the public page"},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To talk to me click on the START button to get started","instructButton":"INSTRUCT ME","tryMeButton":"START","chatHistory":"Chat history","exportChatHistory":"Export chat history","exportChatHistoryMessage":"Do you want to export chat history?","chatBotButtonText":"CLICK HERE TO OPEN CHATBOT","conversationStartedLabel":"Conversation started on","settingsHeaderLabel":"Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","secondsLabel":"Set seconds","tryMeHeaderLabel":"TRY","unknownPosition":"Unknown position","fieldPlace":"Write the place (eg \'Milano\')","showMapLinkFor":"Show the position on the map","useMyPosition":"Use my position","myPosition":"Your position","updatingPosition":"Updating position...","placeNotFound":"Place not found!","requirePosition":"Insert your position before start","attachmentsLabel":"Enrich your message","iWantToTalkToIn":"I want to talk to {{name}} in"},"media":{"title":"Title","editAttributes":"Edit media attributes","uploadMimeTypeNotAllowed":"The file type is not allowed","uploadSizeLimitMessage":"The uploaded size is too big (max {{size}}MB)","uploadWrongResolutionMessage":"The resolution must be {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"You already have a Twin with this name","uploadHelperImages":"Upload a file with extension png, jpg, jpeg or gif, and having at maximum a size of {{size}}MB","uploadHelper":"Upload a file having at maximum a size of {{size}}MB","uploadError":"Upload failed","square":"square","scaleRatio":"Scale ratio","addMediaLabel":"Add a media","insertThisMediaMsg":"Insert these media","mediaUploadMessage":"Click to load a new media","addLinkLabel":"Add a link","linkKey":"URL","linkValue":"Link title","insertThisLink":"Insert a link to {{url}} with title {{title}}"},"gamification":{"level":"Level","points":"points","memoriReachedLevel":"became more evolved and reached level","levelGoToStatistics":"{{memori}} is at level {{level}} with {{points}} points. Click to go to statistics.","congratulationsNewLevel":"Congratulations, you have reached a new level!","congratulationsNewLevelDescription":"Your Memori became more evolved with {{points}} points, look at the","statistics":"statistics"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_CANT_EDIT_INTEGRATIONS":"User not allowed to manage integrations","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID"}}'))},it:{translation:r(IX)}};OX.use(Gi).init({resources:RX,lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});var PX=OX;const NX=({ownerUserName:e,ownerUserID:t,memoriName:n,memoriID:o,integrationID:i,tenantID:a,secretToken:s,sessionID:l,showShare:c=!0,showSettings:d=!1,showInstruct:f=!1,height:h="100%",baseURL:p,apiURL:m="https://backend.memori.ai",tag:g,pin:v,context:b,initialQuestion:y,uiLang:w,spokenLang:x,authToken:S,AZURE_COGNITIVE_SERVICES_TTS_KEY:M,onStateChange:_})=>{var E,A,C;const[k,T]=(0,u.useState)(),{t:I}=ea();if(!(o&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const O=mi(m),R=(0,u.useCallback)((async()=>{if(o&&t){const{memori:e,...n}=await O.backend.getMemoriByUserAndId(a,t,o);0===n.resultCode&&e?T(e):console.error("[MEMORI]",n,e)}else if(n&&e){const{memori:t,...r}=await O.backend.getMemori(a,e,n);0===r.resultCode&&t?T(t):console.error("[MEMORI]",r,t)}}),[o,t,n,e,a]);return(0,u.useEffect)((()=>{R()}),[R,a]),(0,u.useEffect)((()=>{if(w)PX.changeLanguage(w.toLowerCase());else{const{lng:e,fallbackLng:t}=(()=>{const e=navigator.language;if(e){let t=e.split("-")[0];if(["en","it"].includes(t))return{lng:t,fallbackLng:"en"===t?"it":"en"}}return{lng:"en",fallbackLng:"it"}})();PX.changeLanguage(e).catch((()=>{PX.changeLanguage(t)}))}}),[w]),k?r(u).createElement(sJ,{height:h,baseUrl:p||(a.startsWith("https://")?a:`https://${a}`),apiUrl:m,memori:{...k,secretToken:s},memoriLang:null!=x?x:null===(A=null===(E=k.culture)||void 0===E?void 0:E.split("-"))||void 0===A?void 0:A[0],tenant:{id:a,theme:"twincreator",config:{name:a,showNewUser:!1,requirePosition:!!k.needsPosition}},secret:s,sessionID:l,showShare:c,showSettings:d,showInstruct:f,integration:null===(C=null==k?void 0:k.integrations)||void 0===C?void 0:C.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:b,initialQuestion:y,authToken:S,AZURE_COGNITIVE_SERVICES_TTS_KEY:M,onStateChange:_,...g&&v?{personification:{tag:g,pin:v}}:{}}):r(u).createElement("div",null,r(u).createElement("p",{style:{textAlign:"center",margin:"2rem auto"}},I("loading"),"..."))};NX.propTypes={memoriName:r(l).string,memoriID:r(l).string,ownerUserName:r(l).string,ownerUserID:r(l).string,integrationID:r(l).string,tenantID:r(l).string.isRequired,secretToken:r(l).string,sessionID:r(l).string,showShare:r(l).bool,showSettings:r(l).bool,showInstruct:r(l).bool,height:r(l).oneOfType([r(l).string,r(l).number]),baseURL:r(l).string,apiURL:r(l).string,tag:r(l).string,pin:r(l).string,context:r(l).objectOf(r(l).any),initialQuestion:r(l).string,uiLang:r(l).oneOf(["en","it"]),spokenLang:r(l).string,authToken:r(l).string,AZURE_COGNITIVE_SERVICES_TTS_KEY:r(l).string,onStateChange:r(l).func};var LX=NX;class BX extends HTMLElement{connectedCallback(){const e=document.createElement("div"),t=document.createElement("div");t.setAttribute("id","memori-root");const n=document.createElement("style");n.innerHTML="\n @import url('https://unpkg.com/@memori.ai/memori-webcomponent/dist/memori-webcomponent.css');\n ",e.appendChild(n),e.appendChild(t),this.appendChild(e);const o=Object.keys(LX.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t)),e)),{}),i=this.getAttribute("tenantId"),a=this.getAttribute("context")?.split(",")?.reduce(((e,t)=>{const[n,r]=t.split(":").map((e=>e.trim()));return{...e,[n]:r}}),{});i?r(c).render((0,s.jsx)(LX,{...o,context:a,tenantID:i}),t):console.error("No tenantId attribute found")}}customElements.define("memori-client",BX)})();