onairos 0.1.152 → 0.1.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/onairos.bundle.js +1 -1
- package/dist/onairos.bundle.js.map +1 -1
- package/dist/onairos.js +20 -23
- package/package.json +1 -1
- package/src/onairos.jsx +16 -16
package/dist/onairos.bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(()=>(()=>{"use strict";var e,t,r,n,o={408:(e,t)=>{var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.iterator;var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,b={};function m(e,t,r){this.props=e,this.context=t,this.refs=b,this.updater=r||y}function w(){}function g(e,t,r){this.props=e,this.context=t,this.refs=b,this.updater=r||y}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=m.prototype;var v=g.prototype=new w;v.constructor=g,h(v,m.prototype),v.isPureReactComponent=!0;var E=Array.isArray,_=Object.prototype.hasOwnProperty,O={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,n){var o,a={},i=null,c=null;if(null!=t)for(o in void 0!==t.ref&&(c=t.ref),void 0!==t.key&&(i=""+t.key),t)_.call(t,o)&&!S.hasOwnProperty(o)&&(a[o]=t[o]);var u=arguments.length-2;if(1===u)a.children=n;else if(1<u){for(var s=Array(u),l=0;l<u;l++)s[l]=arguments[l+2];a.children=s}if(e&&e.defaultProps)for(o in u=e.defaultProps)void 0===a[o]&&(a[o]=u[o]);return{$$typeof:r,type:e,key:i,ref:c,props:a,_owner:O.current}}function j(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var C=/\/+/g;function P(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function A(e,t,o,a,i){var c=typeof e;"undefined"!==c&&"boolean"!==c||(e=null);var u=!1;if(null===e)u=!0;else switch(c){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case r:case n:u=!0}}if(u)return i=i(u=e),e=""===a?"."+P(u,0):a,E(i)?(o="",null!=e&&(o=e.replace(C,"$&/")+"/"),A(i,t,o,"",(function(e){return e}))):null!=i&&(j(i)&&(i=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,o+(!i.key||u&&u.key===i.key?"":(""+i.key).replace(C,"$&/")+"/")+e)),t.push(i)),1;if(u=0,a=""===a?".":a+":",E(e))for(var s=0;s<e.length;s++){var l=a+P(c=e[s],s);u+=A(c,t,o,l,i)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e),"function"==typeof l)for(e=l.call(e),s=0;!(c=e.next()).done;)u+=A(c=c.value,t,o,l=a+P(c,s++),i);else if("object"===c)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return u}function x(e,t,r){if(null==e)return e;var n=[],o=0;return A(e,n,"","",(function(e){return t.call(r,e,o++)})),n}function I(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var N={current:null},R={transition:null},T={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:R,ReactCurrentOwner:O};t.Children={map:x,forEach:function(e,t,r){x(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return x(e,(function(){t++})),t},toArray:function(e){return x(e,(function(e){return e}))||[]},only:function(e){if(!j(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=m,t.Fragment=o,t.Profiler=i,t.PureComponent=g,t.StrictMode=a,t.Suspense=l,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T,t.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=h({},e.props),a=e.key,i=e.ref,c=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,c=O.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(s in t)_.call(t,s)&&!S.hasOwnProperty(s)&&(o[s]=void 0===t[s]&&void 0!==u?u[s]:t[s])}var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){u=Array(s);for(var l=0;l<s;l++)u[l]=arguments[l+2];o.children=u}return{$$typeof:r,type:e.type,key:a,ref:i,props:o,_owner:c}},t.createContext=function(e){return(e={$$typeof:u,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},t.createElement=k,t.createFactory=function(e){var t=k.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:s,render:e}},t.isValidElement=j,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:I}},t.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=R.transition;R.transition={};try{e()}finally{R.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return N.current.useCallback(e,t)},t.useContext=function(e){return N.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return N.current.useDeferredValue(e)},t.useEffect=function(e,t){return N.current.useEffect(e,t)},t.useId=function(){return N.current.useId()},t.useImperativeHandle=function(e,t,r){return N.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return N.current.useMemo(e,t)},t.useReducer=function(e,t,r){return N.current.useReducer(e,t,r)},t.useRef=function(e){return N.current.useRef(e)},t.useState=function(e){return N.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return N.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return N.current.useTransition()},t.version="18.2.0"},294:(e,t,r)=>{e.exports=r(408)}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return o[e].call(r.exports,r,r.exports,i),r.exports}i.m=o,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var o=Object.create(null);i.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var c=2&n&&r;"object"==typeof c&&!~e.indexOf(c);c=t(c))Object.getOwnPropertyNames(c).forEach((e=>a[e]=()=>r[e]));return a.default=()=>r,i.d(o,a),o},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>({423:"sha256",874:"othent-kms"}[e]+".js"),i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},n="onairos:",i.l=(e,t,o,a)=>{if(r[e])r[e].push(t);else{var c,u;if(void 0!==o)for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){var f=s[l];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==n+o){c=f;break}}c||(u=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,i.nc&&c.setAttribute("nonce",i.nc),c.setAttribute("data-webpack",n+o),c.src=e),r[e]=[t];var p=(t,n)=>{c.onerror=c.onload=null,clearTimeout(d);var o=r[e];if(delete r[e],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((e=>e(n))),t)return t(n)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=p.bind(null,c.onerror),c.onload=p.bind(null,c.onload),u&&document.head.appendChild(c)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="/",(()=>{var e={179:0};i.f.j=(t,r)=>{var n=i.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=o);var a=i.p+i.u(t),c=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",c.name="ChunkLoadError",c.type=o,c.request=a,n[1](c)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,a=r[0],c=r[1],u=r[2],s=0;if(a.some((t=>0!==e[t]))){for(n in c)i.o(c,n)&&(i.m[n]=c[n]);if(u)u(i)}for(t&&t(r);s<a.length;s++)o=a[s],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=this.webpackChunkonairos=this.webpackChunkonairos||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var c={};return(()=>{i.r(c),i.d(c,{Onairos:()=>o});var e=i(294);async function t(e,t){try{const r=function(e){const t=e.replace(/-----BEGIN PUBLIC KEY-----/,"").replace(/-----END PUBLIC KEY-----/,"").replace(/\s/g,""),r=window.atob(t),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}(e),n=await window.crypto.subtle.importKey("spki",r,{name:"RSA-OAEP",hash:{name:"SHA-256"}},!0,["encrypt"]);return function(e){try{let t="";const r=new Uint8Array(e),n=r.byteLength;for(let e=0;e<n;e++)t+=String.fromCharCode(r[e]);return window.btoa(t)}catch(e){console.error("Eror in buffertoBase64 : ",e)}}(await window.crypto.subtle.encrypt({name:"RSA-OAEP"},n,(new TextEncoder).encode(t)))}catch(e){return console.error("rsaEncrypt error:",e),null}}const r=async()=>(await i.e(423).then(i.t.bind(i,153,23))).default,n=async()=>{try{console.log("Entering Dynamic Othent Load");const e=await i.e(874).then(i.bind(i,981));return console.log("DYNAMICALLY LOADED OTHENT"),e}catch(e){console.error("Error loading Othent DYnamically : ",e)}};function o(o){let{requestData:a,webpageName:i,proofMode:c=!1}=o;const u=window.location.href,s=async()=>{try{console.log("Main initiate othent");const{connect:e}=await n();console.log("Main loaded othent");const o=await e(),s=(await r())(o.sub).toString(),l=await async function(e){const t={Info:{hashedOthentSub:e},request:"PIN"};return await fetch("https://api2.onairos.uk/getAccountInfoFromOthentSub",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>e.json())).then((e=>e)).catch((e=>console.error(e)))}(s);function f(e){try{const t=window.atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r.buffer}catch(e){console.error("Error converting to Buffer :",e)}}const p=f(l.result),{decrypt:d}=await n();t("\n -----BEGIN PUBLIC KEY-----\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4wkWvRPaJiY8CwQ5BoJI\n amcGAYV91Bk8NrvWq4PXM+J/RJugfgTNCYKQ/c6g4xa1YES/tJEzFS7nf0Kdoqxm\n 5aav0ru5vS4fc4vCOLTI9W1T7nj02NY91rogsQm2/KMxUQ8DaLeTZKi+0Wjsa9YO\n 6XGGd1wh4azgQkj04MWW5J1EBCcBavKoY+C85oA9jkkklQ8nGWgbugmZs7eXHNQb\n qH8/ZHcB9Kx1CZ6XjQuVd6YE/A+swV+DksbkXANcYjr6SY/2TbB8GfpcOMM3bkyN\n Q8e0A51q5a8abfuAkDZXe67MwKMWu/626abwPZhJrKr5HhRZZDwPtnXlktYHhOK6\n lQIDAQAB\n -----END PUBLIC KEY-----\n ",await d(p)).then((e=>{window.postMessage({source:"webpage",type:"GET_API_URL",webpageName:i,domain:u,requestData:a,proofMode:c,HashedOthentSub:s,EncryptedUserPin:e})})).catch((e=>{console.error("Encryption failed:",e)}))}catch(y){console.error({fix:"Please ensure you have stored your model"}),console.error("Error Sending Data to Terminal: ",y)}};return e.createElement("div",null,e.createElement("button",{className:"OnairosConnect w-20 h-20 flex flex-col items-center justify-center text-white font-bold py-2 px-4 rounded cursor-pointer",onClick:async()=>{if(void 0!==window.onairos?(console.log("Onairos is installed!"),console.log("Onairos info:",window.onairos.getInfo())):console.log("Onairos is not installed."),window.addEventListener("onairosReady",(function(){console.log("Onairos was just detected!")})),void 0!==window.onairos)if(console.log("Onairos extension installed"),(async()=>fetch("http://localhost:8080/valid/validate-domain",{method:"POST",headers:{"Content-Type":"application/json"}}).then((e=>e.json().then((t=>({status:e.status,body:t}))))).catch((e=>console.error(e))))().body.status){console.log("Domain validated");try{(()=>{const e=["Small","Medium","Large"],t=["type","descriptions","reward"];if("string"!=typeof i)throw new Error("Property webpageName must be a String");for(const r of e){if(!(r in a))throw new Error("Missing key '".concat(r,"' in requestData."));for(const e of t){if(!(e in a[r]))throw new Error("Missing property '".concat(e,"' in requestData.").concat(r,"."));if("reward"!==e&&"string"!=typeof a[r][e])throw new Error("Property '".concat(e,"' in requestData.").concat(r," must be a string."));if("reward"!==e&&""===a[r][e].trim())throw new Error("Property '".concat(e,"' in requestData.").concat(r," cannot be empty."))}}})(),await s()}catch(e){console.error("Error connecting to Onairos",e)}}else console.error("Please make sure this is an Onairos Partnered app");else window.open("https://chromewebstore.google.com/detail/onairos/apkfageplidiblifhnadehmplfccapkf","_blank")}},e.createElement("img",{src:"https://onairos.sirv.com/Images/OnairosBlack.png",alt:"Onairos Logo",className:"w-16 h-16 object-contain mb-2"})," ",e.createElement("span",{className:"whitespace-nowrap"},"Connect to Onairos")," "))}})(),c})()));
|
|
1
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(this,(()=>(()=>{var t,e,r,n,o={742:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=a(t),s=i[0],c=i[1],u=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,c)),f=0,l=c>0?s-4:s;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[f++]=255&e);1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,a=0,u=n-o;a<u;a+=s)i.push(c(t,a,a+s>u?u:a+s));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var o,i,s=[],a=e;a<n;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},764:(t,e,r)=>{"use strict";const n=r(742),o=r(645),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=c,e.h2=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=a(r);const o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(G(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(G(t,ArrayBuffer)||t&&G(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(G(t,SharedArrayBuffer)||t&&G(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const o=function(t){if(c.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||H(t.length)?a(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return f(t),a(t<0?0:0|p(t))}function h(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,c.prototype),n}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function g(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||G(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(o)return n?-1:J(t).length;e=(""+e).toLowerCase(),o=!0}}function y(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return B(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return _(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){let i,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){let n=-1;for(i=r;i<a;i++)if(u(t,i)===u(e,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===c)return n*s}else-1!==n&&(i-=i-n),n=-1}else for(r+c>a&&(r=a-c),i=r;i>=0;i--){let r=!0;for(let n=0;n<c;n++)if(u(t,i+n)!==u(e,n)){r=!1;break}if(r)return i}return-1}function v(t,e,r,n){r=Number(r)||0;const o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=e.length;let s;for(n>i/2&&(n=i/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(H(n))return s;t[r+s]=n}return s}function E(t,e,r,n){return V(J(e,t.length-r),t,r,n)}function S(t,e,r,n){return V(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function k(t,e,r,n){return V(Y(e),t,r,n)}function I(t,e,r,n){return V(function(t,e){let r,n,o;const i=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function B(t,e,r){r=Math.min(t.length,r);const n=[];let o=e;for(;o<r;){const e=t[o];let i=null,s=e>239?4:e>223?3:e>191?2:1;if(o+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(i=e);break;case 2:r=t[o+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(i=c));break;case 3:r=t[o+1],n=t[o+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:r=t[o+1],n=t[o+2],a=t[o+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}return function(t){const e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=T));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},c.allocUnsafe=function(t){return l(t)},c.allocUnsafeSlow=function(t){return l(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(G(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),G(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).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}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=c.allocUnsafe(e);let o=0;for(r=0;r<t.length;++r){let e=t[r];if(G(e,Uint8Array))o+e.length>n.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?B(this,0,t):y.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const r=e.h2;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,o){if(G(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;let i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(i,s),u=this.slice(n,o),f=t.slice(e,r);for(let t=0;t<a;++t)if(u[t]!==f[t]){i=u[t],s=f[t];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function A(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function _(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function R(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=e;n<r;++n)o+=$[t[n]];return o}function U(t,e,r){const n=t.slice(e,r);let o="";for(let t=0;t<n.length-1;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function j(t,e,r,n,o){D(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function P(t,e,r,n,o){D(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i>>=8,t[r+6]=i,i>>=8,t[r+5]=i,i>>=8,t[r+4]=i;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function x(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,i){return e=+e,r>>>=0,i||x(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function Z(t,e,r,n,i){return e=+e,r>>>=0,i||x(t,0,r,8),o.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=q((function(t){F(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||M(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,o=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))})),c.prototype.readBigUInt64BE=q((function(t){F(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||M(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],o=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,o=1,i=this[t+--n];for(;n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=q((function(t){F(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||M(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),c.prototype.readBigInt64BE=q((function(t){F(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||M(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){L(this,t,e,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){L(this,t,e,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=q((function(t,e=0){return j(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=q((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}let o=0,i=1,s=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[e+o]=255&t;--o>=0&&(i*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=q((function(t,e=0){return j(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=q((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return Z(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return Z(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{const i=c.isBuffer(t)?t:c.from(t,n),s=i.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=i[o%s]}return this};const K={};function z(t,e,r){K[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function W(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function D(t,e,r,n,o,i){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let o;throw o=i>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new K.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){F(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||M(e,t.length-(r+1))}(n,o,i)}function F(t,e){if("number"!=typeof t)throw new K.ERR_INVALID_ARG_TYPE(e,"number",t)}function M(t,e,r){if(Math.floor(t)!==t)throw F(t,r),new K.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new K.ERR_BUFFER_OUT_OF_BOUNDS;throw new K.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}z("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),z("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),z("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=W(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=W(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n}),RangeError);const X=/[^+/0-9A-Za-z-_]/g;function J(t,e){let r;e=e||1/0;const n=t.length;let o=null;const i=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function Y(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function G(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function H(t){return t!=t}const $=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function q(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},645:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,u=c>>1,f=-7,l=r?o-1:0,h=r?-1:1,d=t[e+l];for(l+=h,i=d&(1<<-f)-1,d>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),i-=u}return(d?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,c,u=8*i-o-1,f=(1<<u)-1,l=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(s++,c/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*c-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[r+d]=255&a,d+=p,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*g}},408:(t,e)=>{"use strict";var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,y={};function m(t,e,r){this.props=t,this.context=e,this.refs=y,this.updater=r||p}function w(){}function b(t,e,r){this.props=t,this.context=e,this.refs=y,this.updater=r||p}m.prototype.isReactComponent={},m.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},m.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},w.prototype=m.prototype;var v=b.prototype=new w;v.constructor=b,g(v,m.prototype),v.isPureReactComponent=!0;var E=Array.isArray,S=Object.prototype.hasOwnProperty,k={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function O(t,e,n){var o,i={},s=null,a=null;if(null!=e)for(o in void 0!==e.ref&&(a=e.ref),void 0!==e.key&&(s=""+e.key),e)S.call(e,o)&&!I.hasOwnProperty(o)&&(i[o]=e[o]);var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){for(var u=Array(c),f=0;f<c;f++)u[f]=arguments[f+2];i.children=u}if(t&&t.defaultProps)for(o in c=t.defaultProps)void 0===i[o]&&(i[o]=c[o]);return{$$typeof:r,type:t,key:s,ref:a,props:i,_owner:k.current}}function B(t){return"object"==typeof t&&null!==t&&t.$$typeof===r}var T=/\/+/g;function A(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,(function(t){return e[t]}))}(""+t.key):e.toString(36)}function _(t,e,o,i,s){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var c=!1;if(null===t)c=!0;else switch(a){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case r:case n:c=!0}}if(c)return s=s(c=t),t=""===i?"."+A(c,0):i,E(s)?(o="",null!=t&&(o=t.replace(T,"$&/")+"/"),_(s,e,o,"",(function(t){return t}))):null!=s&&(B(s)&&(s=function(t,e){return{$$typeof:r,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}(s,o+(!s.key||c&&c.key===s.key?"":(""+s.key).replace(T,"$&/")+"/")+t)),e.push(s)),1;if(c=0,i=""===i?".":i+":",E(t))for(var u=0;u<t.length;u++){var f=i+A(a=t[u],u);c+=_(a,e,o,f,s)}else if(f=function(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=d&&t[d]||t["@@iterator"])?t:null}(t),"function"==typeof f)for(t=f.call(t),u=0;!(a=t.next()).done;)c+=_(a=a.value,e,o,f=i+A(a,u++),s);else if("object"===a)throw e=String(t),Error("Objects are not valid as a React child (found: "+("[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return c}function R(t,e,r){if(null==t)return t;var n=[],o=0;return _(t,n,"","",(function(t){return e.call(r,t,o++)})),n}function U(t){if(-1===t._status){var e=t._result;(e=e()).then((function(e){0!==t._status&&-1!==t._status||(t._status=1,t._result=e)}),(function(e){0!==t._status&&-1!==t._status||(t._status=2,t._result=e)})),-1===t._status&&(t._status=0,t._result=e)}if(1===t._status)return t._result.default;throw t._result}var C={current:null},L={transition:null},j={ReactCurrentDispatcher:C,ReactCurrentBatchConfig:L,ReactCurrentOwner:k};e.Children={map:R,forEach:function(t,e,r){R(t,(function(){e.apply(this,arguments)}),r)},count:function(t){var e=0;return R(t,(function(){e++})),e},toArray:function(t){return R(t,(function(t){return t}))||[]},only:function(t){if(!B(t))throw Error("React.Children.only expected to receive a single React element child.");return t}},e.Component=m,e.Fragment=o,e.Profiler=s,e.PureComponent=b,e.StrictMode=i,e.Suspense=f,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,e.cloneElement=function(t,e,n){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=g({},t.props),i=t.key,s=t.ref,a=t._owner;if(null!=e){if(void 0!==e.ref&&(s=e.ref,a=k.current),void 0!==e.key&&(i=""+e.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(u in e)S.call(e,u)&&!I.hasOwnProperty(u)&&(o[u]=void 0===e[u]&&void 0!==c?c[u]:e[u])}var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){c=Array(u);for(var f=0;f<u;f++)c[f]=arguments[f+2];o.children=c}return{$$typeof:r,type:t.type,key:i,ref:s,props:o,_owner:a}},e.createContext=function(t){return(t={$$typeof:c,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:t},t.Consumer=t},e.createElement=O,e.createFactory=function(t){var e=O.bind(null,t);return e.type=t,e},e.createRef=function(){return{current:null}},e.forwardRef=function(t){return{$$typeof:u,render:t}},e.isValidElement=B,e.lazy=function(t){return{$$typeof:h,_payload:{_status:-1,_result:t},_init:U}},e.memo=function(t,e){return{$$typeof:l,type:t,compare:void 0===e?null:e}},e.startTransition=function(t){var e=L.transition;L.transition={};try{t()}finally{L.transition=e}},e.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},e.useCallback=function(t,e){return C.current.useCallback(t,e)},e.useContext=function(t){return C.current.useContext(t)},e.useDebugValue=function(){},e.useDeferredValue=function(t){return C.current.useDeferredValue(t)},e.useEffect=function(t,e){return C.current.useEffect(t,e)},e.useId=function(){return C.current.useId()},e.useImperativeHandle=function(t,e,r){return C.current.useImperativeHandle(t,e,r)},e.useInsertionEffect=function(t,e){return C.current.useInsertionEffect(t,e)},e.useLayoutEffect=function(t,e){return C.current.useLayoutEffect(t,e)},e.useMemo=function(t,e){return C.current.useMemo(t,e)},e.useReducer=function(t,e,r){return C.current.useReducer(t,e,r)},e.useRef=function(t){return C.current.useRef(t)},e.useState=function(t){return C.current.useState(t)},e.useSyncExternalStore=function(t,e,r){return C.current.useSyncExternalStore(t,e,r)},e.useTransition=function(){return C.current.useTransition()},e.version="18.2.0"},294:(t,e,r)=>{"use strict";t.exports=r(408)}},i={};function s(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return o[t].call(r.exports,r,r.exports,s),r.exports}s.m=o,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,s.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var o=Object.create(null);s.r(o);var i={};t=t||[null,e({}),e([]),e(e)];for(var a=2&n&&r;"object"==typeof a&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach((t=>i[t]=()=>r[t]));return i.default=()=>r,s.d(o,i),o},s.d=(t,e)=>{for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce(((e,r)=>(s.f[r](t,e),e)),[])),s.u=t=>"sha256.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r={},n="onairos:",s.l=(t,e,o,i)=>{if(r[t])r[t].push(e);else{var a,c;if(void 0!==o)for(var u=document.getElementsByTagName("script"),f=0;f<u.length;f++){var l=u[f];if(l.getAttribute("src")==t||l.getAttribute("data-webpack")==n+o){a=l;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",n+o),a.src=t),r[t]=[e];var h=(e,n)=>{a.onerror=a.onload=null,clearTimeout(d);var o=r[t];if(delete r[t],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((t=>t(n))),e)return e(n)},d=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),c&&document.head.appendChild(a)}},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.p="/",(()=>{var t={179:0};s.f.j=(e,r)=>{var n=s.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=t[e]=[r,o]));r.push(n[2]=o);var i=s.p+s.u(e),a=new Error;s.l(i,(r=>{if(s.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,n[1](a)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,o,i=r[0],a=r[1],c=r[2],u=0;if(i.some((e=>0!==t[e]))){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);if(c)c(s)}for(e&&e(r);u<i.length;u++)o=i[u],s.o(t,o)&&t[o]&&t[o][0](),t[o]=0},r=this.webpackChunkonairos=this.webpackChunkonairos||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var a={};return(()=>{"use strict";s.r(a),s.d(a,{Onairos:()=>rn});var t={};s.r(t),s.d(t,{hasBrowserEnv:()=>ee,hasStandardBrowserEnv:()=>re,hasStandardBrowserWebWorkerEnv:()=>oe});var e=s(294);class r extends Error{}function n(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(t){return decodeURIComponent(atob(t).replace(/(.)/g,((t,e)=>{let r=e.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(e)}catch(t){return atob(e)}}function o(t,e){if("string"!=typeof t)throw new r("Invalid token specified: must be a string");e||(e={});const o=!0===e.header?0:1,i=t.split(".")[o];if("string"!=typeof i)throw new r(`Invalid token specified: missing part #${o+1}`);let s;try{s=n(i)}catch(t){throw new r(`Invalid token specified: invalid base64 for part #${o+1} (${t.message})`)}try{return JSON.parse(s)}catch(t){throw new r(`Invalid token specified: invalid json for part #${o+1} (${t.message})`)}}function i(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}r.prototype.name="InvalidTokenError","function"==typeof SuppressedError&&SuppressedError;var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==s.g?s.g:"undefined"!=typeof self?self:{};function u(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function f(t,e){return t(e={exports:{}},e.exports),e.exports}var l=f((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){var t=this;this.locked=new Map,this.addToLocked=function(e,r){var n=t.locked.get(e);void 0===n?void 0===r?t.locked.set(e,[]):t.locked.set(e,[r]):void 0!==r&&(n.unshift(r),t.locked.set(e,n))},this.isLocked=function(e){return t.locked.has(e)},this.lock=function(e){return new Promise((function(r,n){t.isLocked(e)?t.addToLocked(e,r):(t.addToLocked(e),r())}))},this.unlock=function(e){var r=t.locked.get(e);if(void 0!==r&&0!==r.length){var n=r.pop();t.locked.set(e,r),void 0!==n&&setTimeout(n,0)}else t.locked.delete(e)}}return t.getInstance=function(){return void 0===t.instance&&(t.instance=new t),t.instance},t}();e.default=function(){return r.getInstance()}}));u(l);var h=u(f((function(t,e){var r=c&&c.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new r((function(e){e(t.value)})).then(s,a)}c((n=n.apply(t,e||[])).next())}))},n=c&&c.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},o=c;Object.defineProperty(e,"__esModule",{value:!0});var i="browser-tabs-lock-key",s={key:function(t){return r(o,void 0,void 0,(function(){return n(this,(function(t){throw new Error("Unsupported")}))}))},getItem:function(t){return r(o,void 0,void 0,(function(){return n(this,(function(t){throw new Error("Unsupported")}))}))},clear:function(){return r(o,void 0,void 0,(function(){return n(this,(function(t){return[2,window.localStorage.clear()]}))}))},removeItem:function(t){return r(o,void 0,void 0,(function(){return n(this,(function(t){throw new Error("Unsupported")}))}))},setItem:function(t,e){return r(o,void 0,void 0,(function(){return n(this,(function(t){throw new Error("Unsupported")}))}))},keySync:function(t){return window.localStorage.key(t)},getItemSync:function(t){return window.localStorage.getItem(t)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(t){return window.localStorage.removeItem(t)},setItemSync:function(t,e){return window.localStorage.setItem(t,e)}};function a(t){return new Promise((function(e){return setTimeout(e,t)}))}function u(t){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",r="",n=0;n<t;n++)r+=e[Math.floor(61*Math.random())];return r}var f=function(){function t(e){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=e,void 0===t.waiters&&(t.waiters=[])}return t.prototype.acquireLock=function(e,o){return void 0===o&&(o=5e3),r(this,void 0,void 0,(function(){var r,c,f,l,h,d,p;return n(this,(function(n){switch(n.label){case 0:r=Date.now()+u(4),c=Date.now()+o,f=i+"-"+e,l=void 0===this.storageHandler?s:this.storageHandler,n.label=1;case 1:return Date.now()<c?[4,a(30)]:[3,8];case 2:return n.sent(),null!==l.getItemSync(f)?[3,5]:(h=this.id+"-"+e+"-"+r,[4,a(Math.floor(25*Math.random()))]);case 3:return n.sent(),l.setItemSync(f,JSON.stringify({id:this.id,iat:r,timeoutKey:h,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,a(30)];case 4:return n.sent(),null!==(d=l.getItemSync(f))&&(p=JSON.parse(d)).id===this.id&&p.iat===r?(this.acquiredIatSet.add(r),this.refreshLockWhileAcquired(f,r),[2,!0]):[3,7];case 5:return t.lockCorrector(void 0===this.storageHandler?s:this.storageHandler),[4,this.waitForSomethingToChange(c)];case 6:n.sent(),n.label=7;case 7:return r=Date.now()+u(4),[3,1];case 8:return[2,!1]}}))}))},t.prototype.refreshLockWhileAcquired=function(t,e){return r(this,void 0,void 0,(function(){var o=this;return n(this,(function(i){return setTimeout((function(){return r(o,void 0,void 0,(function(){var r,o,i;return n(this,(function(n){switch(n.label){case 0:return[4,l.default().lock(e)];case 1:return n.sent(),this.acquiredIatSet.has(e)?(r=void 0===this.storageHandler?s:this.storageHandler,null===(o=r.getItemSync(t))?(l.default().unlock(e),[2]):((i=JSON.parse(o)).timeRefreshed=Date.now(),r.setItemSync(t,JSON.stringify(i)),l.default().unlock(e),this.refreshLockWhileAcquired(t,e),[2])):(l.default().unlock(e),[2])}}))}))}),1e3),[2]}))}))},t.prototype.waitForSomethingToChange=function(e){return r(this,void 0,void 0,(function(){return n(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(r){var n=!1,o=Date.now(),i=!1;function s(){if(i||(window.removeEventListener("storage",s),t.removeFromWaiting(s),clearTimeout(a),i=!0),!n){n=!0;var e=50-(Date.now()-o);e>0?setTimeout(r,e):r(null)}}window.addEventListener("storage",s),t.addToWaiting(s);var a=setTimeout(s,Math.max(0,e-Date.now()))}))];case 1:return r.sent(),[2]}}))}))},t.addToWaiting=function(e){this.removeFromWaiting(e),void 0!==t.waiters&&t.waiters.push(e)},t.removeFromWaiting=function(e){void 0!==t.waiters&&(t.waiters=t.waiters.filter((function(t){return t!==e})))},t.notifyWaiters=function(){void 0!==t.waiters&&t.waiters.slice().forEach((function(t){return t()}))},t.prototype.releaseLock=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.releaseLock__private__(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.releaseLock__private__=function(e){return r(this,void 0,void 0,(function(){var r,o,a,c;return n(this,(function(n){switch(n.label){case 0:return r=void 0===this.storageHandler?s:this.storageHandler,o=i+"-"+e,null===(a=r.getItemSync(o))?[2]:(c=JSON.parse(a)).id!==this.id?[3,2]:[4,l.default().lock(c.iat)];case 1:n.sent(),this.acquiredIatSet.delete(c.iat),r.removeItemSync(o),l.default().unlock(c.iat),t.notifyWaiters(),n.label=2;case 2:return[2]}}))}))},t.lockCorrector=function(e){for(var r=Date.now()-5e3,n=e,o=[],s=0;;){var a=n.keySync(s);if(null===a)break;o.push(a),s++}for(var c=!1,u=0;u<o.length;u++){var f=o[u];if(f.includes(i)){var l=n.getItemSync(f);if(null!==l){var h=JSON.parse(l);(void 0===h.timeRefreshed&&h.timeAcquired<r||void 0!==h.timeRefreshed&&h.timeRefreshed<r)&&(n.removeItemSync(f),c=!0)}}}c&&t.notifyWaiters()},t.waiters=void 0,t}();e.default=f})));const d={timeoutInSeconds:60},p={name:"auth0-spa-js",version:"2.1.3"},g=()=>Date.now();class y extends Error{constructor(t,e){super(e),this.error=t,this.error_description=e,Object.setPrototypeOf(this,y.prototype)}static fromPayload({error:t,error_description:e}){return new y(t,e)}}class m extends y{constructor(t,e,r,n=null){super(t,e),this.state=r,this.appState=n,Object.setPrototypeOf(this,m.prototype)}}class w extends y{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,w.prototype)}}class b extends w{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,b.prototype)}}class v extends y{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,v.prototype)}}class E extends y{constructor(t,e,r){super(t,e),this.mfa_token=r,Object.setPrototypeOf(this,E.prototype)}}class S extends y{constructor(t,e){super("missing_refresh_token",`Missing Refresh Token (audience: '${k(t,["default"])}', scope: '${k(e)}')`),this.audience=t,this.scope=e,Object.setPrototypeOf(this,S.prototype)}}function k(t,e=[]){return t&&!e.includes(t)?t:""}const I=()=>window.crypto,O=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(I().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%66])),e},B=t=>btoa(t),T=t=>{var{clientId:e}=t,r=i(t,["clientId"]);return new URLSearchParams((t=>Object.keys(t).filter((e=>void 0!==t[e])).reduce(((e,r)=>Object.assign(Object.assign({},e),{[r]:t[r]})),{}))(Object.assign({client_id:e},r))).toString()},A=t=>(t=>decodeURIComponent(atob(t).split("").map((t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2))).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),_=async(t,e)=>{const r=await fetch(t,e);return{ok:r.ok,json:await r.json()}},R=async(t,e,r,n,o,i,s=1e4)=>o?(async(t,e,r,n,o,i,s)=>{return a={auth:{audience:e,scope:r},timeout:o,fetchUrl:t,fetchOptions:n,useFormData:s},c=i,new Promise((function(t,e){const r=new MessageChannel;r.port1.onmessage=function(n){n.data.error?e(new Error(n.data.error)):t(n.data),r.port1.close()},c.postMessage(a,[r.port2])}));var a,c})(t,e,r,n,s,o,i):(async(t,e,r)=>{const n=new AbortController;let o;return e.signal=n.signal,Promise.race([_(t,e),new Promise(((t,e)=>{o=setTimeout((()=>{n.abort(),e(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(o)}))})(t,n,s);async function U(t,e){var{baseUrl:r,timeout:n,audience:o,scope:s,auth0Client:a,useFormData:c}=t,u=i(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=c?T(u):JSON.stringify(u);return await async function(t,e,r,n,o,s,a){let c,u=null;for(let i=0;i<3;i++)try{c=await R(t,r,n,o,s,a,e),u=null;break}catch(t){u=t}if(u)throw u;const f=c.json,{error:l,error_description:h}=f,d=i(f,["error","error_description"]),{ok:p}=c;if(!p){const e=h||`HTTP error. Unable to fetch ${t}`;if("mfa_required"===l)throw new E(l,e,d.mfa_token);if("missing_refresh_token"===l)throw new S(r,n);throw new y(l||"request_error",e)}return d}(`${r}/oauth/token`,n,o||"default",s,{method:"POST",body:f,headers:{"Content-Type":c?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(a||p))}},e,c)}const C=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e};class L{constructor(t,e="@@auth0spajs@@",r){this.prefix=e,this.suffix=r,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[e,r,n,o]=t.split("::");return new L({clientId:r,scope:o,audience:n},e)}static fromCacheEntry(t){const{scope:e,audience:r,client_id:n}=t;return new L({scope:e,audience:r,clientId:n})}}class j{set(t,e){localStorage.setItem(t,JSON.stringify(e))}get(t){const e=window.localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch(t){return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter((t=>t.startsWith("@@auth0spajs@@")))}}class P{constructor(){this.enclosedCache=function(){let t={};return{set(e,r){t[e]=r},get(e){const r=t[e];if(r)return r},remove(e){delete t[e]},allKeys:()=>Object.keys(t)}}()}}class x{constructor(t,e,r){this.cache=t,this.keyManifest=e,this.nowProvider=r||g}async setIdToken(t,e,r){var n;const o=this.getIdTokenCacheKey(t);await this.cache.set(o,{id_token:e,decodedToken:r}),await(null===(n=this.keyManifest)||void 0===n?void 0:n.add(o))}async getIdToken(t){const e=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!e&&t.scope&&t.audience){const e=await this.get(t);if(!e)return;if(!e.id_token||!e.decodedToken)return;return{id_token:e.id_token,decodedToken:e.decodedToken}}if(e)return{id_token:e.id_token,decodedToken:e.decodedToken}}async get(t,e=0){var r;let n=await this.cache.get(t.toKey());if(!n){const e=await this.getCacheKeys();if(!e)return;const r=this.matchExistingCacheKey(t,e);r&&(n=await this.cache.get(r))}if(!n)return;const o=await this.nowProvider(),i=Math.floor(o/1e3);return n.expiresAt-e<i?n.body.refresh_token?(n.body={refresh_token:n.body.refresh_token},await this.cache.set(t.toKey(),n),n.body):(await this.cache.remove(t.toKey()),void await(null===(r=this.keyManifest)||void 0===r?void 0:r.remove(t.toKey()))):n.body}async set(t){var e;const r=new L({clientId:t.client_id,scope:t.scope,audience:t.audience}),n=await this.wrapCacheEntry(t);await this.cache.set(r.toKey(),n),await(null===(e=this.keyManifest)||void 0===e?void 0:e.add(r.toKey()))}async clear(t){var e;const r=await this.getCacheKeys();r&&(await r.filter((e=>!t||e.includes(t))).reduce((async(t,e)=>{await t,await this.cache.remove(e)}),Promise.resolve()),await(null===(e=this.keyManifest)||void 0===e?void 0:e.clear()))}async wrapCacheEntry(t){const e=await this.nowProvider();return{body:t,expiresAt:Math.floor(e/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?null===(t=await this.keyManifest.get())||void 0===t?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new L({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,e){return e.filter((e=>{var r;const n=L.fromKey(e),o=new Set(n.scope&&n.scope.split(" ")),i=(null===(r=t.scope)||void 0===r?void 0:r.split(" "))||[],s=n.scope&&i.reduce(((t,e)=>t&&o.has(e)),!0);return"@@auth0spajs@@"===n.prefix&&n.clientId===t.clientId&&n.audience===t.audience&&s}))[0]}}class N{constructor(t,e,r){this.storage=t,this.clientId=e,this.cookieDomain=r,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Z=t=>"number"==typeof t,K=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"];var z=f((function(t,e){var r=c&&c.__assign||function(){return r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};function n(t,e){if(!e)return"";var r="; "+t;return!0===e?r:r+"="+e}function o(t,e,r){return encodeURIComponent(t).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(e).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(t){if("number"==typeof t.expires){var e=new Date;e.setMilliseconds(e.getMilliseconds()+864e5*t.expires),t.expires=e}return n("Expires",t.expires?t.expires.toUTCString():"")+n("Domain",t.domain)+n("Path",t.path)+n("Secure",t.secure)+n("SameSite",t.sameSite)}(r)}function i(t){for(var e={},r=t?t.split("; "):[],n=/(%[\dA-F]{2})+/gi,o=0;o<r.length;o++){var i=r[o].split("="),s=i.slice(1).join("=");'"'===s.charAt(0)&&(s=s.slice(1,-1));try{e[i[0].replace(n,decodeURIComponent)]=s.replace(n,decodeURIComponent)}catch(t){}}return e}function s(){return i(document.cookie)}function a(t,e,n){document.cookie=o(t,e,r({path:"/"},n))}e.__esModule=!0,e.encode=o,e.parse=i,e.getAll=s,e.get=function(t){return s()[t]},e.set=a,e.remove=function(t,e){a(t,"",r(r({},e),{expires:-1}))}}));u(z),z.encode,z.parse,z.getAll;var W=z.get,D=z.set,F=z.remove;const M={get(t){const e=W(t);if(void 0!==e)return JSON.parse(e)},save(t,e,r){let n={};"https:"===window.location.protocol&&(n={secure:!0,sameSite:"none"}),(null==r?void 0:r.daysUntilExpire)&&(n.expires=r.daysUntilExpire),(null==r?void 0:r.cookieDomain)&&(n.domain=r.cookieDomain),D(t,JSON.stringify(e),n)},remove(t,e){let r={};(null==e?void 0:e.cookieDomain)&&(r.domain=e.cookieDomain),F(t,r)}},X={get:t=>M.get(t)||M.get(`_legacy_${t}`),save(t,e,r){let n={};"https:"===window.location.protocol&&(n={secure:!0}),(null==r?void 0:r.daysUntilExpire)&&(n.expires=r.daysUntilExpire),(null==r?void 0:r.cookieDomain)&&(n.domain=r.cookieDomain),D(`_legacy_${t}`,JSON.stringify(e),n),M.save(t,e,r)},remove(t,e){let r={};(null==e?void 0:e.cookieDomain)&&(r.domain=e.cookieDomain),F(t,r),M.remove(t,e),M.remove(`_legacy_${t}`,e)}},J={get(t){if("undefined"==typeof sessionStorage)return;const e=sessionStorage.getItem(t);return null!=e?JSON.parse(e):void 0},save(t,e){sessionStorage.setItem(t,JSON.stringify(e))},remove(t){sessionStorage.removeItem(t)}};var Y,V=("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",null,!1,function(t){return Y=Y||function(t,e,r){var n=void 0===e?null:e,o=function(t,e){var r=atob(t);if(e){for(var n=new Uint8Array(r.length),o=0,i=r.length;o<i;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(t,void 0!==r&&r),i=o.indexOf("\n",10)+1,s=o.substring(i)+(n?"//# sourceMappingURL="+n:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",null,false),new Worker(Y,t)});const G={};class H{constructor(t,e){this.cache=t,this.clientId=e,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var e;const r=new Set((null===(e=await this.cache.get(this.manifestKey))||void 0===e?void 0:e.keys)||[]);r.add(t),await this.cache.set(this.manifestKey,{keys:[...r]})}async remove(t){const e=await this.cache.get(this.manifestKey);if(e){const r=new Set(e.keys);return r.delete(t),r.size>0?await this.cache.set(this.manifestKey,{keys:[...r]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(t){return`@@auth0spajs@@::${t}`}}const $={memory:()=>(new P).enclosedCache,localstorage:()=>new j},q=t=>$[t],Q=t=>{const{openUrl:e,onRedirect:r}=t,n=i(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:!1===e||e?e:r})},tt=new h;class et{constructor(t){let e,r;if(this.userCache=(new P).enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await tt.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!I())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===I().subtle)throw new Error("\n auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.\n ")})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)r=t.cache;else{if(e=t.cacheLocation||"memory",!q(e))throw new Error(`Invalid cache location "${e}"`);r=q(e)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===t.legacySameSiteCookie?M:X,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(t=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const n=t.useCookiesForTransactions?this.cookieStorage:J;var o;this.scope=C("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new N(n,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||g,this.cacheManager=new x(r,r.allKeys?void 0:new H(r,this.options.clientId),this.nowProvider),this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((t,e)=>t?t.startsWith("https://")?t:`https://${t}/`:`${e}/`)(this.options.issuer,this.domainUrl),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===e&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new V)}_url(t){const e=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||p)));return`${this.domainUrl}${t}&auth0Client=${e}`}_authorizeUrl(t){return this._url(`/authorize?${T(t)}`)}async _verifyIdToken(t,e,r){const n=await this.nowProvider();return(t=>{if(!t.id_token)throw new Error("ID token is required but missing");const e=(t=>{const e=t.split("."),[r,n,o]=e;if(3!==e.length||!r||!n||!o)throw new Error("ID token could not be decoded");const i=JSON.parse(A(n)),s={__raw:t},a={};return Object.keys(i).forEach((t=>{s[t]=i[t],K.includes(t)||(a[t]=i[t])})),{encoded:{header:r,payload:n,signature:o},header:JSON.parse(A(r)),claims:s,user:a}})(t.id_token);if(!e.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(e.claims.iss!==t.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${t.iss}", found "${e.claims.iss}"`);if(!e.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==e.header.alg)throw new Error(`Signature algorithm of "${e.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!e.claims.aud||"string"!=typeof e.claims.aud&&!Array.isArray(e.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but was not one of "${e.claims.aud.join(", ")}"`);if(e.claims.aud.length>1){if(!e.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(e.claims.azp!==t.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${t.aud}", found "${e.claims.azp}"`)}}else if(e.claims.aud!==t.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but found "${e.claims.aud}"`);if(t.nonce){if(!e.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(e.claims.nonce!==t.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${e.claims.nonce}"`)}if(t.max_age&&!Z(e.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(null==e.claims.exp||!Z(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Z(e.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const r=t.leeway||60,n=new Date(t.now||Date.now()),o=new Date(0);if(o.setUTCSeconds(e.claims.exp+r),n>o)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${n}) is after expiration time (${o})`);if(null!=e.claims.nbf&&Z(e.claims.nbf)){const t=new Date(0);if(t.setUTCSeconds(e.claims.nbf-r),n<t)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${n}) is before ${t}`)}if(null!=e.claims.auth_time&&Z(e.claims.auth_time)){const o=new Date(0);if(o.setUTCSeconds(parseInt(e.claims.auth_time)+t.max_age+r),n>o)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${n}) is after last auth at ${o}`)}if(t.organization){const r=t.organization.trim();if(r.startsWith("org_")){const t=r;if(!e.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(t!==e.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${t}", found "${e.claims.org_id}"`)}else{const t=r.toLowerCase();if(!e.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(t!==e.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${t}", found "${e.claims.org_name}"`)}}return e})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:e,organization:r,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,"string"!=typeof o?o:parseInt(o,10)||void 0),now:n});var o}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,e,r){const n=B(O()),o=B(O()),i=O(),s=(t=>{const e=new Uint8Array(t);return(t=>{const e={"+":"-","/":"_","=":""};return t.replace(/[+/=]/g,(t=>e[t]))})(window.btoa(String.fromCharCode(...Array.from(e))))})(await(async t=>{const e=I().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(t));return await e})(i)),a=((t,e,r,n,o,i,s,a)=>Object.assign(Object.assign(Object.assign({client_id:t.clientId},t.authorizationParams),r),{scope:C(e,r.scope),response_type:"code",response_mode:a||"query",state:n,nonce:o,redirect_uri:s||t.authorizationParams.redirect_uri,code_challenge:i,code_challenge_method:"S256"}))(this.options,this.scope,t,n,o,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||r,null==e?void 0:e.response_mode),c=this._authorizeUrl(a);return{nonce:o,code_verifier:i,scope:a.scope,audience:a.audience||"default",redirect_uri:a.redirect_uri,state:n,url:c}}async loginWithPopup(t,e){var r;if(t=t||{},!(e=e||{}).popup&&(e.popup=(t=>{const e=window.screenX+(window.innerWidth-400)/2,r=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${e},top=${r},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!e.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const n=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);e.popup.location.href=n.url;const o=await(t=>new Promise(((e,r)=>{let n;const o=setInterval((()=>{t.popup&&t.popup.closed&&(clearInterval(o),clearTimeout(i),window.removeEventListener("message",n,!1),r(new v(t.popup)))}),1e3),i=setTimeout((()=>{clearInterval(o),r(new b(t.popup)),window.removeEventListener("message",n,!1)}),1e3*(t.timeoutInSeconds||60));n=function(s){if(s.data&&"authorization_response"===s.data.type){if(clearTimeout(i),clearInterval(o),window.removeEventListener("message",n,!1),t.popup.close(),s.data.response.error)return r(y.fromPayload(s.data.response));e(s.data.response)}},window.addEventListener("message",n)})))(Object.assign(Object.assign({},e),{timeoutInSeconds:e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(n.state!==o.state)throw new y("state_mismatch","Invalid state");const i=(null===(r=t.authorizationParams)||void 0===r?void 0:r.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:n.audience,scope:n.scope,code_verifier:n.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:n.redirect_uri},{nonceIn:n.nonce,organization:i})}async getUser(){var t;const e=await this._getIdTokenFromCache();return null===(t=null==e?void 0:e.decodedToken)||void 0===t?void 0:t.user}async getIdTokenClaims(){var t;const e=await this._getIdTokenFromCache();return null===(t=null==e?void 0:e.decodedToken)||void 0===t?void 0:t.claims}async loginWithRedirect(t={}){var e;const r=Q(t),{openUrl:n,fragment:o,appState:s}=r,a=i(r,["openUrl","fragment","appState"]),c=(null===(e=a.authorizationParams)||void 0===e?void 0:e.organization)||this.options.authorizationParams.organization,u=await this._prepareAuthorizeUrl(a.authorizationParams||{}),{url:f}=u,l=i(u,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},l),{appState:s}),c&&{organization:c}));const h=o?`${f}#${o}`:f;n?await n(h):window.location.assign(h)}async handleRedirectCallback(t=window.location.href){const e=t.split("?").slice(1);if(0===e.length)throw new Error("There are no query params available for parsing.");const{state:r,code:n,error:o,error_description:i}=(t=>{t.indexOf("#")>-1&&(t=t.substring(0,t.indexOf("#")));const e=new URLSearchParams(t);return{state:e.get("state"),code:e.get("code")||void 0,error:e.get("error")||void 0,error_description:e.get("error_description")||void 0}})(e.join("")),s=this.transactionManager.get();if(!s)throw new y("missing_transaction","Invalid state");if(this.transactionManager.remove(),o)throw new m(o,i||o,r,s.appState);if(!s.code_verifier||s.state&&s.state!==r)throw new y("state_mismatch","Invalid state");const a=s.organization,c=s.nonce,u=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:n},u?{redirect_uri:u}:{}),{nonceIn:c,organization:a}),{appState:s.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch(t){}}async getTokenSilently(t={}){var e;const r=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:C(this.scope,null===(e=t.authorizationParams)||void 0===e?void 0:e.scope)})}),n=await((t,e)=>{let r=G[e];return r||(r=t().finally((()=>{delete G[e],r=null})),G[e]=r),r})((()=>this._getTokenSilently(r)),`${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);return t.detailedResponse?n:null==n?void 0:n.access_token}async _getTokenSilently(t){const{cacheMode:e}=t,r=i(t,["cacheMode"]);if("off"!==e){const t=await this._getEntryFromCache({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId});if(t)return t}if("cache-only"!==e){if(!await(async(t,e=3)=>{for(let r=0;r<e;r++)if(await t())return!0;return!1})((()=>tt.acquireLock("auth0.lock.getTokenSilently",5e3)),10))throw new w;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),"off"!==e){const t=await this._getEntryFromCache({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId});if(t)return t}const t=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(r):await this._getTokenFromIFrame(r),{id_token:n,access_token:o,oauthTokenScope:i,expires_in:s}=t;return Object.assign(Object.assign({id_token:n,access_token:o},i?{scope:i}:null),{expires_in:s})}finally{await tt.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(t={},e={}){var r;const n=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:C(this.scope,null===(r=t.authorizationParams)||void 0===r?void 0:r.scope)})});return e=Object.assign(Object.assign({},d),e),await this.loginWithPopup(n,e),(await this.cacheManager.get(new L({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){null!==t.clientId?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const e=t.logoutParams||{},{federated:r}=e,n=i(e,["federated"]),o=r?"&federated":"";return this._url(`/v2/logout?${T(Object.assign({clientId:t.clientId},n))}`)+o}async logout(t={}){const e=Q(t),{openUrl:r}=e,n=i(e,["openUrl"]);null===t.clientId?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const o=this._buildLogoutUrl(n);r?await r(o):!1!==r&&window.location.assign(o)}async _getTokenFromIFrame(t){const e=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),r=this.cookieStorage.get(this.orgHintCookieName);r&&!e.organization&&(e.organization=r);const{url:n,state:o,nonce:i,code_verifier:s,redirect_uri:a,scope:c,audience:u}=await this._prepareAuthorizeUrl(e,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new y("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const r=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,f=await((t,e,r=60)=>new Promise(((n,o)=>{const i=window.document.createElement("iframe");i.setAttribute("width","0"),i.setAttribute("height","0"),i.style.display="none";const s=()=>{window.document.body.contains(i)&&(window.document.body.removeChild(i),window.removeEventListener("message",a,!1))};let a;const c=setTimeout((()=>{o(new w),s()}),1e3*r);a=function(t){if(t.origin!=e)return;if(!t.data||"authorization_response"!==t.data.type)return;const r=t.source;r&&r.close(),t.data.response.error?o(y.fromPayload(t.data.response)):n(t.data.response),clearTimeout(c),window.removeEventListener("message",a,!1),setTimeout(s,2e3)},window.addEventListener("message",a,!1),window.document.body.appendChild(i),i.setAttribute("src",t)})))(n,this.domainUrl,r);if(o!==f.state)throw new y("state_mismatch","Invalid state");const l=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:s,code:f.code,grant_type:"authorization_code",redirect_uri:a,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:i,organization:e.organization});return Object.assign(Object.assign({},l),{scope:c,oauthTokenScope:l.scope,audience:u})}catch(t){throw"login_required"===t.error&&this.logout({openUrl:!1}),t}}async _getTokenUsingRefreshToken(t){const e=await this.cacheManager.get(new L({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(e&&e.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new S(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const r=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,n="number"==typeof t.timeoutInSeconds?1e3*t.timeoutInSeconds:null;try{const o=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:e&&e.refresh_token,redirect_uri:r}),n&&{timeout:n}));return Object.assign(Object.assign({},o),{scope:t.authorizationParams.scope,oauthTokenScope:o.scope,audience:t.authorizationParams.audience||"default"})}catch(e){if((e.message.indexOf("Missing Refresh Token")>-1||e.message&&e.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw e}}async _saveEntryInCache(t){const{id_token:e,decodedToken:r}=t,n=i(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:e,decodedToken:r}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(n)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",e=await this.cacheManager.getIdToken(new L({clientId:this.options.clientId,audience:t,scope:this.scope})),r=this.userCache.get("@@user@@");return e&&e.id_token===(null==r?void 0:r.id_token)?r:(this.userCache.set("@@user@@",e),e)}async _getEntryFromCache({scope:t,audience:e,clientId:r}){const n=await this.cacheManager.get(new L({scope:t,audience:e,clientId:r}),60);if(n&&n.access_token){const{access_token:t,oauthTokenScope:e,expires_in:r}=n,o=await this._getIdTokenFromCache();return o&&Object.assign(Object.assign({id_token:o.id_token,access_token:t},e?{scope:e}:null),{expires_in:r})}}async _requestToken(t,e){const{nonceIn:r,organization:n}=e||{},o=await U(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),i=await this._verifyIdToken(o.id_token,r,n);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:i,scope:t.scope,audience:t.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(n||i.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:i})}}function rt(t,e){return function(){return t.apply(e,arguments)}}const{toString:nt}=Object.prototype,{getPrototypeOf:ot}=Object,it=(st=Object.create(null),t=>{const e=nt.call(t);return st[e]||(st[e]=e.slice(8,-1).toLowerCase())});var st;const at=t=>(t=t.toLowerCase(),e=>it(e)===t),ct=t=>e=>typeof e===t,{isArray:ut}=Array,ft=ct("undefined");const lt=at("ArrayBuffer");const ht=ct("string"),dt=ct("function"),pt=ct("number"),gt=t=>null!==t&&"object"==typeof t,yt=t=>{if("object"!==it(t))return!1;const e=ot(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},mt=at("Date"),wt=at("File"),bt=at("Blob"),vt=at("FileList"),Et=at("URLSearchParams");function St(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),ut(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let s;for(n=0;n<i;n++)s=o[n],e.call(null,t[s],s,t)}}function kt(t,e){e=e.toLowerCase();const r=Object.keys(t);let n,o=r.length;for(;o-- >0;)if(n=r[o],e===n.toLowerCase())return n;return null}const It="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ot=t=>!ft(t)&&t!==It;const Bt=(Tt="undefined"!=typeof Uint8Array&&ot(Uint8Array),t=>Tt&&t instanceof Tt);var Tt;const At=at("HTMLFormElement"),_t=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Rt=at("RegExp"),Ut=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};St(r,((r,o)=>{let i;!1!==(i=e(r,o,t))&&(n[o]=i||r)})),Object.defineProperties(t,n)},Ct="abcdefghijklmnopqrstuvwxyz",Lt="0123456789",jt={DIGIT:Lt,ALPHA:Ct,ALPHA_DIGIT:Ct+Ct.toUpperCase()+Lt};const Pt=at("AsyncFunction"),xt={isArray:ut,isArrayBuffer:lt,isBuffer:function(t){return null!==t&&!ft(t)&&null!==t.constructor&&!ft(t.constructor)&&dt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||dt(t.append)&&("formdata"===(e=it(t))||"object"===e&&dt(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&<(t.buffer),e},isString:ht,isNumber:pt,isBoolean:t=>!0===t||!1===t,isObject:gt,isPlainObject:yt,isUndefined:ft,isDate:mt,isFile:wt,isBlob:bt,isRegExp:Rt,isFunction:dt,isStream:t=>gt(t)&&dt(t.pipe),isURLSearchParams:Et,isTypedArray:Bt,isFileList:vt,forEach:St,merge:function t(){const{caseless:e}=Ot(this)&&this||{},r={},n=(n,o)=>{const i=e&&kt(r,o)||o;yt(r[i])&&yt(n)?r[i]=t(r[i],n):yt(n)?r[i]=t({},n):ut(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&St(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(St(e,((e,n)=>{r&&dt(e)?t[n]=rt(e,r):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,i,s;const a={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],n&&!n(s,t,e)||a[s]||(e[s]=t[s],a[s]=!0);t=!1!==r&&ot(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:it,kindOfTest:at,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(ut(t))return t;let e=t.length;if(!pt(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:At,hasOwnProperty:_t,hasOwnProp:_t,reduceDescriptors:Ut,freezeMethods:t=>{Ut(t,((e,r)=>{if(dt(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];dt(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach((t=>{r[t]=!0}))};return ut(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:kt,global:It,isContextDefined:Ot,ALPHABET:jt,generateString:(t=16,e=jt.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r},isSpecCompliantForm:function(t){return!!(t&&dt(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(gt(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=ut(t)?[]:{};return St(t,((t,e)=>{const i=r(t,n+1);!ft(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)},isAsyncFn:Pt,isThenable:t=>t&&(gt(t)||dt(t))&&dt(t.then)&&dt(t.catch)};function Nt(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}xt.inherits(Nt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:xt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Zt=Nt.prototype,Kt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{Kt[t]={value:t}})),Object.defineProperties(Nt,Kt),Object.defineProperty(Zt,"isAxiosError",{value:!0}),Nt.from=(t,e,r,n,o,i)=>{const s=Object.create(Zt);return xt.toFlatObject(t,s,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),Nt.call(s,t.message,e,r,n,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const zt=Nt;function Wt(t){return xt.isPlainObject(t)||xt.isArray(t)}function Dt(t){return xt.endsWith(t,"[]")?t.slice(0,-2):t}function Ft(t,e,r){return t?t.concat(e).map((function(t,e){return t=Dt(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const Mt=xt.toFlatObject(xt,{},null,(function(t){return/^is[A-Z]/.test(t)}));const Xt=function(t,e,r){if(!xt.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=xt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!xt.isUndefined(e[t])}))).metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&xt.isSpecCompliantForm(e);if(!xt.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(xt.isDate(t))return t.toISOString();if(!a&&xt.isBlob(t))throw new zt("Blob is not supported. Use a Buffer instead.");return xt.isArrayBuffer(t)||xt.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,r,o){let a=t;if(t&&!o&&"object"==typeof t)if(xt.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(xt.isArray(t)&&function(t){return xt.isArray(t)&&!t.some(Wt)}(t)||(xt.isFileList(t)||xt.endsWith(r,"[]"))&&(a=xt.toArray(t)))return r=Dt(r),a.forEach((function(t,n){!xt.isUndefined(t)&&null!==t&&e.append(!0===s?Ft([r],n,i):null===s?r:r+"[]",c(t))})),!1;return!!Wt(t)||(e.append(Ft(o,r,i),c(t)),!1)}const f=[],l=Object.assign(Mt,{defaultVisitor:u,convertValue:c,isVisitable:Wt});if(!xt.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!xt.isUndefined(r)){if(-1!==f.indexOf(r))throw Error("Circular reference detected in "+n.join("."));f.push(r),xt.forEach(r,(function(r,i){!0===(!(xt.isUndefined(r)||null===r)&&o.call(e,r,xt.isString(i)?i.trim():i,n,l))&&t(r,n?n.concat(i):[i])})),f.pop()}}(t),e};function Jt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function Yt(t,e){this._pairs=[],t&&Xt(t,this,e)}const Vt=Yt.prototype;Vt.append=function(t,e){this._pairs.push([t,e])},Vt.toString=function(t){const e=t?function(e){return t.call(this,e,Jt)}:Jt;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const Gt=Yt;function Ht(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $t(t,e,r){if(!e)return t;const n=r&&r.encode||Ht,o=r&&r.serialize;let i;if(i=o?o(e,r):xt.isURLSearchParams(e)?e.toString():new Gt(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const qt=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){xt.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Qt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},te={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Gt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ee="undefined"!=typeof window&&"undefined"!=typeof document,re=(ne="undefined"!=typeof navigator&&navigator.product,ee&&["ReactNative","NativeScript","NS"].indexOf(ne)<0);var ne;const oe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ie={...t,...te};const se=function(t){function e(t,r,n,o){let i=t[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=t.length;if(i=!i&&xt.isArray(n)?n.length:i,a)return xt.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!s;n[i]&&xt.isObject(n[i])||(n[i]=[]);return e(t,r,n[i],o)&&xt.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}(n[i])),!s}if(xt.isFormData(t)&&xt.isFunction(t.entries)){const r={};return xt.forEachEntry(t,((t,n)=>{e(function(t){return xt.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null};const ae={transitional:Qt,adapter:["xhr","http"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=xt.isObject(t);o&&xt.isHTMLForm(t)&&(t=new FormData(t));if(xt.isFormData(t))return n&&n?JSON.stringify(se(t)):t;if(xt.isArrayBuffer(t)||xt.isBuffer(t)||xt.isStream(t)||xt.isFile(t)||xt.isBlob(t))return t;if(xt.isArrayBufferView(t))return t.buffer;if(xt.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Xt(t,new ie.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return ie.isNode&&xt.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=xt.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Xt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(xt.isString(t))try{return(e||JSON.parse)(t),xt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||ae.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(t&&xt.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw zt.from(t,zt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ie.classes.FormData,Blob:ie.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};xt.forEach(["delete","get","head","post","put","patch"],(t=>{ae.headers[t]={}}));const ce=ae,ue=xt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),fe=Symbol("internals");function le(t){return t&&String(t).trim().toLowerCase()}function he(t){return!1===t||null==t?t:xt.isArray(t)?t.map(he):String(t)}function de(t,e,r,n,o){return xt.isFunction(n)?n.call(this,e,r):(o&&(e=r),xt.isString(e)?xt.isString(n)?-1!==e.indexOf(n):xt.isRegExp(n)?n.test(e):void 0:void 0)}class pe{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=le(e);if(!o)throw new Error("header name must be a non-empty string");const i=xt.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=he(t))}const i=(t,e)=>xt.forEach(t,((t,r)=>o(t,r,e)));return xt.isPlainObject(t)||t instanceof this.constructor?i(t,e):xt.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim())?i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&ue[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)})),e})(t),e):null!=t&&o(e,t,r),this}get(t,e){if(t=le(t)){const r=xt.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(xt.isFunction(e))return e.call(this,t,r);if(xt.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=le(t)){const r=xt.findKey(this,t);return!(!r||void 0===this[r]||e&&!de(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=le(t)){const o=xt.findKey(r,t);!o||e&&!de(0,r[o],o,e)||(delete r[o],n=!0)}}return xt.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const o=e[r];t&&!de(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return xt.forEach(this,((n,o)=>{const i=xt.findKey(r,o);if(i)return e[i]=he(n),void delete e[o];const s=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(o):String(o).trim();s!==o&&delete e[o],e[s]=he(n),r[s]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return xt.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&xt.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[fe]=this[fe]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=le(t);e[n]||(!function(t,e){const r=xt.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})}))}(r,t),e[n]=!0)}return xt.isArray(t)?t.forEach(n):n(t),this}}pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),xt.reduceDescriptors(pe.prototype,(({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}})),xt.freezeMethods(pe);const ge=pe;function ye(t,e){const r=this||ce,n=e||r,o=ge.from(n.headers);let i=n.data;return xt.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function me(t){return!(!t||!t.__CANCEL__)}function we(t,e,r){zt.call(this,null==t?"canceled":t,zt.ERR_CANCELED,e,r),this.name="CanceledError"}xt.inherits(we,zt,{__CANCEL__:!0});const be=we;const ve=ie.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const s=[t+"="+encodeURIComponent(e)];xt.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),xt.isString(n)&&s.push("path="+n),xt.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ee(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Se=ie.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let r;function n(r){let n=r;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return r=n(window.location.href),function(t){const e=xt.isString(t)?n(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0};const ke=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,s=0;return e=void 0!==e?e:1e3,function(a){const c=Date.now(),u=n[s];o||(o=c),r[i]=a,n[i]=c;let f=s,l=0;for(;f!==i;)l+=r[f++],f%=t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),c-o<e)return;const h=u&&c-u;return h?Math.round(1e3*l/h):void 0}};function Ie(t,e){let r=0;const n=ke(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-r,c=n(a);r=i;const u={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:o};u[e?"download":"upload"]=!0,t(u)}}const Oe={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){let n=t.data;const o=ge.from(t.headers).normalize();let i,s,{responseType:a,withXSRFToken:c}=t;function u(){t.cancelToken&&t.cancelToken.unsubscribe(i),t.signal&&t.signal.removeEventListener("abort",i)}if(xt.isFormData(n))if(ie.hasStandardBrowserEnv||ie.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(s=o.getContentType())){const[t,...e]=s?s.split(";").map((t=>t.trim())).filter(Boolean):[];o.setContentType([t||"multipart/form-data",...e].join("; "))}let f=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",r=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(e+":"+r))}const l=Ee(t.baseURL,t.url);function h(){if(!f)return;const n=ge.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());!function(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new zt("Request failed with status code "+r.status,[zt.ERR_BAD_REQUEST,zt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}((function(t){e(t),u()}),(function(t){r(t),u()}),{data:a&&"text"!==a&&"json"!==a?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:n,config:t,request:f}),f=null}if(f.open(t.method.toUpperCase(),$t(l,t.params,t.paramsSerializer),!0),f.timeout=t.timeout,"onloadend"in f?f.onloadend=h:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(h)},f.onabort=function(){f&&(r(new zt("Request aborted",zt.ECONNABORTED,t,f)),f=null)},f.onerror=function(){r(new zt("Network Error",zt.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const n=t.transitional||Qt;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(new zt(e,n.clarifyTimeoutError?zt.ETIMEDOUT:zt.ECONNABORTED,t,f)),f=null},ie.hasStandardBrowserEnv&&(c&&xt.isFunction(c)&&(c=c(t)),c||!1!==c&&Se(l))){const e=t.xsrfHeaderName&&t.xsrfCookieName&&ve.read(t.xsrfCookieName);e&&o.set(t.xsrfHeaderName,e)}void 0===n&&o.setContentType(null),"setRequestHeader"in f&&xt.forEach(o.toJSON(),(function(t,e){f.setRequestHeader(e,t)})),xt.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),a&&"json"!==a&&(f.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&f.addEventListener("progress",Ie(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",Ie(t.onUploadProgress)),(t.cancelToken||t.signal)&&(i=e=>{f&&(r(!e||e.type?new be(null,t,f):e),f.abort(),f=null)},t.cancelToken&&t.cancelToken.subscribe(i),t.signal&&(t.signal.aborted?i():t.signal.addEventListener("abort",i)));const d=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(l);d&&-1===ie.protocols.indexOf(d)?r(new zt("Unsupported protocol "+d+":",zt.ERR_BAD_REQUEST,t)):f.send(n||null)}))}};xt.forEach(Oe,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Be=t=>`- ${t}`,Te=t=>xt.isFunction(t)||null===t||!1===t,Ae=t=>{t=xt.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let i=0;i<e;i++){let e;if(r=t[i],n=r,!Te(r)&&(n=Oe[(e=String(r)).toLowerCase()],void 0===n))throw new zt(`Unknown adapter '${e}'`);if(n)break;o[e||"#"+i]=n}if(!n){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let r=e?t.length>1?"since :\n"+t.map(Be).join("\n"):" "+Be(t[0]):"as no adapter specified";throw new zt("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function _e(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new be(null,t)}function Re(t){_e(t),t.headers=ge.from(t.headers),t.data=ye.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return Ae(t.adapter||ce.adapter)(t).then((function(e){return _e(t),e.data=ye.call(t,t.transformResponse,e),e.headers=ge.from(e.headers),e}),(function(e){return me(e)||(_e(t),e&&e.response&&(e.response.data=ye.call(t,t.transformResponse,e.response),e.response.headers=ge.from(e.response.headers))),Promise.reject(e)}))}const Ue=t=>t instanceof ge?t.toJSON():t;function Ce(t,e){e=e||{};const r={};function n(t,e,r){return xt.isPlainObject(t)&&xt.isPlainObject(e)?xt.merge.call({caseless:r},t,e):xt.isPlainObject(e)?xt.merge({},e):xt.isArray(e)?e.slice():e}function o(t,e,r){return xt.isUndefined(e)?xt.isUndefined(t)?void 0:n(void 0,t,r):n(t,e,r)}function i(t,e){if(!xt.isUndefined(e))return n(void 0,e)}function s(t,e){return xt.isUndefined(e)?xt.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function a(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(t,e)=>o(Ue(t),Ue(e),!0)};return xt.forEach(Object.keys(Object.assign({},t,e)),(function(n){const i=c[n]||o,s=i(t[n],e[n],n);xt.isUndefined(s)&&i!==a||(r[n]=s)})),r}const Le="1.6.5",je={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{je[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const Pe={};je.transitional=function(t,e,r){function n(t,e){return"[Axios v1.6.5] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,o,i)=>{if(!1===t)throw new zt(n(o," has been removed"+(e?" in "+e:"")),zt.ERR_DEPRECATED);return e&&!Pe[o]&&(Pe[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,i)}};const xe={assertOptions:function(t,e,r){if("object"!=typeof t)throw new zt("options must be an object",zt.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],s=e[i];if(s){const e=t[i],r=void 0===e||s(e,i,t);if(!0!==r)throw new zt("option "+i+" must be "+r,zt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new zt("Unknown option "+i,zt.ERR_BAD_OPTION)}},validators:je},Ne=xe.validators;class Ze{constructor(t){this.defaults=t,this.interceptors={request:new qt,response:new qt}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Ce(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;void 0!==r&&xe.assertOptions(r,{silentJSONParsing:Ne.transitional(Ne.boolean),forcedJSONParsing:Ne.transitional(Ne.boolean),clarifyTimeoutError:Ne.transitional(Ne.boolean)},!1),null!=n&&(xt.isFunction(n)?e.paramsSerializer={serialize:n}:xe.assertOptions(n,{encode:Ne.function,serialize:Ne.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&xt.merge(o.common,o[e.method]);o&&xt.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=ge.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let f,l=0;if(!a){const t=[Re.bind(this),void 0];for(t.unshift.apply(t,s),t.push.apply(t,c),f=t.length,u=Promise.resolve(e);l<f;)u=u.then(t[l++],t[l++]);return u}f=s.length;let h=e;for(l=0;l<f;){const t=s[l++],e=s[l++];try{h=t(h)}catch(t){e.call(this,t);break}}try{u=Re.call(this,h)}catch(t){return Promise.reject(t)}for(l=0,f=c.length;l<f;)u=u.then(c[l++],c[l++]);return u}getUri(t){return $t(Ee((t=Ce(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}xt.forEach(["delete","get","head","options"],(function(t){Ze.prototype[t]=function(e,r){return this.request(Ce(r||{},{method:t,url:e,data:(r||{}).data}))}})),xt.forEach(["post","put","patch"],(function(t){function e(e){return function(r,n,o){return this.request(Ce(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Ze.prototype[t]=e(),Ze.prototype[t+"Form"]=e(!0)}));const Ke=Ze;class ze{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const r=this;this.promise.then((t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,o){r.reason||(r.reason=new be(t,n,o),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;const e=new ze((function(e){t=e}));return{token:e,cancel:t}}}const We=ze;const De={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(De).forEach((([t,e])=>{De[e]=t}));const Fe=De;const Me=function t(e){const r=new Ke(e),n=rt(Ke.prototype.request,r);return xt.extend(n,Ke.prototype,r,{allOwnKeys:!0}),xt.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(Ce(e,r))},n}(ce);Me.Axios=Ke,Me.CanceledError=be,Me.CancelToken=We,Me.isCancel=me,Me.VERSION=Le,Me.toFormData=Xt,Me.AxiosError=zt,Me.Cancel=Me.CanceledError,Me.all=function(t){return Promise.all(t)},Me.spread=function(t){return function(e){return t.apply(null,e)}},Me.isAxiosError=function(t){return xt.isObject(t)&&!0===t.isAxiosError},Me.mergeConfig=Ce,Me.AxiosHeaders=ge,Me.formToJSON=t=>se(xt.isHTMLForm(t)?new FormData(t):t),Me.getAdapter=Ae,Me.HttpStatusCode=Fe,Me.default=Me;const Xe=Me;s(742);var Je=s(764),Ye=Object.create,Ve=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,He=Object.getOwnPropertyNames,$e=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty,Qe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),tr=(t,e,r)=>(r=null!=t?Ye($e(t)):{},((t,e,r,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let o of He(e))!qe.call(t,o)&&o!==r&&Ve(t,o,{get:()=>e[o],enumerable:!(n=Ge(e,o))||n.enumerable});return t})(!e&&t&&t.__esModule?r:Ve(r,"default",{value:t,enumerable:!0}),t)),er=Qe((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var e=t.length,r=e%4;if(!r)return t;var n=e,o=4-r,i=e+o,s=Buffer.alloc(i);for(s.write(t);o--;)s.write("=",n++);return s.toString()}})),rr=Qe((t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=er();function r(t,e){return void 0===e&&(e="utf8"),Buffer.isBuffer(t)?o(t.toString("base64")):o(Buffer.from(t,e).toString("base64"))}function n(t){return t=t.toString(),e.default(t).replace(/\-/g,"+").replace(/_/g,"/")}function o(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var i=r;i.encode=r,i.decode=function(t,e){return void 0===e&&(e="utf8"),Buffer.from(n(t),"base64").toString(e)},i.toBase64=n,i.fromBase64=o,i.toBuffer=function(t){return Buffer.from(n(t),"base64")},t.default=i})),nr=Qe(((t,e)=>{e.exports=rr().default,e.exports.default=e.exports})),or=Qe((t=>{t.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},t.toByteArray=function(t){var e,r,i=s(t),a=i[0],c=i[1],u=new o(function(t,e,r){return 3*(e+r)/4-r}(0,a,c)),f=0,l=c>0?a-4:a;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u},t.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,a=0,u=n-o;a<u;a+=s)i.push(c(t,a,a+s>u?u:a+s));return 1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")};var e,r=[],n=[],o=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(e=0,64;e<64;++e)r[e]=i[e],n[i.charCodeAt(e)]=e;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function a(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function c(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(a(n));return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63})),ir=Qe((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=or();function r(t){return new TextDecoder("utf-8",{fatal:!0}).decode(t)}function n(t){return(new TextEncoder).encode(t)}function o(t){return new Uint8Array(e.toByteArray(c(t)))}function i(t){return e.fromByteArray(new Uint8Array(t))}function s(t){return a(i(t))}function a(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}function c(t){let e;return e=(t=t.replace(/\-/g,"+").replace(/\_/g,"/")).length%4==0?0:4-t.length%4,t.concat("=".repeat(e))}t.concatBuffers=function(t){let e=0;for(let r=0;r<t.length;r++)e+=t[r].byteLength;let r=new Uint8Array(e),n=0;r.set(new Uint8Array(t[0]),n),n+=t[0].byteLength;for(let e=1;e<t.length;e++)r.set(new Uint8Array(t[e]),n),n+=t[e].byteLength;return r},t.b64UrlToString=function(t){return r(o(t))},t.bufferToString=r,t.stringToBuffer=n,t.stringToB64Url=function(t){return s(n(t))},t.b64UrlToBuffer=o,t.bufferTob64=i,t.bufferTob64Url=s,t.b64UrlEncode=a,t.b64UrlDecode=c})),sr=Qe((t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ir();t.default=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let t=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),e=await this.driver.exportKey("jwk",t.privateKey);return{kty:e.kty,e:e.e,n:e.n,d:e.d,p:e.p,q:e.q,dp:e.dp,dq:e.dq,qi:e.qi}}async sign(t,e,{saltLength:r}={}){let n=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(t),e);return new Uint8Array(n)}async hash(t,e="SHA-256"){let r=await this.driver.digest(e,t);return new Uint8Array(r)}async verify(t,e,r){let n={kty:"RSA",e:"AQAB",n:t},o=await this.jwkToPublicCryptoKey(n),i=await this.driver.digest("SHA-256",e),s=await this.driver.verify({name:"RSA-PSS",saltLength:0},o,r,e),a=await this.driver.verify({name:"RSA-PSS",saltLength:32},o,r,e),c=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((o.algorithm.modulusLength-1)/8)-i.byteLength-2},o,r,e);return s||a||c}async jwkToCryptoKey(t){return this.driver.importKey("jwk",t,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(t){return this.driver.importKey("jwk",t,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let t=crypto?.subtle;return void 0!==t&&["generateKey","importKey","exportKey","digest","sign"].every((e=>"function"==typeof t[e]))}async encrypt(t,r,n){let o=await this.driver.importKey("raw","string"==typeof r?e.stringToBuffer(r):r,{name:"PBKDF2",length:32},!1,["deriveKey"]),i=await this.driver.deriveKey({name:"PBKDF2",salt:n?e.stringToBuffer(n):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},o,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),s=new Uint8Array(16);crypto.getRandomValues(s);let a=await this.driver.encrypt({name:"AES-CBC",iv:s},i,t);return e.concatBuffers([s,a])}async decrypt(t,r,n){let o=await this.driver.importKey("raw","string"==typeof r?e.stringToBuffer(r):r,{name:"PBKDF2",length:32},!1,["deriveKey"]),i=await this.driver.deriveKey({name:"PBKDF2",salt:n?e.stringToBuffer(n):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},o,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),s=t.slice(0,16),a=await this.driver.decrypt({name:"AES-CBC",iv:s},i,t.slice(16));return e.concatBuffers([a])}}})),ar=Qe((t=>{t.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,u=c>>1,f=-7,l=r?o-1:0,h=r?-1:1,d=t[e+l];for(l+=h,i=d&(1<<-f)-1,d>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),i-=u}return(d?-1:1)*s*Math.pow(2,i-n)},t.write=function(t,e,r,n,o,i){var s,a,c,u=8*i-o-1,f=(1<<u)-1,l=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(s++,c/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*c-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[r+d]=255&a,d+=p,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*g}})),cr=Qe((t=>{var e=or(),r=ar(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=s,t.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},t.INSPECT_MAX_BYTES=50;var o=2147483647;function i(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=0|d(t,e),n=i(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Y(t,Uint8Array)){let e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Y(t,SharedArrayBuffer)||t&&Y(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return s.from(n,e,r);let o=function(t){if(s.isBuffer(t)){let e=0|h(t.length),r=i(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||V(t.length)?i(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}(t);if(o)return o;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return c(t),i(t<0?0:0|h(t))}function f(t){let e=t.length<0?0:0|h(t.length),r=i(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,s.prototype),n}function h(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return X(t).length;default:if(o)return n?-1:M(t).length;e=(""+e).toLowerCase(),o=!0}}function p(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return B(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,o){let i,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){let n=-1;for(i=r;i<a;i++)if(u(t,i)===u(e,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===c)return n*s}else-1!==n&&(i-=i-n),n=-1}else for(r+c>a&&(r=a-c),i=r;i>=0;i--){let r=!0;for(let n=0;n<c;n++)if(u(t,i+n)!==u(e,n)){r=!1;break}if(r)return i}return-1}function w(t,e,r,n){r=Number(r)||0;let o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;let i,s=e.length;for(n>s/2&&(n=s/2),i=0;i<n;++i){let n=parseInt(e.substr(2*i,2),16);if(V(n))return i;t[r+i]=n}return i}function b(t,e,r,n){return J(M(e,t.length-r),t,r,n)}function v(t,e,r,n){return J(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return J(X(e),t,r,n)}function S(t,e,r,n){return J(function(t,e){let r,n,o,i=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function k(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function I(t,e,r){r=Math.min(t.length,r);let n=[],o=e;for(;o<r;){let e=t[o],i=null,s=e>239?4:e>223?3:e>191?2:1;if(o+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(i=e);break;case 2:r=t[o+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(i=c));break;case 3:r=t[o+1],n=t[o+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:r=t[o+1],n=t[o+2],a=t[o+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}return function(t){let e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=O));return r}(n)}t.kMaxLength=o,s.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch{return!1}}(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&"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(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,r){return a(t,e,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?i(t):void 0!==e?"string"==typeof r?i(t).fill(e,r):i(t).fill(e):i(t)}(t,e,r)},s.allocUnsafe=function(t){return u(t)},s.allocUnsafeSlow=function(t){return u(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(Y(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),Y(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},s.isEncoding=function(t){switch(String(t).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}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;let n=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){let e=t[r];if(Y(e,Uint8Array))o+e.length>n.length?(s.isBuffer(e)||(e=s.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else{if(!s.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)g(this,e,e+1);return this},s.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},s.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},s.prototype.toString=function(){let t=this.length;return 0===t?"":0===arguments.length?I(this,0,t):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){let e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(t,e,r,n,o){if(Y(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),c=Math.min(i,a),u=this.slice(n,o),f=t.slice(e,r);for(let t=0;t<c;++t)if(u[t]!==f[t]){i=u[t],a=f[t];break}return i<a?-1:a<i?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}let o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":case"latin1":case"binary":return v(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function B(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function T(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function A(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=e;n<r;++n)o+=G[t[n]];return o}function _(t,e,r){let n=t.slice(e,r),o="";for(let t=0;t<n.length-1;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}function R(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function U(t,e,r,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function C(t,e,r,n,o){z(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function L(t,e,r,n,o){z(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i>>=8,t[r+6]=i,i>>=8,t[r+5]=i,i>>=8,t[r+4]=i;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function j(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,n,o,i){return e=+e,n>>>=0,i||j(t,0,n,4),r.write(t,e,n,o,23,4),n+4}function x(t,e,n,o,i){return e=+e,n>>>=0,i||j(t,0,n,8),r.write(t,e,n,o,52,8),n+8}s.prototype.slice=function(t,e){let r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let n=this.subarray(t,e);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUintLE=s.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUintBE=s.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readBigUInt64LE=H((function(t){W(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&D(t,this.length-8);let n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,o=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))})),s.prototype.readBigUInt64BE=H((function(t){W(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&D(t,this.length-8);let n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],o=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);let n=e,o=1,i=this[t+--n];for(;n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||R(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||R(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readBigInt64LE=H((function(t){W(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&D(t,this.length-8);let n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),s.prototype.readBigInt64BE=H((function(t){W(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&D(t,this.length-8);let n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),s.prototype.readFloatLE=function(t,e){return t>>>=0,e||R(t,4,this.length),r.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||R(t,4,this.length),r.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||R(t,8,this.length),r.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||R(t,8,this.length),r.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){U(this,t,e,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){U(this,t,e,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigUInt64LE=H((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeBigUInt64BE=H((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);U(this,t,e,r,n-1,-n)}let o=0,i=1,s=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);U(this,t,e,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[e+o]=255&t;--o>=0&&(i*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigInt64LE=H((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeBigInt64BE=H((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return x(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return x(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&0!==n&&(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);let o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){let e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{let i=s.isBuffer(t)?t:s.from(t,n),a=i.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=i[o%a]}return this};var N={};function Z(t,e,r){N[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function K(t){let e="",r=t.length,n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function z(t,e,r,n,o,i){if(t>r||t<e){let n,o="bigint"==typeof e?"n":"";throw n=i>3?0===e||e===BigInt(0)?`>= 0${o} and < 2${o} ** ${8*(i+1)}${o}`:`>= -(2${o} ** ${8*(i+1)-1}${o}) and < 2 ** ${8*(i+1)-1}${o}`:`>= ${e}${o} and <= ${r}${o}`,new N.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){W(e,"offset"),(void 0===t[e]||void 0===t[e+r])&&D(e,t.length-(r+1))}(n,o,i)}function W(t,e){if("number"!=typeof t)throw new N.ERR_INVALID_ARG_TYPE(e,"number",t)}function D(t,e,r){throw Math.floor(t)!==t?(W(t,r),new N.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new N.ERR_BUFFER_OUT_OF_BOUNDS:new N.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}Z("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),Z("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),Z("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=K(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=K(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n}),RangeError);var F=/[^+/0-9A-Za-z-_]/g;function M(t,e){e=e||1/0;let r,n=t.length,o=null,i=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function X(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}var G=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function H(t){return typeof BigInt>"u"?$:t}function $(){throw new Error("BigInt not supported")}})),ur=Qe(((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:cr().Buffer,Crypto:window.crypto}):e.exports={Buffer:cr().Buffer,Crypto:crypto}})),fr={};((t,e)=>{for(var r in e)Ve(t,r,{get:e[r],enumerable:!0})})(fr,{AVSCTap:()=>Ar,ArweaveSigner:()=>kr,DataItem:()=>Zr,MAX_TAG_BYTES:()=>xr,MIN_BINARY_SIZE:()=>Nr,SIG_CONFIG:()=>Sr,SignatureConfig:()=>mr,Signer:()=>lr,createData:()=>zr,deserializeTags:()=>Ur,indexToType:()=>Ir,serializeTags:()=>_r,tagsExceedLimit:()=>Rr});var lr=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,n){throw new Error("You must implement verify method on child")}},hr=tr(nr(),1),dr=tr(ir(),1);async function pr(t){if(Array.isArray(t)){let e=(0,dr.concatBuffers)([(0,dr.stringToBuffer)("list"),(0,dr.stringToBuffer)(t.length.toString())]);return await gr(t,await Er().hash(e,"SHA-384"))}let e=t,r=(0,dr.concatBuffers)([(0,dr.stringToBuffer)("blob"),(0,dr.stringToBuffer)(e.byteLength.toString())]),n=(0,dr.concatBuffers)([await Er().hash(r,"SHA-384"),await Er().hash(e,"SHA-384")]);return await Er().hash(n,"SHA-384")}async function gr(t,e){if(t.length<1)return e;let r=(0,dr.concatBuffers)([e,await pr(t[0])]),n=await Er().hash(r,"SHA-384");return await gr(t.slice(1),n)}var yr,mr,wr=tr(sr(),1),br=wr.default.default?wr.default.default:wr.default,vr=class extends br{getPublicKey(t){throw new Error("Unimplemented")}};function Er(){return yr??=new vr}!function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"}(mr||(mr={}));var Sr={[mr.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[mr.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[mr.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[mr.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[mr.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[mr.MULTIAPTOS]:{sigLength:2052,pubLength:1025,sigName:"multiAptos"},[mr.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},kr=class{signatureType=1;ownerLength=Sr[1].pubLength;signatureLength=Sr[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return hr.default.toBuffer(this.pk)}sign(t){return Er().sign(this.jwk,t)}static async verify(t,e,r){return await Er().verify(t,e,r)}},Ir={1:kr},Or=tr(nr(),1);async function Br(t){return pr([(0,dr.stringToBuffer)("dataitem"),(0,dr.stringToBuffer)("1"),(0,dr.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function Tr(t,e){let{signature:r,id:n}=await async function(t,e){let r=await Br(t),n=await e.sign(r),o=await Er().hash(n);return{signature:Buffer.from(n),id:Buffer.from(o)}}(t,e);return t.getRaw().set(r,2),n}var Ar=class{buf;pos;constructor(t=Buffer.alloc(xr),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e,r=t.length;if(r)for(this.writeLong(r),e=0;e<r;e++){let r=t[e];if(void 0===r?.name||void 0===r?.value)throw new Error(`Invalid tag format for ${r}, expected {name:string, value: string}`);this.writeString(r.name),this.writeString(r.value)}this.writeLong(0)}toBuffer(){let t=Buffer.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e,r,n=this.buf;if(t>=-1073741824&&t<1073741824){r=t>=0?t<<1:~t<<1|1;do{n[this.pos]=127&r,r>>=7}while(r&&(n[this.pos++]|=128))}else{e=t>=0?2*t:2*-t-1;do{n[this.pos]=127&e,e/=128}while(e>=1&&(n[this.pos++]|=128))}this.pos++,this.buf=n}writeString(t){let e=Buffer.byteLength(t),r=this.buf;this.writeLong(e);let n=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let o,i,s,a;for(o=0,i=e;o<i;o++)s=t.charCodeAt(o),s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):55296==(64512&s)&&56320==(64512&(a=t.charCodeAt(o+1)))?(s=65536+((1023&s)<<10)+(1023&a),o++,r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}this.buf=r}}readLong(){let t,e,r,n,o=0,i=0,s=this.buf;do{t=s[this.pos++],e=128&t,o|=(127&t)<<i,i+=7}while(e&&i<28);if(e){r=o,n=268435456;do{t=s[this.pos++],r+=(127&t)*n,n*=128}while(128&t);return(r%2?-(r+1):r)/2}return o>>1^-(1&o)}skipLong(){let t=this.buf;for(;128&t[this.pos++];);}readTags(){let t,e=[];for(;t=this.readLong();)for(t<0&&(t=-t,this.skipLong());t--;){let t=this.readString(),r=this.readString();e.push({name:t,value:r})}return e}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function _r(t){let e=new Ar;return e.writeTags(t),e.toBuffer()}function Rr(t){let e=new Ar;return e.writeTags(t),e.tagsExceedLimit()}function Ur(t){return new Ar(t).readTags()}function Cr(t){let e=0;for(let r=t.length-1;r>=0;r--)e=256*e+t[r];return e}function Lr(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let n=255&t;e[r]=n,t=(t-n)/256}return Uint8Array.from(e)}var jr=tr(ur(),1),Pr=tr(cr(),1),xr=4096,Nr=80,Zr=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return void 0!==t.binary}get signatureType(){let t=Cr(this.binary.subarray(0,2));if(void 0!==mr?.[t])return t;throw new Error("Unknown signature type: "+t)}async isValid(){return Zr.verify(this.binary)}get id(){return(async()=>Or.default.encode(await this.rawId))()}set id(t){this._id=Or.default.toBuffer(t)}get rawId(){return(async()=>Pr.Buffer.from(await jr.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Or.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Sr[this.signatureType].sigLength}get owner(){return Or.default.encode(this.rawOwner)}get ownerLength(){return Sr[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return 1==this.binary[t]?this.binary.subarray(t+1,t+33):Pr.Buffer.alloc(0)}get target(){return Or.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return 1==this.binary[t]?this.binary.subarray(t+1,t+33):Pr.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=Cr(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(0==Cr(this.binary.subarray(t,t+8)))return[];let e=Cr(this.binary.subarray(t+8,t+16));return Ur(Pr.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map((t=>({name:Or.default.encode(t.name),value:Or.default.encode(t.value)})))}getStartOfData(){let t=this.getTagsStart();return t+16+Cr(this.binary.subarray(t+8,t+16))}get rawData(){let t=this.getTagsStart(),e=t+16+Cr(this.binary.subarray(t+8,t+16));return this.binary.subarray(e,this.binary.length)}get data(){return Or.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await Tr(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=Pr.Buffer.from(await Er().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map((t=>({name:Or.default.encode(t.name),value:Or.default.encode(t.value)}))),data:this.data}}static async verify(t){if(t.byteLength<Nr)return!1;let e=new Zr(t),r=e.signatureType,n=e.getTagsStart(),o=Cr(t.subarray(n,n+8)),i=Cr(t.subarray(n+8,n+16));if(i>xr)return!1;if(o>0)try{if(Ur(Pr.Buffer.from(t.subarray(n+16,n+16+i))).length!==o)return!1}catch{return!1}let s=Ir[r],a=await Br(e);return await s.verify(e.rawOwner,a,e.rawSignature)}async getSignatureData(){return Br(this)}getTagsStart(){let t=this.getTargetStart(),e=t+(1==this.binary[t]?33:1);return e+=1==this.binary[e]?33:1,e}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1;return t+=1==this.binary[this.getTargetStart()]?32:0,t}},Kr=tr(nr(),1);function zr(t,e,r){let n=e.publicKey,o=r?.target?Kr.default.toBuffer(r.target):null,i=1+(o?.byteLength??0),s=r?.anchor?Buffer.from(r.anchor):null,a=1+(s?.byteLength??0),c=(r?.tags?.length??0)>0?_r(r.tags):null,u=16+(c?c.byteLength:0),f=Buffer.from(t),l=f.byteLength,h=2+e.signatureLength+e.ownerLength+i+a+u+l,d=Buffer.alloc(h);if(d.set(function(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let n=255&t;e[r]=n,t=(t-n)/256}return Uint8Array.from(e)}(e.signatureType),0),d.set(new Uint8Array(e.signatureLength).fill(0),2),n.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${n.byteLength}`);d.set(n,2+e.signatureLength);let p=2+e.signatureLength+e.ownerLength;if(d[p]=o?1:0,o){if(32!==o.byteLength)throw new Error(`Target must be 32 bytes but was incorrectly ${o.byteLength}`);d.set(o,p+1)}let g=p+i,y=g+1;if(d[g]=s?1:0,s){if(y+=s.byteLength,32!==s.byteLength)throw new Error("Anchor must be 32 bytes");d.set(s,g+1)}d.set(Lr(r?.tags?.length??0),y);let m=Lr(c?.byteLength??0);d.set(m,y+8),c&&d.set(c,y+16);let w=y+u;return d.set(f,w),new Zr(d)}var Wr={...fr};globalThis.arbundles??=Wr;var Dr=()=>async function(t){const e=new et(t);return await e.checkSession(),e}({domain:"auth.othent.io",clientId:"uXkRmJoIa0NfzYgYEDAgj6Rss4wR1tIc",authorizationParams:{redirect_uri:window.location.origin}});function Fr(t,e){return t.getTokenSilently({detailedResponse:!0,authorizationParams:e,cacheMode:"off"})}var Mr=Xe.create({baseURL:"https://kms-server.othent.io"});async function Xr(t){const e=await Dr(),r={transaction_input:JSON.stringify({othentFunction:"KMS",data:t})};return(await Fr(e,r)).id_token}async function Jr(){const t=localStorage.getItem("id_token");if(!t)throw new Error("Error retrieving session id_token.");const e=o(t);return delete e.nonce,delete e.sid,delete e.aud,delete e.iss,delete e.iat,delete e.exp,delete e.updated_at,e}async function Yr(){const t=await async function(){const t=await Dr(),e=await t.isAuthenticated(),r={authorizationParams:{transaction_input:JSON.stringify({othentFunction:"KMS"}),redirect_uri:window.location.origin}},n=async e=>{await t.loginWithPopup(e);const r={transaction_input:JSON.stringify({othentFunction:"KMS"})},n=await Fr(t,r),i=o(n.id_token);return localStorage.setItem("id_token",n.id_token),{encoded:n.id_token,decoded:i}},i=async t=>(["nonce","sid","aud","iss","iat","exp","updated_at"].forEach((e=>delete t[e])),t);if(e){const{decoded:t}=await n(r);return i(t)}try{const{decoded:t}=await n(r);return i(t)}catch(t){throw new Error(`${t}`)}}();if("KMS"===t.authSystem&&t.owner&&t.walletAddress)return t;{await async function(){const t=await Xr({data:null});try{const e=(await Mr.post("/create-user",{encodedData:t})).data.data;if(!e)throw new Error("Error creating user on server.");return e}catch(t){throw new Error("Error creating user on server.")}}();const t=await async function(){const t=await Dr(),e={transaction_input:JSON.stringify({othentFunction:"KMS"})};return(await Fr(t,e)).id_token}();return localStorage.setItem("id_token",JSON.stringify(t)),await Jr()}}async function Vr(t){const e=await Jr(),r=await async function(t,e){const r=await Xr({ciphertext:t,keyName:e});try{const t=(await Mr.post("/decrypt",{encodedData:r})).data.data;if(!t)throw new Error("Error decrypting on server.");return t}catch(t){throw new Error("Error decrypting on server.")}}(t,e.sub);return r}function Gr(t,e="utf8"){return Je.lW.isBuffer(t)?$r(t.toString("base64")):$r(Je.lW.from(t,e).toString("base64"))}function Hr(t){return function(t){let e=t.length,r=e%4;if(!r)return t;let n=e,o=4-r,i=e+o,s=Je.lW.alloc(i);for(s.write(t);o--;)s.write("=",n++);return s.toString()}(t=t.toString()).replace(/\-/g,"+").replace(/_/g,"/")}function $r(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function qr(t){return Je.lW.from(Hr(t),"base64")}var Qr=Gr;async function tn(t,e){try{const r=function(t){const e=t.replace(/-----BEGIN PUBLIC KEY-----/,"").replace(/-----END PUBLIC KEY-----/,"").replace(/\s/g,""),r=window.atob(e),n=new Uint8Array(r.length);for(let t=0;t<r.length;t++)n[t]=r.charCodeAt(t);return n.buffer}(t),n=await window.crypto.subtle.importKey("spki",r,{name:"RSA-OAEP",hash:{name:"SHA-256"}},!0,["encrypt"]);return function(t){try{let e="";const r=new Uint8Array(t),n=r.byteLength;for(let t=0;t<n;t++)e+=String.fromCharCode(r[t]);return window.btoa(e)}catch(t){console.error("Eror in buffertoBase64 : ",t)}}(await window.crypto.subtle.encrypt({name:"RSA-OAEP"},n,(new TextEncoder).encode(e)))}catch(t){return console.error("rsaEncrypt error:",t),null}}Qr.encode=Gr,Qr.decode=function(t,e="utf8"){return Je.lW.from(Hr(t),"base64").toString(e)},Qr.toBase64=Hr,Qr.fromBase64=$r,Qr.toBuffer=qr,window.Buffer=Je.lW;const en=async()=>(await s.e(423).then(s.t.bind(s,153,23))).default;function rn(t){let{requestData:r,webpageName:n,proofMode:o=!1}=t;const i=window.location.href,s=async()=>{try{console.log("Main initiate othent"),console.log("Main loaded othent");const t=await Yr(),e=(await en())(t.sub).toString(),s=await async function(t){const e={Info:{hashedOthentSub:t},request:"PIN"};return await fetch("https://api2.onairos.uk/getAccountInfoFromOthentSub",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then((t=>t.json())).then((t=>t)).catch((t=>console.error(t)))}(e);function a(t){try{const e=window.atob(t),r=new Uint8Array(e.length);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);return r.buffer}catch(t){console.error("Error converting to Buffer :",t)}}const c=a(s.result);tn("\n -----BEGIN PUBLIC KEY-----\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4wkWvRPaJiY8CwQ5BoJI\n amcGAYV91Bk8NrvWq4PXM+J/RJugfgTNCYKQ/c6g4xa1YES/tJEzFS7nf0Kdoqxm\n 5aav0ru5vS4fc4vCOLTI9W1T7nj02NY91rogsQm2/KMxUQ8DaLeTZKi+0Wjsa9YO\n 6XGGd1wh4azgQkj04MWW5J1EBCcBavKoY+C85oA9jkkklQ8nGWgbugmZs7eXHNQb\n qH8/ZHcB9Kx1CZ6XjQuVd6YE/A+swV+DksbkXANcYjr6SY/2TbB8GfpcOMM3bkyN\n Q8e0A51q5a8abfuAkDZXe67MwKMWu/626abwPZhJrKr5HhRZZDwPtnXlktYHhOK6\n lQIDAQAB\n -----END PUBLIC KEY-----\n ",await Vr(c)).then((t=>{window.postMessage({source:"webpage",type:"GET_API_URL",webpageName:n,domain:i,requestData:r,proofMode:o,HashedOthentSub:e,EncryptedUserPin:t})})).catch((t=>{console.error("Encryption failed:",t)}))}catch(u){console.error({fix:"Please ensure you have stored your model"}),console.error("Error Sending Data to Terminal: ",u)}};return e.createElement("div",null,e.createElement("button",{className:"OnairosConnect w-20 h-20 flex flex-col items-center justify-center text-white font-bold py-2 px-4 rounded cursor-pointer",onClick:async()=>{if(void 0!==window.onairos?(console.log("Onairos is installed!"),console.log("Onairos info:",window.onairos.getInfo())):console.log("Onairos is not installed."),window.addEventListener("onairosReady",(function(){console.log("Onairos was just detected!")})),void 0!==window.onairos)if(console.log("Onairos extension installed"),(await(async()=>fetch("https://api2.onairos.uk/valid/validate-domain",{method:"POST",headers:{"Content-Type":"application/json"}}).then((t=>t.json().then((e=>({status:t.status,body:e}))))).catch((t=>console.error(t))))()).body.status){console.log("Domain validated");try{(()=>{const t=["Small","Medium","Large"],e=["type","descriptions","reward"];if("string"!=typeof n)throw new Error("Property webpageName must be a String");for(const n of t){if(!(n in r))throw new Error("Missing key '".concat(n,"' in requestData."));for(const t of e){if(!(t in r[n]))throw new Error("Missing property '".concat(t,"' in requestData.").concat(n,"."));if("reward"!==t&&"string"!=typeof r[n][t])throw new Error("Property '".concat(t,"' in requestData.").concat(n," must be a string."));if("reward"!==t&&""===r[n][t].trim())throw new Error("Property '".concat(t,"' in requestData.").concat(n," cannot be empty."))}}})(),await s()}catch(t){console.error("Error connecting to Onairos",t)}}else console.error("Please make sure this is an Onairos Partnered app");else window.open("https://chromewebstore.google.com/detail/onairos/apkfageplidiblifhnadehmplfccapkf","_blank")}},e.createElement("img",{src:"https://onairos.sirv.com/Images/OnairosBlack.png",alt:"Onairos Logo",className:"w-16 h-16 object-contain mb-2"})," ",e.createElement("span",{className:"whitespace-nowrap"},"Connect to Onairos")," "))}})(),a})()));
|
|
2
2
|
//# sourceMappingURL=onairos.bundle.js.map
|