diff --git a/.github/workflows/build-examples.yml b/.github/workflows/build-examples.yml index 3120bcd2c..efaee49c3 100644 --- a/.github/workflows/build-examples.yml +++ b/.github/workflows/build-examples.yml @@ -31,7 +31,7 @@ jobs: node-version: [16.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 @@ -74,7 +74,7 @@ jobs: name: SonarCloud runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: SonarCloud Scan diff --git a/.github/workflows/deploy-to-gh-pages.yml b/.github/workflows/deploy-to-gh-pages.yml index cea0c517d..93b6d8c3d 100644 --- a/.github/workflows/deploy-to-gh-pages.yml +++ b/.github/workflows/deploy-to-gh-pages.yml @@ -27,7 +27,7 @@ jobs: node-version: [16.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 diff --git a/.github/workflows/ecommerce-store-website.yml b/.github/workflows/ecommerce-store-website.yml index 886bcca85..7466f0d55 100644 --- a/.github/workflows/ecommerce-store-website.yml +++ b/.github/workflows/ecommerce-store-website.yml @@ -13,7 +13,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: 16 @@ -53,7 +53,7 @@ jobs: name: ecommerce-store-website path: ecommerce-store-website/out/ - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/socios-auth2.yml b/.github/workflows/socios-auth2.yml new file mode 100644 index 000000000..e3bf44b3b --- /dev/null +++ b/.github/workflows/socios-auth2.yml @@ -0,0 +1,76 @@ +name: "socios-oauth2 CI" + +on: + push: + branches: + - main + - staging + pull_request: + branches: + - "*" + workflow_dispatch: + +env: + PROJ_PATH: socios-oauth2 + DEPLOY_URL: https://socios-oauth2.tokenscript.org/ + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: "npm" + cache-dependency-path: ${{ env.PROJ_PATH }}/package-lock.json + - run: | + echo -n "Node version: " + node -v + echo -n "Npm version: " + npm -v + - name: build + run: | + cd "${PROJ_PATH}" + npm ci + npm run build + - uses: actions/upload-artifact@v3 + with: + name: socios-oauth2 + path: ${{ env.PROJ_PATH }}/dist/ + + deploy: + runs-on: ubuntu-latest + environment: + name: socios-oauth2 + url: ${{ env.DEPLOY_URL }} + needs: + - build + if: ${{ contains( + fromJson('["push", "workflow_dispatch"]'), + github.event_name) && + contains( + fromJson('["staging"]'), + github.ref_name) + }} + steps: + - uses: actions/download-artifact@v3 + with: + name: socios-oauth2 + path: ${{ env.PROJ_PATH }}/dist/ + - name: Deploy to EC2 + uses: easingthemes/ssh-deploy@v4 + with: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + REMOTE_HOST: 54.177.203.8 + REMOTE_USER: ubuntu + ARGS: "-aPz --delete" + SOURCE: "${{ env.PROJ_PATH }}/dist/" + TARGET: /opt/services/socios-oauth2/ + SCRIPT_AFTER: | + sudo systemctl restart socios-oauth2 + - name: check deploy + run: | + for i in $(seq 15); do + curl -sfL --connect-timeout 30 "${DEPLOY_URL}" && exit || sleep 5 + done && exit 1 \ No newline at end of file diff --git a/.github/workflows/token-outlet-website.yml b/.github/workflows/token-outlet-website.yml index ca3bee89a..f8b822f07 100644 --- a/.github/workflows/token-outlet-website.yml +++ b/.github/workflows/token-outlet-website.yml @@ -25,7 +25,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: 16 @@ -82,7 +82,7 @@ jobs: name: token-outlet-website path: token-outlet-website/build/ - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/angular-bare-bones-demo/dist/235.c021a217ad7b926f.js b/angular-bare-bones-demo/dist/235.c021a217ad7b926f.js deleted file mode 100644 index 4b4d4f8bf..000000000 --- a/angular-bare-bones-demo/dist/235.c021a217ad7b926f.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkAngular_bare_bones_demo=self.webpackChunkAngular_bare_bones_demo||[]).push([[235],{18983:function(Ki,er){!function(B){"use strict";function tn(t){if(Array.isArray(t))return t}function ar(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r=0;--Y){var D=this.tryEntries[Y],ut=D.completion;if("root"===D.tryLoc)return U("end");if(D.tryLoc<=this.prev){var it=o.call(D,"catchLoc"),yt=o.call(D,"finallyLoc");if(it&&yt){if(this.prev=0;--U){var Y=this.tryEntries[U];if(Y.tryLoc<=this.prev&&o.call(Y,"finallyLoc")&&this.prev=0;--A){var U=this.tryEntries[A];if(U.finallyLoc===_)return this.complete(U.completion,U.afterLoc),At(U),m}},catch:function(_){for(var A=this.tryEntries.length-1;A>=0;--A){var U=this.tryEntries[A];if(U.tryLoc===_){var Y=U.completion;if("throw"===Y.type){var D=Y.arg;At(U)}return D}}throw new Error("illegal catch attempt")},delegateYield:function(_,A,U){return this.delegate={iterator:_t(_),resultName:A,nextLoc:U},"next"===this.method&&(this.arg=void 0),m}},e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}(Xa);var $a,or=Xa.exports(),h=or;try{regeneratorRuntime=or}catch{"object"===(typeof globalThis>"u"?"undefined":z(globalThis))?globalThis.regeneratorRuntime=or:Function("r","regeneratorRuntime = r")(or)}function Qa(t){if(typeof Symbol<"u"&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Fn(t){return tn(t)||Qa(t)||yn(t)||Va()}function q(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function to(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,e)}return r}function O(t){for(var n=1;n=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(c){throw c},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return u=c.done,c},e:function(c){i=!0,o=c},f:function(){try{u||null==r.return||r.return()}finally{if(i)throw o}}}}var Hi="function"==typeof queueMicrotask?queueMicrotask:function(t){return($a||($a=Promise.resolve())).then(t).catch(function(n){return setTimeout(function(){throw n},0)})},Wi=function(){var t,n=[];return{deliver:function(r){return x(h.mark(function e(){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:n.push(r),t&&(t(n.shift()),t=void 0);case 2:case"end":return a.stop()}},e)}))()},receive:function(){return new Promise(function(r){var e=n.shift();if(e)return r(e);t=r})}}},Nr="INIT",cn="SUBSCRIBE",nn="UNSUBSCRIBE",Br="UPDATED",no="SNAPSHOT",$="object"===(typeof self>"u"?"undefined":z(self))&&self.self===self&&self||"object"===(typeof global>"u"?"undefined":z(global))&&global.global===global&&global||"object"===(typeof window>"u"?"undefined":z(window))&&window.window===window&&window;$.FCL_REGISTRY=$.FCL_REGISTRY??{};var zt,Ji=0,dt=function(t,n,r){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise(function(a,o){var u=e.expectReply||!1,i=null!=e.timeout?e.timeout:5e3;u&&i&&setTimeout(function(){return o(new Error("Timeout: ".concat(i,"ms passed without a response.")))},i);var c={to:t,from:e.from,tag:n,data:r,timeout:i,reply:a,reject:o};try{$.FCL_REGISTRY[t]&&$.FCL_REGISTRY[t].mailbox.deliver(c),u||a(!0)}catch(l){console.error("FCL.Actor -- Could Not Deliver Message",c,$.FCL_REGISTRY[t],l)}})},Xi=function(t){delete $.FCL_REGISTRY[t]},Zi=function(){var n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n=x(h.mark(function r(e){var a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if("function"!=typeof t.INIT){o.next=3;break}return o.next=3,t.INIT(e);case 3:return o.next=6,e.receive();case 6:if(a=o.sent,o.prev=7,"EXIT"!==a.tag){o.next=13;break}if("function"!=typeof t.TERMINATE){o.next=12;break}return o.next=12,t.TERMINATE(e,a,a.data||{});case 12:return o.abrupt("break",25);case 13:return o.next=15,t[a.tag](e,a,a.data||{});case 15:o.next=20;break;case 17:o.prev=17,o.t0=o.catch(7),console.error("".concat(e.self()," Error"),a,o.t0);case 20:return o.prev=20,o.abrupt("continue",3);case 23:o.next=3;break;case 25:case"end":return o.stop()}},r,null,[[7,17,20,23]])})),function(r){return n.apply(this,arguments)}},rn=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null==n&&(n=++Ji),null!=$.FCL_REGISTRY[n])return n;$.FCL_REGISTRY[n]={addr:n,mailbox:Wi(),subs:new Set,kvs:{},error:null};var r={self:function(){return n},receive:function(){return $.FCL_REGISTRY[n].mailbox.receive()},send:function(e,a,o){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return u.from=n,dt(e,a,o,u)},sendSelf:function(e,a,o){$.FCL_REGISTRY[n]&&dt(n,e,a,o)},broadcast:function(e,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o.from=n;var u,i=bt($.FCL_REGISTRY[n].subs);try{for(i.s();!(u=i.n()).done;)dt(u.value,e,a,o)}catch(l){i.e(l)}finally{i.f()}},subscribe:function(e){return null!=e&&$.FCL_REGISTRY[n].subs.add(e)},unsubscribe:function(e){return null!=e&&$.FCL_REGISTRY[n].subs.delete(e)},subscriberCount:function(){return $.FCL_REGISTRY[n].subs.size},hasSubs:function(){return!!$.FCL_REGISTRY[n].subs.size},put:function(e,a){null!=e&&($.FCL_REGISTRY[n].kvs[e]=a)},get:function(e,a){return $.FCL_REGISTRY[n].kvs[e]??a},delete:function(e){delete $.FCL_REGISTRY[n].kvs[e]},update:function(e,a){null!=e&&($.FCL_REGISTRY[n].kvs[e]=a($.FCL_REGISTRY[n].kvs[e]))},keys:function(){return Object.keys($.FCL_REGISTRY[n].kvs)},all:function(){return $.FCL_REGISTRY[n].kvs},where:function(e){return Object.keys($.FCL_REGISTRY[n].kvs).reduce(function(a,o){return e.test(o)?O(O({},a),{},q({},o,$.FCL_REGISTRY[n].kvs[o])):a},{})},merge:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(e).forEach(function(a){return $.FCL_REGISTRY[n].kvs[a]=e[a]})},fatalError:function(e){$.FCL_REGISTRY[n].error=e;var a,o=bt($.FCL_REGISTRY[n].subs);try{for(o.s();!(a=o.n()).done;)dt(a.value,Br)}catch(i){o.e(i)}finally{o.f()}}};return"object"===z(t)&&(t=Zi(t)),Hi(x(h.mark(function e(){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t(r);case 2:Xi(n);case 3:case"end":return a.stop()}},e)}))),n};function ur(t,n,r){n(t);var o,e="@EXIT",a=rn((o=x(h.mark(function u(i){var c,l;return h.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:i.send(t,cn);case 1:return d.next=4,i.receive();case 4:if(l=$.FCL_REGISTRY[t].error,(c=d.sent).tag!==e){d.next=9;break}return i.send(t,nn),d.abrupt("return");case 9:if(!l){d.next=13;break}return r(null,l),i.send(t,nn),d.abrupt("return");case 13:r(c.data,null),d.next=1;break;case 16:case"end":return d.stop()}},u)})),function(u){return o.apply(this,arguments)}));return function(){return dt(a,e)}}function ro(t,n){return n(t),dt(t,no,null,{expectReply:!0,timeout:0})}var Yt="config",eo="PUT_CONFIG",ao="GET_CONFIG",oo="GET_ALL_CONFIG",uo="UPDATE_CONFIG",so="DELETE_CONFIG",io="CLEAR_CONFIG",co="WHERE_CONFIG",jn="CONFIG/UPDATED",fo=function(t){return t},lo=(q(zt={},eo,function(t,n,r){var e=r.key,a=r.value;if(null==e)throw new Error("Missing 'key' for config/put.");t.put(e,a),t.broadcast(jn,O({},t.all()))}),q(zt,ao,function(t,n,r){var e=r.key,a=r.fallback;if(null==e)throw new Error("Missing 'key' for config/get");n.reply(t.get(e,a))}),q(zt,oo,function(t,n){n.reply(O({},t.all()))}),q(zt,uo,function(t,n,r){var e=r.key,a=r.fn;if(null==e)throw new Error("Missing 'key' for config/update");t.update(e,a||fo),t.broadcast(jn,O({},t.all()))}),q(zt,so,function(t,n,r){var e=r.key;if(null==e)throw new Error("Missing 'key' for config/delete");t.delete(e),t.broadcast(jn,O({},t.all()))}),q(zt,io,function(t,n){for(var r=0,e=Object.keys(t.all());r1?i[1]:void 0,(n=i.length>0&&void 0!==i[0]?i[0]:[]).length){c.next=4;break}return c.abrupt("return",r);case 4:return e=Fn(n),a=e[0],o=e.slice(1),c.next=7,Ur(a);case 7:if(null!=(u=c.sent)){c.next=10;break}return c.abrupt("return",Fr(o,r));case 10:return c.abrupt("return",u);case 11:case"end":return c.stop()}},t)})),jr.apply(this,arguments)}function sr(){return dt(Yt,oo,null,{expectReply:!0,timeout:10})}function po(t){return dt(Yt,uo,{key:t,fn:arguments.length>1&&void 0!==arguments[1]?arguments[1]:fo}),j()}function ho(t){return dt(Yt,so,{key:t}),j()}function go(t){return dt(Yt,co,{pattern:t},{expectReply:!0,timeout:10})}function mo(t){return ur(Yt,function(){return rn(lo,Yt)},t)}function vo(t){return dt(Yt,io).then(j(t))}function j(t){return null!=t&&"object"===z(t)&&Object.keys(t).map(function(n){return Lr(n,t[n])}),{put:Lr,get:Ur,all:sr,first:Fr,update:po,delete:ho,where:go,subscribe:mo,overload:yo}}rn(lo,Yt),j.put=Lr,j.get=Ur,j.all=sr,j.first=Fr,j.update=po,j.delete=ho,j.where=go,j.subscribe=mo,j.overload=yo;var $i=function(t){return t};function yo(){var r,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$i;return new Promise((r=x(h.mark(function e(a,o){var u,i;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,sr();case 2:return u=c.sent,c.prev=3,j(t),c.t0=n,c.next=8,sr();case 8:return c.t1=c.sent,c.next=11,(0,c.t0)(c.t1);case 11:return i=c.sent,c.next=14,vo(u);case 14:a(i),c.next=22;break;case 17:return c.prev=17,c.t2=c.catch(3),c.next=21,vo(u);case 21:o(c.t2);case 22:case"end":return c.stop()}},e,null,[[3,17]])})),function(e,a){return r.apply(this,arguments)}))}var bo,wo,Qi={can:!(typeof window>"u"),get:(wo=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",JSON.parse(sessionStorage.getItem(n)));case 1:case"end":return r.stop()}},t)})),function(t){return wo.apply(this,arguments)}),put:(bo=x(h.mark(function t(n,r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",sessionStorage.setItem(n,JSON.stringify(r)));case 1:case"end":return e.stop()}},t)})),function(t,n){return bo.apply(this,arguments)})};function xo(t){return ko.apply(this,arguments)}function ko(){return(ko=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=Object,r.t1=Object,r.next=4,j().where(n);case 4:return r.t2=r.sent,r.t3=r.t1.entries.call(r.t1,r.t2).map(function(e){var a=Lt(e,2),u=a[1];return[a[0].replace(n,""),u]}),r.abrupt("return",r.t0.fromEntries.call(r.t0,r.t3));case 7:case"end":return r.stop()}},t)}))).apply(this,arguments)}j({"discovery.wallet.method.default":"IFRAME/RPC","fcl.storage.default":Qi});var Ut="1.3.2";function C(t,n){if(!t){var r,e=new Error("INVARIANT ".concat(n));e.stack=e.stack.split("\n").filter(function(i){return!/at invariant/.test(i)}).join("\n");for(var a=arguments.length,o=new Array(a>2?a-2:0),u=2;u"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function nc(t,n){if(n&&("object"===z(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return Mr(t)}function Yr(t){var n=Io();return function(){var r,e=Gn(t);if(n){var a=Gn(this).constructor;r=Reflect.construct(e,arguments,a)}else r=e.apply(this,arguments);return nc(this,r)}}wt.deprecate=function(t){var n=t.pkg,r=t.subject,e=t.transition,a=t.level,o=void 0===a?St.warn:a,u=t.message,i=void 0===u?"":u,c=t.callback,l=void 0===c?null:c,d=function(){return wt({title:"".concat(n?n+" ":"","Deprecation Notice"),message:"\n ".concat(r?"".concat((g=r,g.charAt(0).toUpperCase()+g.slice(1))," is deprecated and will cease to work in future releases").concat(n?" of "+n:"","."):"").concat(i?"\n"+i:"").concat(e?"\nYou can learn more (including a guide on common transition paths) here: ".concat(e):"","\n ").trim(),level:o});var g};return"function"==typeof l?x(h.mark(function g(){var v=arguments;return h.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,d();case 2:return m.next=4,l.apply(void 0,v);case 4:return m.abrupt("return",m.sent);case 5:case"end":return m.stop()}},g)})):d()};for(var X={},rc={byteLength:function(t){var n=So(t),e=n[1];return 3*(n[0]+e)/4-e},toByteArray:function(t){var n,r,g,e=So(t),a=e[0],o=e[1],u=new ec(3*(a+(g=o))/4-g),i=0,c=o>0?a-4:a;for(r=0;r>16&255,u[i++]=n>>8&255,u[i++]=255&n;return 2===o&&(n=Ct[t.charCodeAt(r)]<<2|Ct[t.charCodeAt(r+1)]>>4,u[i++]=255&n),1===o&&(n=Ct[t.charCodeAt(r)]<<10|Ct[t.charCodeAt(r+1)]<<4|Ct[t.charCodeAt(r+2)]>>2,u[i++]=n>>8&255,u[i++]=255&n),u},fromByteArray:function(t){for(var n,r=t.length,e=r%3,a=[],o=16383,u=0,i=r-e;ui?i:u+o));return 1===e?a.push(qt[(n=t[r-1])>>2]+qt[n<<4&63]+"=="):2===e&&a.push(qt[(n=(t[r-2]<<8)+t[r-1])>>10]+qt[n>>4&63]+qt[n<<2&63]+"="),a.join("")}},qt=[],Ct=[],ec=typeof Uint8Array<"u"?Uint8Array:Array,qr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bn=0,ac=qr.length;bn0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=n),[r,r===n?0:4-r%4]}function oc(t,n,r){for(var a,o=[],u=n;u>18&63]+qt[a>>12&63]+qt[a>>6&63]+qt[63&a]);return o.join("")}Ct["-".charCodeAt(0)]=62,Ct["_".charCodeAt(0)]=63;var Kr={};function fn(t){if(Array.isArray(t)){for(var n=[],r=0;r>1,d=-7,g=r?a-1:0,v=r?-1:1,m=t[n+g];for(g+=v,o=m&(1<<-d)-1,m>>=-d,d+=i;d>0;o=256*o+t[n+g],g+=v,d-=8);for(u=o&(1<<-d)-1,o>>=-d,d+=e;d>0;u=256*u+t[n+g],g+=v,d-=8);if(0===o)o=1-l;else{if(o===c)return u?NaN:1/0*(m?-1:1);u+=Math.pow(2,e),o-=l}return(m?-1:1)*u*Math.pow(2,o-e)},Kr.write=function(t,n,r,e,a,o){var u,i,c,l=8*o-a-1,d=(1<>1,v=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,m=e?0:o-1,b=e?1:-1,E=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(i=isNaN(n)?1:0,u=d):(u=Math.floor(Math.log(n)/Math.LN2),n*(c=Math.pow(2,-u))<1&&(u--,c*=2),(n+=u+g>=1?v/c:v*Math.pow(2,1-g))*c>=2&&(u++,c/=2),u+g>=d?(i=0,u=d):u+g>=1?(i=(n*c-1)*Math.pow(2,a),u+=g):(i=n*Math.pow(2,g-1)*Math.pow(2,a),u=0));a>=8;t[r+m]=255&i,m+=b,i/=256,a-=8);for(u=u<0;t[r+m]=255&u,m+=b,u/=256,l-=8);t[r+m-b]|=128*E},function(t){var n=rc,r=Kr,e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(s){return+s!=s&&(s=0),u.alloc(+s)},t.INSPECT_MAX_BYTES=50;var a=2147483647;function o(s){if(s>a)throw new RangeError('The value "'+s+'" is invalid for option "size"');var f=new Uint8Array(s);return Object.setPrototypeOf(f,u.prototype),f}function u(s,f,p){if("number"==typeof s){if("string"==typeof f)throw new TypeError('The "string" argument must be of type string. Received type number');return l(s)}return i(s,f,p)}function i(s,f,p){if("string"==typeof s)return function(w,P){if("string"==typeof P&&""!==P||(P="utf8"),!u.isEncoding(P))throw new TypeError("Unknown encoding: "+P);var M=0|m(w,P),tt=o(M),rt=tt.write(w,P);return rt!==M&&(tt=tt.slice(0,rt)),tt}(s,f);if(ArrayBuffer.isView(s))return function(w){if(Vt(w,Uint8Array)){var P=new Uint8Array(w);return g(P.buffer,P.byteOffset,P.byteLength)}return d(w)}(s);if(null==s)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+z(s));if(Vt(s,ArrayBuffer)||s&&Vt(s.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Vt(s,SharedArrayBuffer)||s&&Vt(s.buffer,SharedArrayBuffer)))return g(s,f,p);if("number"==typeof s)throw new TypeError('The "value" argument must not be of type number. Received type number');var y=s.valueOf&&s.valueOf();if(null!=y&&y!==s)return u.from(y,f,p);var k=function(w){if(u.isBuffer(w)){var P=0|v(w.length),M=o(P);return 0===M.length||w.copy(M,0,0,P),M}return void 0!==w.length?"number"!=typeof w.length||Ha(w.length)?o(0):d(w):"Buffer"===w.type&&Array.isArray(w.data)?d(w.data):void 0}(s);if(k)return k;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof s[Symbol.toPrimitive])return u.from(s[Symbol.toPrimitive]("string"),f,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+z(s))}function c(s){if("number"!=typeof s)throw new TypeError('"size" argument must be of type number');if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function l(s){return c(s),o(s<0?0:0|v(s))}function d(s){for(var f=s.length<0?0:0|v(s.length),p=o(f),y=0;y=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|s}function m(s,f){if(u.isBuffer(s))return s.length;if(ArrayBuffer.isView(s)||Vt(s,ArrayBuffer))return s.byteLength;if("string"!=typeof s)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+z(s));var p=s.length,y=arguments.length>2&&!0===arguments[2];if(!y&&0===p)return 0;for(var k=!1;;)switch(f){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return Qt(s).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*p;case"hex":return p>>>1;case"base64":return qi(s).length;default:if(k)return y?-1:Qt(s).length;f=(""+f).toLowerCase(),k=!0}}function b(s,f,p){var y=!1;if((void 0===f||f<0)&&(f=0),f>this.length||((void 0===p||p>this.length)&&(p=this.length),p<=0)||(p>>>=0)<=(f>>>=0))return"";for(s||(s="utf8");;)switch(s){case"hex":return Nt(this,f,p);case"utf8":case"utf-8":return It(this,f,p);case"ascii":return Rt(this,f,p);case"latin1":case"binary":return _t(this,f,p);case"base64":return lt(this,f,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,f,p);default:if(y)throw new TypeError("Unknown encoding: "+s);s=(s+"").toLowerCase(),y=!0}}function E(s,f,p){var y=s[f];s[f]=s[p],s[p]=y}function S(s,f,p,y,k){if(0===s.length)return-1;if("string"==typeof p?(y=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),Ha(p=+p)&&(p=k?0:s.length-1),p<0&&(p=s.length+p),p>=s.length){if(k)return-1;p=s.length-1}else if(p<0){if(!k)return-1;p=0}if("string"==typeof f&&(f=u.from(f,y)),u.isBuffer(f))return 0===f.length?-1:N(s,f,p,y,k);if("number"==typeof f)return f&=255,"function"==typeof Uint8Array.prototype.indexOf?k?Uint8Array.prototype.indexOf.call(s,f,p):Uint8Array.prototype.lastIndexOf.call(s,f,p):N(s,[f],p,y,k);throw new TypeError("val must be string, number or Buffer")}function N(s,f,p,y,k){var w,P=1,M=s.length,tt=f.length;if(void 0!==y&&("ucs2"===(y=String(y).toLowerCase())||"ucs-2"===y||"utf16le"===y||"utf-16le"===y)){if(s.length<2||f.length<2)return-1;P=2,M/=2,tt/=2,p/=2}function rt(nr,rr){return 1===P?nr[rr]:nr.readUInt16BE(rr*P)}if(k){var nt=-1;for(w=p;wM&&(p=M-tt),w=p;w>=0;w--){for(var Bt=!0,sn=0;snk&&(y=k):y=k;var w,P=f.length;for(y>P/2&&(y=P/2),w=0;w>8,rt.push(P%256),rt.push(M);return rt}(f,s.length-p),s,p,y)}function lt(s,f,p){return n.fromByteArray(0===f&&p===s.length?s:s.slice(f,p))}function It(s,f,p){p=Math.min(s.length,p);for(var y=[],k=f;k239?4:w>223?3:w>191?2:1;if(k+M<=p){var tt=void 0,rt=void 0,nt=void 0,Bt=void 0;switch(M){case 1:w<128&&(P=w);break;case 2:128==(192&(tt=s[k+1]))&&(Bt=(31&w)<<6|63&tt)>127&&(P=Bt);break;case 3:rt=s[k+2],128==(192&(tt=s[k+1]))&&128==(192&rt)&&(Bt=(15&w)<<12|(63&tt)<<6|63&rt)>2047&&(Bt<55296||Bt>57343)&&(P=Bt);break;case 4:rt=s[k+2],nt=s[k+3],128==(192&(tt=s[k+1]))&&128==(192&rt)&&128==(192&nt)&&(Bt=(15&w)<<18|(63&tt)<<12|(63&rt)<<6|63&nt)>65535&&Bt<1114112&&(P=Bt)}}null===P?(P=65533,M=1):P>65535&&(y.push((P-=65536)>>>10&1023|55296),P=56320|1023&P),y.push(P),k+=M}return function(sn){var nr=sn.length;if(nr<=At)return String.fromCharCode.apply(String,sn);for(var rr="",Wa=0;Wa"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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(s,f,p){return i(s,f,p)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(s,f,p){return k=f,w=p,c(y=s),y<=0?o(y):void 0!==k?"string"==typeof w?o(y).fill(k,w):o(y).fill(k):o(y);var y,k,w},u.allocUnsafe=function(s){return l(s)},u.allocUnsafeSlow=function(s){return l(s)},u.isBuffer=function(s){return null!=s&&!0===s._isBuffer&&s!==u.prototype},u.compare=function(s,f){if(Vt(s,Uint8Array)&&(s=u.from(s,s.offset,s.byteLength)),Vt(f,Uint8Array)&&(f=u.from(f,f.offset,f.byteLength)),!u.isBuffer(s)||!u.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(s===f)return 0;for(var p=s.length,y=f.length,k=0,w=Math.min(p,y);ky.length?(u.isBuffer(w)||(w=u.from(w)),w.copy(y,k)):Uint8Array.prototype.set.call(y,w,k);else{if(!u.isBuffer(w))throw new TypeError('"list" argument must be an Array of Buffers');w.copy(y,k)}k+=w.length}return y},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var s=this.length;if(s%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var f=0;ff&&(s+=" ... "),""},e&&(u.prototype[e]=u.prototype.inspect),u.prototype.compare=function(s,f,p,y,k){if(Vt(s,Uint8Array)&&(s=u.from(s,s.offset,s.byteLength)),!u.isBuffer(s))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+z(s));if(void 0===f&&(f=0),void 0===p&&(p=s?s.length:0),void 0===y&&(y=0),void 0===k&&(k=this.length),f<0||p>s.length||y<0||k>this.length)throw new RangeError("out of range index");if(y>=k&&f>=p)return 0;if(y>=k)return-1;if(f>=p)return 1;if(this===s)return 0;for(var w=(k>>>=0)-(y>>>=0),P=(p>>>=0)-(f>>>=0),M=Math.min(w,P),tt=this.slice(y,k),rt=s.slice(f,p),nt=0;nt>>=0,isFinite(p)?(p>>>=0,void 0===y&&(y="utf8")):(y=p,p=void 0)}var k=this.length-f;if((void 0===p||p>k)&&(p=k),s.length>0&&(p<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");y||(y="utf8");for(var w=!1;;)switch(y){case"hex":return T(this,s,f,p);case"utf8":case"utf-8":return R(this,s,f,p);case"ascii":case"latin1":case"binary":return L(this,s,f,p);case"base64":return I(this,s,f,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,s,f,p);default:if(w)throw new TypeError("Unknown encoding: "+y);y=(""+y).toLowerCase(),w=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var At=4096;function Rt(s,f,p){var y="";p=Math.min(s.length,p);for(var k=f;ky)&&(p=y);for(var k="",w=f;wp)throw new RangeError("Trying to access beyond buffer length")}function U(s,f,p,y,k,w){if(!u.isBuffer(s))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>k||fs.length)throw new RangeError("Index out of range")}function Y(s,f,p,y,k){Tt(f,y,k,s,p,7);var w=Number(f&BigInt(4294967295));s[p++]=w,s[p++]=w>>=8,s[p++]=w>>=8,s[p++]=w>>=8;var P=Number(f>>BigInt(32)&BigInt(4294967295));return s[p++]=P,s[p++]=P>>=8,s[p++]=P>>=8,s[p++]=P>>=8,p}function D(s,f,p,y,k){Tt(f,y,k,s,p,7);var w=Number(f&BigInt(4294967295));s[p+7]=w,s[p+6]=w>>=8,s[p+5]=w>>=8,s[p+4]=w>>=8;var P=Number(f>>BigInt(32)&BigInt(4294967295));return s[p+3]=P,s[p+2]=P>>=8,s[p+1]=P>>=8,s[p]=P>>=8,p+8}function ut(s,f,p,y,k,w){if(p+y>s.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function it(s,f,p,y,k){return f=+f,p>>>=0,k||ut(s,0,p,4),r.write(s,f,p,y,23,4),p+4}function yt(s,f,p,y,k){return f=+f,p>>>=0,k||ut(s,0,p,8),r.write(s,f,p,y,52,8),p+8}u.prototype.slice=function(s,f){var p=this.length;(s=~~s)<0?(s+=p)<0&&(s=0):s>p&&(s=p),(f=void 0===f?p:~~f)<0?(f+=p)<0&&(f=0):f>p&&(f=p),f>>=0,f>>>=0,p||A(s,f,this.length);for(var y=this[s],k=1,w=0;++w>>=0,f>>>=0,p||A(s,f,this.length);for(var y=this[s+--f],k=1;f>0&&(k*=256);)y+=this[s+--f]*k;return y},u.prototype.readUint8=u.prototype.readUInt8=function(s,f){return s>>>=0,f||A(s,1,this.length),this[s]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(s,f){return s>>>=0,f||A(s,2,this.length),this[s]|this[s+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(s,f){return s>>>=0,f||A(s,2,this.length),this[s]<<8|this[s+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(s,f){return s>>>=0,f||A(s,4,this.length),(this[s]|this[s+1]<<8|this[s+2]<<16)+16777216*this[s+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(s,f){return s>>>=0,f||A(s,4,this.length),16777216*this[s]+(this[s+1]<<16|this[s+2]<<8|this[s+3])},u.prototype.readBigUInt64LE=un(function(s){$t(s>>>=0,"offset");var f=this[s],p=this[s+7];void 0!==f&&void 0!==p||on(s,this.length-8);var y=f+this[++s]*Math.pow(2,8)+this[++s]*Math.pow(2,16)+this[++s]*Math.pow(2,24),k=this[++s]+this[++s]*Math.pow(2,8)+this[++s]*Math.pow(2,16)+p*Math.pow(2,24);return BigInt(y)+(BigInt(k)<>>=0,"offset");var f=this[s],p=this[s+7];void 0!==f&&void 0!==p||on(s,this.length-8);var y=f*Math.pow(2,24)+this[++s]*Math.pow(2,16)+this[++s]*Math.pow(2,8)+this[++s],k=this[++s]*Math.pow(2,24)+this[++s]*Math.pow(2,16)+this[++s]*Math.pow(2,8)+p;return(BigInt(y)<>>=0,f>>>=0,p||A(s,f,this.length);for(var y=this[s],k=1,w=0;++w=(k*=128)&&(y-=Math.pow(2,8*f)),y},u.prototype.readIntBE=function(s,f,p){s>>>=0,f>>>=0,p||A(s,f,this.length);for(var y=f,k=1,w=this[s+--y];y>0&&(k*=256);)w+=this[s+--y]*k;return w>=(k*=128)&&(w-=Math.pow(2,8*f)),w},u.prototype.readInt8=function(s,f){return s>>>=0,f||A(s,1,this.length),128&this[s]?-1*(255-this[s]+1):this[s]},u.prototype.readInt16LE=function(s,f){s>>>=0,f||A(s,2,this.length);var p=this[s]|this[s+1]<<8;return 32768&p?4294901760|p:p},u.prototype.readInt16BE=function(s,f){s>>>=0,f||A(s,2,this.length);var p=this[s+1]|this[s]<<8;return 32768&p?4294901760|p:p},u.prototype.readInt32LE=function(s,f){return s>>>=0,f||A(s,4,this.length),this[s]|this[s+1]<<8|this[s+2]<<16|this[s+3]<<24},u.prototype.readInt32BE=function(s,f){return s>>>=0,f||A(s,4,this.length),this[s]<<24|this[s+1]<<16|this[s+2]<<8|this[s+3]},u.prototype.readBigInt64LE=un(function(s){$t(s>>>=0,"offset");var f=this[s],p=this[s+7];void 0!==f&&void 0!==p||on(s,this.length-8);var y=this[s+4]+this[s+5]*Math.pow(2,8)+this[s+6]*Math.pow(2,16)+(p<<24);return(BigInt(y)<>>=0,"offset");var f=this[s],p=this[s+7];void 0!==f&&void 0!==p||on(s,this.length-8);var y=(f<<24)+this[++s]*Math.pow(2,16)+this[++s]*Math.pow(2,8)+this[++s];return(BigInt(y)<>>=0,f||A(s,4,this.length),r.read(this,s,!0,23,4)},u.prototype.readFloatBE=function(s,f){return s>>>=0,f||A(s,4,this.length),r.read(this,s,!1,23,4)},u.prototype.readDoubleLE=function(s,f){return s>>>=0,f||A(s,8,this.length),r.read(this,s,!0,52,8)},u.prototype.readDoubleBE=function(s,f){return s>>>=0,f||A(s,8,this.length),r.read(this,s,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(s,f,p,y){s=+s,f>>>=0,p>>>=0,y||U(this,s,f,p,Math.pow(2,8*p)-1,0);var k=1,w=0;for(this[f]=255&s;++w>>=0,p>>>=0,y||U(this,s,f,p,Math.pow(2,8*p)-1,0);var k=p-1,w=1;for(this[f+k]=255&s;--k>=0&&(w*=256);)this[f+k]=s/w&255;return f+p},u.prototype.writeUint8=u.prototype.writeUInt8=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,1,255,0),this[f]=255&s,f+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,2,65535,0),this[f]=255&s,this[f+1]=s>>>8,f+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,2,65535,0),this[f]=s>>>8,this[f+1]=255&s,f+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,4,4294967295,0),this[f+3]=s>>>24,this[f+2]=s>>>16,this[f+1]=s>>>8,this[f]=255&s,f+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,4,4294967295,0),this[f]=s>>>24,this[f+1]=s>>>16,this[f+2]=s>>>8,this[f+3]=255&s,f+4},u.prototype.writeBigUInt64LE=un(function(s){return Y(this,s,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=un(function(s){return D(this,s,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(s,f,p,y){if(s=+s,f>>>=0,!y){var k=Math.pow(2,8*p-1);U(this,s,f,p,k-1,-k)}var w=0,P=1,M=0;for(this[f]=255&s;++w>0)-M&255;return f+p},u.prototype.writeIntBE=function(s,f,p,y){if(s=+s,f>>>=0,!y){var k=Math.pow(2,8*p-1);U(this,s,f,p,k-1,-k)}var w=p-1,P=1,M=0;for(this[f+w]=255&s;--w>=0&&(P*=256);)s<0&&0===M&&0!==this[f+w+1]&&(M=1),this[f+w]=(s/P>>0)-M&255;return f+p},u.prototype.writeInt8=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,1,127,-128),s<0&&(s=255+s+1),this[f]=255&s,f+1},u.prototype.writeInt16LE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,2,32767,-32768),this[f]=255&s,this[f+1]=s>>>8,f+2},u.prototype.writeInt16BE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,2,32767,-32768),this[f]=s>>>8,this[f+1]=255&s,f+2},u.prototype.writeInt32LE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,4,2147483647,-2147483648),this[f]=255&s,this[f+1]=s>>>8,this[f+2]=s>>>16,this[f+3]=s>>>24,f+4},u.prototype.writeInt32BE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,4,2147483647,-2147483648),s<0&&(s=4294967295+s+1),this[f]=s>>>24,this[f+1]=s>>>16,this[f+2]=s>>>8,this[f+3]=255&s,f+4},u.prototype.writeBigInt64LE=un(function(s){return Y(this,s,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=un(function(s){return D(this,s,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(s,f,p){return it(this,s,f,!0,p)},u.prototype.writeFloatBE=function(s,f,p){return it(this,s,f,!1,p)},u.prototype.writeDoubleLE=function(s,f,p){return yt(this,s,f,!0,p)},u.prototype.writeDoubleBE=function(s,f,p){return yt(this,s,f,!1,p)},u.prototype.copy=function(s,f,p,y){if(!u.isBuffer(s))throw new TypeError("argument should be a Buffer");if(p||(p=0),y||0===y||(y=this.length),f>=s.length&&(f=s.length),f||(f=0),y>0&&y=this.length)throw new RangeError("Index out of range");if(y<0)throw new RangeError("sourceEnd out of bounds");y>this.length&&(y=this.length),s.length-f>>=0,p=void 0===p?this.length:p>>>0,s||(s=0),"number"==typeof s)for(w=f;w=y+4;p-=3)f="_".concat(s.slice(p-3,p)).concat(f);return"".concat(s.slice(0,p)).concat(f)}function Tt(s,f,p,y,k,w){if(s>p||s3?0===f||f===BigInt(0)?">= 0".concat(M," and < 2").concat(M," ** ").concat(8*(w+1)).concat(M):">= -(2".concat(M," ** ").concat(8*(w+1)-1).concat(M,") and < 2 ** ")+"".concat(8*(w+1)-1).concat(M):">= ".concat(f).concat(M," and <= ").concat(p).concat(M),new pt.ERR_OUT_OF_RANGE("value",P,s)}var tt,rt,nt;tt=y,nt=w,$t(rt=k,"offset"),void 0!==tt[rt]&&void 0!==tt[rt+nt]||on(rt,tt.length-(nt+1))}function $t(s,f){if("number"!=typeof s)throw new pt.ERR_INVALID_ARG_TYPE(f,"number",s)}function on(s,f,p){throw Math.floor(s)!==s?($t(s,p),new pt.ERR_OUT_OF_RANGE(p||"offset","an integer",s)):f<0?new pt.ERR_BUFFER_OUT_OF_BOUNDS:new pt.ERR_OUT_OF_RANGE(p||"offset",">= ".concat(p?1:0," and <= ").concat(f),s)}F("ERR_BUFFER_OUT_OF_BOUNDS",function(s){return s?"".concat(s," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),F("ERR_INVALID_ARG_TYPE",function(s,f){return'The "'.concat(s,'" argument must be of type number. Received type ').concat(z(f))},TypeError),F("ERR_OUT_OF_RANGE",function(s,f,p){var y='The value of "'.concat(s,'" is out of range.'),k=p;return Number.isInteger(p)&&Math.abs(p)>Math.pow(2,32)?k=kt(String(p)):"bigint"==typeof p&&(k=String(p),(p>Math.pow(BigInt(2),BigInt(32))||p<-Math.pow(BigInt(2),BigInt(32)))&&(k=kt(k)),k+="n"),y+" It must be ".concat(f,". Received ").concat(k)},RangeError);var tr=/[^+/0-9A-Za-z-_]/g;function Qt(s,f){var p;f=f||1/0;for(var y=s.length,k=null,w=[],P=0;P55295&&p<57344){if(!k){if(p>56319){(f-=3)>-1&&w.push(239,191,189);continue}if(P+1===y){(f-=3)>-1&&w.push(239,191,189);continue}k=p;continue}if(p<56320){(f-=3)>-1&&w.push(239,191,189),k=p;continue}p=65536+(k-55296<<10|p-56320)}else k&&(f-=3)>-1&&w.push(239,191,189);if(k=null,p<128){if((f-=1)<0)break;w.push(p)}else if(p<2048){if((f-=2)<0)break;w.push(p>>6|192,63&p|128)}else if(p<65536){if((f-=3)<0)break;w.push(p>>12|224,p>>6&63|128,63&p|128)}else{if(!(p<1114112))throw new Error("Invalid code point");if((f-=4)<0)break;w.push(p>>18|240,p>>12&63|128,p>>6&63|128,63&p|128)}}return w}function qi(s){return n.toByteArray(function(f){if((f=(f=f.split("=")[0]).trim().replace(tr,"")).length<2)return"";for(;f.length%4!=0;)f+="=";return f}(s))}function Pr(s,f,p,y){var k;for(k=0;k=f.length||k>=s.length);++k)f[k+p]=s[k];return k}function Vt(s,f){return s instanceof f||null!=s&&null!=s.constructor&&null!=s.constructor.name&&s.constructor.name===f.name}function Ha(s){return s!=s}var fp=function(){for(var s="0123456789abcdef",f=new Array(256),p=0;p<16;++p)for(var y=16*p,k=0;k<16;++k)f[y+k]=s[p]+s[k];return f}();function un(s){return typeof BigInt>"u"?lp:s}function lp(){throw new Error("BigInt not supported")}}(X);var Vr={exports:{}};!function(t,n){var r=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=n=r.fetch,r.fetch&&(n.default=r.fetch.bind(r)),n.Headers=r.Headers,n.Request=r.Request,n.Response=r.Response}(Vr,Vr.exports);var _o=Vr.exports;function Z(t){return null==t?null:t.replace(/^0x/,"").replace(/^Fx/,"")}function at(t){return null==t?null:"0x"+Z(t)}var Jr=function(t){zr(r,t);var n=Yr(r);function r(e){var a,o=e.error,u=e.hostname,i=e.path,c=e.method,l=e.requestBody,d=e.responseBody,g=e.responseStatusText,v=e.statusCode;Dr(this,r);var m="\n HTTP Request Error: An error occurred when interacting with the Access API.\n ".concat(o?"error=".concat(o):"","\n ").concat(u?"hostname=".concat(u):"","\n ").concat(i?"path=".concat(i):"","\n ").concat(c?"method=".concat(c):"","\n ").concat(l?"requestBody=".concat(l):"","\n ").concat(d?"responseBody=".concat(d):"","\n ").concat(g?"responseStatusText=".concat(g):"","\n ").concat(v?"statusCode=".concat(v):"","\n ");return(a=n.call(this,m)).name="HTTP Request Error",a.statusCode=v,a.errorMessage=o,a}return Gr(r)}(ir(Error));function gt(t){return Xr.apply(this,arguments)}function Xr(){return Xr=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,d,g,v,m,b;return h.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return b=function(){return b=x(h.mark(function S(){var N,R=arguments;return h.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return N=R.length>0&&void 0!==R[0]?R[0]:0,L.prev=1,L.next=4,v();case 4:case 14:return L.abrupt("return",L.sent);case 8:if(L.prev=8,L.t0=L.catch(1),![408,429,500,502,503,504].includes(L.t0.statusCode)){L.next=17;break}return L.next=14,new Promise(function(I,W){N1&&void 0!==a[1]?a[1]:{},C((e=a.length>2&&void 0!==a[2]?a[2]:{}).node,"SDK Send Execute Script Error: opts.node must be defined."),C(r.response,"SDK Send Execute Script Error: context.response must be defined."),C(r.Buffer,"SDK Send Execute Script Error: context.Buffer must be defined."),o.next=7,n;case 7:if(!(n=o.sent).block.id){o.next=14;break}return o.next=11,sc(n,r,e);case 11:case 17:case 22:return o.abrupt("return",o.sent);case 14:if(!n.block.height){o.next=20;break}return o.next=17,ic(n,r,e);case 20:return o.next=22,cc(n,r,e);case 23:case"end":return o.stop()}},t)})),ne.apply(this,arguments)}var lc={SHA2_256:1,SHA2_384:2,SHA3_256:3,SHA3_384:4,KMAC128_BLS_BLS12_381:5},pc={ECDSA_P256:1,ECDSA_secp256k1:2,BLS_BLS12_381:3};function dc(t,n,r){return To.apply(this,arguments)}function To(){return(To=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/accounts/".concat(n.account.addr,"?block_height=").concat(n.block.height,"&expand=contracts,keys"),method:"GET",body:null});case 3:return u.abrupt("return",Oo(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function hc(t,n,r){return Co.apply(this,arguments)}function Co(){return(Co=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/accounts/".concat(n.account.addr,"?block_height=sealed&expand=contracts,keys"),method:"GET",body:null});case 3:return u.abrupt("return",Oo(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function Oo(t,n,r){var e,a,o=n.response();return o.tag=t.tag,o.account={address:r.address,balance:Number(r.balance),code:"",contracts:function(u){var i={};if(!u)return i;for(var c=0,l=Object.keys(u);c1&&void 0!==a[1]?a[1]:{},C((e=a.length>2&&void 0!==a[2]?a[2]:{}).node,"SDK Send Get Account Error: opts.node must be defined."),C(r.response,"SDK Send Get Account Error: context.response must be defined."),C(r.Buffer,"SDK Send Get Account Error: context.Buffer must be defined."),o.next=7,n;case 7:if(null===(n=o.sent).block.height){o.next=14;break}return o.next=11,dc(n,r,e);case 11:case 16:return o.abrupt("return",o.sent);case 14:return o.next=16,hc(n,r,e);case 17:case"end":return o.stop()}},t)})),re.apply(this,arguments)}function mc(t,n,r){return Po.apply(this,arguments)}function Po(){return(Po=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/blocks/".concat(n.block.id),method:"GET",body:null});case 3:return u.abrupt("return",ee(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function vc(t,n,r){return No.apply(this,arguments)}function No(){return(No=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/blocks?height=".concat(n.block.height),method:"GET",body:null});case 3:return u.abrupt("return",ee(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function yc(t,n,r){return Bo.apply(this,arguments)}function Bo(){return(Bo=x(h.mark(function t(n,r,e){var a,o,u;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return o=e.httpRequest||gt,u=null!==(a=n.block)&&void 0!==a&&a.isSealed?"sealed":"finalized",c.next=4,o({hostname:e.node,path:"/v1/blocks?height=".concat(u),method:"GET",body:null});case 4:return c.abrupt("return",ee(n,r,c.sent));case 6:case"end":return c.stop()}},t)}))).apply(this,arguments)}function ee(t,n,r){var e=r.length?r[0]:null,a=n.response();return a.tag=t.tag,a.blockHeader={id:e.header.id,parentId:e.header.parent_id,height:Number(e.header.height),timestamp:e.header.timestamp},a}function bc(t){return ae.apply(this,arguments)}function ae(){return ae=x(h.mark(function t(n){var r,e,o,u=arguments;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},C((e=u.length>2&&void 0!==u[2]?u[2]:{}).node,"SDK Send Get Block Header Error: opts.node must be defined."),C(r.response,"SDK Send Get Block Header Error: context.response must be defined."),i.next=6,n;case 6:if(o=null!==(n=i.sent).block.height,null===n.block.id){i.next=15;break}return i.next=12,mc(n,r,e);case 12:case 18:case 23:return i.abrupt("return",i.sent);case 15:if(!o){i.next=21;break}return i.next=18,vc(n,r,e);case 21:return i.next=23,yc(n,r,e);case 24:case"end":return i.stop()}},t)})),ae.apply(this,arguments)}function wc(t,n,r){return Lo.apply(this,arguments)}function Lo(){return(Lo=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/blocks/".concat(n.block.id,"?expand=payload"),method:"GET",body:null});case 3:return u.abrupt("return",oe(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function xc(t,n,r){return Uo.apply(this,arguments)}function Uo(){return(Uo=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/blocks?height=".concat(n.block.height,"&expand=payload"),method:"GET",body:null});case 3:return u.abrupt("return",oe(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function kc(t,n,r){return Fo.apply(this,arguments)}function Fo(){return(Fo=x(h.mark(function t(n,r,e){var a,o,u;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return o=e.httpRequest||gt,u=null!==(a=n.block)&&void 0!==a&&a.isSealed?"sealed":"final",c.next=4,o({hostname:e.node,path:"/v1/blocks?height=".concat(u,"&expand=payload"),method:"GET",body:null});case 4:return c.abrupt("return",oe(n,r,c.sent));case 6:case"end":return c.stop()}},t)}))).apply(this,arguments)}function oe(t,n,r){var e=r.length?r[0]:null,a=n.response();return a.tag=t.tag,a.block={id:e.header.id,parentId:e.header.parent_id,height:Number(e.header.height),timestamp:e.header.timestamp,collectionGuarantees:e.payload.collection_guarantees.map(function(o){return{collectionId:o.collection_id,signerIds:o.signer_ids}}),blockSeals:e.payload.block_seals.map(function(o){return{blockId:o.block_id,executionReceiptId:o.result_id}})},a}function Ec(t){return ue.apply(this,arguments)}function ue(){return ue=x(h.mark(function t(n){var r,e,o,u=arguments;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},C((e=u.length>2&&void 0!==u[2]?u[2]:{}).node,"SDK Send Get Block Error: opts.node must be defined."),C(r.response,"SDK Send Get Block Error: context.response must be defined."),i.next=6,n;case 6:if(o=null!==(n=i.sent).block.height,null===n.block.id){i.next=15;break}return i.next=12,wc(n,r,e);case 12:case 18:case 23:return i.abrupt("return",i.sent);case 15:if(!o){i.next=21;break}return i.next=18,xc(n,r,e);case 21:return i.next=23,kc(n,r,e);case 24:case"end":return i.stop()}},t)})),ue.apply(this,arguments)}function Ic(t){return se.apply(this,arguments)}function se(){return se=x(h.mark(function t(n){var r,e,a,o,u,i=arguments;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},C((e=i.length>2&&void 0!==i[2]?i[2]:{}).node,"SDK Send Get Collection Error: opts.node must be defined."),C(r.response,"SDK Send Get Collection Error: context.response must be defined."),a=e.httpRequest||gt,c.next=7,a({hostname:e.node,path:"/v1/collections/".concat(n.collection.id,"?expand=transactions"),method:"GET",body:null});case 7:return o=c.sent,(u=r.response()).tag=n.tag,u.collection={id:o.id,transactionIds:o.transactions.map(function(l){return l.id})},c.abrupt("return",u);case 12:case"end":return c.stop()}},t)})),se.apply(this,arguments)}function Sc(t,n,r){return jo.apply(this,arguments)}function jo(){return(jo=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/events?type=".concat(n.events.eventType,"&start_height=").concat(n.events.start,"&end_height=").concat(n.events.end),method:"GET",body:null});case 3:return u.abrupt("return",Go(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function Ac(t,n,r){return Do.apply(this,arguments)}function Do(){return(Do=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/events?type=".concat(n.events.eventType,"&block_ids=").concat(n.events.blockIds.join(",")),method:"GET",body:null});case 3:return u.abrupt("return",Go(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function Go(t,n,r){var e=n.response();return e.tag=t.tag,e.events=[],r.forEach(function(a){return a.events?a.events.forEach(function(o){return e.events.push({blockId:a.block_id,blockHeight:Number(a.block_height),blockTimestamp:a.block_timestamp,type:o.type,transactionId:o.transaction_id,transactionIndex:Number(o.transaction_index),eventIndex:Number(o.event_index),payload:JSON.parse(n.Buffer.from(o.payload,"base64").toString())})}):null}),e}function Rc(t){return ie.apply(this,arguments)}function ie(){return ie=x(h.mark(function t(n){var r,e,a,o,u=arguments;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},C((e=u.length>2&&void 0!==u[2]?u[2]:{}).node,"SDK Send Get Events Error: opts.node must be defined."),C(r.response,"SDK Send Get Events Error: context.response must be defined."),C(r.Buffer,"SDK Send Get Events Error: context.Buffer must be defined."),i.next=7,n;case 7:if(a=null!==(n=i.sent).events.start,o=Array.isArray(n.events.blockIds)&&n.events.blockIds.length>0,C(a||o,"SendGetEventsError: Unable to determine which get events request to send. Either a block height range, or block IDs must be specified."),!a){i.next=17;break}return i.next=14,Sc(n,r,e);case 14:case 19:return i.abrupt("return",i.sent);case 17:return i.next=19,Ac(n,r,e);case 20:case"end":return i.stop()}},t)})),ie.apply(this,arguments)}function _c(t){return ce.apply(this,arguments)}function ce(){return ce=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,d=arguments;return h.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return r=d.length>1&&void 0!==d[1]?d[1]:{},C((e=d.length>2&&void 0!==d[2]?d[2]:{}).node,"SDK Send Get Transaction Error: opts.node must be defined."),C(r.response,"SDK Send Get Transaction Error: context.response must be defined."),C(r.Buffer,"SDK Send Get Transaction Error: context.Buffer must be defined."),a=e.httpRequest||gt,g.next=8,n;case 8:return n=g.sent,g.next=11,a({hostname:e.node,path:"/v1/transactions/".concat(n.transaction.id),method:"GET",body:null});case 11:return o=g.sent,u=function(v){return{address:v.address,keyId:Number(v.key_id),sequenceNumber:Number(v.sequence_number)}},i=function(v){return{address:v.address,keyId:Number(v.key_index),signature:v.signature}},c=function(v){return JSON.parse(r.Buffer.from(v,"base64").toString())},(l=r.response()).tag=n.tag,l.transaction={script:r.Buffer.from(o.script,"base64").toString(),args:K(o.arguments.map(c)),referenceBlockId:o.reference_block_id,gasLimit:Number(o.gas_limit),payer:o.payer,proposalKey:o.proposal_key?u(o.proposal_key):o.proposal_key,authorizers:o.authorizers,payloadSignatures:K(o.payload_signatures.map(i)),envelopeSignatures:K(o.envelope_signatures.map(i))},g.abrupt("return",l);case 19:case"end":return g.stop()}},t)})),ce.apply(this,arguments)}var Tc={UNKNOWN:0,PENDING:1,FINALIZED:2,EXECUTED:3,SEALED:4,EXPIRED:5};function Cc(t){return fe.apply(this,arguments)}function fe(){return fe=x(h.mark(function t(n){var r,e,a,o,u,i=arguments;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},C((e=i.length>2&&void 0!==i[2]?i[2]:{}).node,"SDK Send Get Transaction Status Error: opts.node must be defined."),C(r.response,"SDK Send Get Transaction Status Error: context.response must be defined."),C(r.Buffer,"SDK Send Get Transaction Status Error: context.Buffer must be defined."),a=e.httpRequest||gt,c.next=8,n;case 8:return n=c.sent,c.next=11,a({hostname:e.node,path:"/v1/transaction_results/".concat(n.transaction.id),method:"GET",body:null});case 11:return o=c.sent,(u=r.response()).tag=n.tag,u.transactionStatus={blockId:o.block_id,status:Tc[o.status.toUpperCase()]||"",statusString:o.status.toUpperCase(),statusCode:o.status_code,errorMessage:o.error_message,events:o.events.map(function(l){return{type:l.type,transactionId:l.transaction_id,transactionIndex:Number(l.transaction_index),eventIndex:Number(l.event_index),payload:JSON.parse(r.Buffer.from(l.payload,"base64").toString())}})},c.abrupt("return",u);case 16:case"end":return c.stop()}},t)})),fe.apply(this,arguments)}function Oc(t){return le.apply(this,arguments)}function le(){return le=x(h.mark(function t(n){var r,e,a,o,u=arguments;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},C((e=u.length>2&&void 0!==u[2]?u[2]:{}).node,"SDK Send Ping Error: opts.node must be defined."),C(r.response,"SDK Send Ping Error: context.response must be defined."),a=e.httpRequest||gt,i.next=7,a({hostname:e.node,path:"/v1/blocks?height=sealed",method:"GET",body:null});case 7:return(o=r.response()).tag=n.tag,i.abrupt("return",o);case 10:case"end":return i.stop()}},t)})),le.apply(this,arguments)}var Pc=function(t){return"".concat(withPrefix(t.addr),"-").concat(t.keyId)};function Nc(t){return pe.apply(this,arguments)}function pe(){return pe=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,d,g,v,m,b,E,S,N,T=arguments;return h.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return r=T.length>1&&void 0!==T[1]?T[1]:{},C((e=T.length>2&&void 0!==T[2]?T[2]:{}).node,"SDK Send Transaction Error: opts.node must be defined."),C(r.response,"SDK Send Transaction Error: context.response must be defined."),C(r.Buffer,"SDK Send Transaction Error: context.Buffer must be defined."),a=e.httpRequest||gt,R.next=8,n;case 8:n=R.sent,o=[],u=0,i=Object.values(n.accounts);case 11:if(!(u1&&void 0!==o[1]?o[1]:{},C((a=o.length>2&&void 0!==o[2]?o[2]:{}).node,'SDK Send Error: Either opts.node or "accessNode.api" in config must be defined.'),C(e.ix,"SDK Send Error: context.ix must be defined."),u.next=6,r;case 6:r=u.sent,u.t0=!0,u.next=u.t0===e.ix.isTransaction(r)?10:u.t0===e.ix.isGetTransactionStatus(r)?11:u.t0===e.ix.isGetTransaction(r)?12:u.t0===e.ix.isScript(r)?13:u.t0===e.ix.isGetAccount(r)?14:u.t0===e.ix.isGetEvents(r)?15:u.t0===e.ix.isGetBlock(r)?16:u.t0===e.ix.isGetBlockHeader(r)?17:u.t0===e.ix.isGetCollection(r)?18:u.t0===e.ix.isPing(r)?19:20;break;case 10:return u.abrupt("return",a.sendTransaction?a.sendTransaction(r,e,a):Nc(r,e,a));case 11:return u.abrupt("return",a.sendGetTransactionStatus?a.sendGetTransactionStatus(r,e,a):Cc(r,e,a));case 12:return u.abrupt("return",a.sendGetTransaction?a.sendGetTransaction(r,e,a):_c(r,e,a));case 13:return u.abrupt("return",a.sendExecuteScript?a.sendExecuteScript(r,e,a):fc(r,e,a));case 14:return u.abrupt("return",a.sendGetAccount?a.sendGetAccount(r,e,a):gc(r,e,a));case 15:return u.abrupt("return",a.sendGetEvents?a.sendGetEvents(r,e,a):Rc(r,e,a));case 16:return u.abrupt("return",a.sendGetBlock?a.sendGetBlock(r,e,a):Ec(r,e,a));case 17:return u.abrupt("return",a.sendGetBlockHeader?a.sendGetBlockHeader(r,e,a):bc(r,e,a));case 18:return u.abrupt("return",a.sendGetCollection?a.sendGetCollection(r,e,a):Ic(r,e,a));case 19:return u.abrupt("return",a.sendPing?a.sendPing(r,e,a):Oc(r,e,a));case 20:return u.abrupt("return",r);case 21:case"end":return u.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),he={},Mo={},zo={},Yo={},ge=function(t,n){return function(r,e){var a=2*e,o=2*n;r[a]=t[o],r[a+1]=t[o+1]}};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=(n=ge)&&n.__esModule?n:{default:n};t.default=function(a){for(var o=a.A,u=a.C,i=0;i<25;i+=5){for(var c=0;c<5;c++)(0,r.default)(o,i+c)(u,c);for(var l=0;l<5;l++){var d=2*(i+l),g=(l+1)%5*2,v=(l+2)%5*2;o[d]^=~u[g]&u[v],o[d+1]^=~u[g+1]&u[v+1]}}}}(Yo);var qo={},Ko={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=new Uint32Array([0,1,0,32898,2147483648,32906,2147483648,2147516416,0,32907,0,2147483649,2147483648,2147516545,2147483648,32777,0,138,0,136,0,2147516425,0,2147483658,0,2147516555,2147483648,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,0,32778,2147483648,2147483658,2147483648,2147516545,2147483648,32896,0,2147483649,2147483648,2147516424]);t.default=n})(Ko),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=(n=Ko)&&n.__esModule?n:{default:n};t.default=function(a){var o=a.A,u=2*a.roundIndex;o[0]^=r.default[u],o[1]^=r.default[u+1]}}(qo);var Ho={},Wo={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[10,7,11,17,18,3,5,16,8,21,24,4,15,23,19,13,12,2,20,14,22,9,6,1]}(Wo);var Vo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[1,3,6,10,15,21,28,36,45,55,2,14,27,41,56,8,25,43,62,18,39,61,20,44]})(Vo),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(Wo),r=a(Vo),e=a(ge);function a(u){return u&&u.__esModule?u:{default:u}}t.default=function(u){var i=u.A,c=u.C,l=u.W;(0,e.default)(i,1)(l,0);for(var d=0,g=0,v=0,m=32,b=0;b<24;b++){var E=n.default[b],S=r.default[b];(0,e.default)(i,E)(c,0),l[v=S<32?0:1]=(d=l[0])<>>(m=32-S),l[(v+1)%2]=g<>>m,(0,e.default)(l,0)(i,E),(0,e.default)(c,0)(l,0)}}}(Ho);var Jo={};function Xo(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!t.length&&!n.length||!t.length)return r;if(!n.length)return[].concat(K(r),[t[0]]);var e=Fn(t),a=e[0],o=e.slice(1),u=Fn(n),i=u[0],c=u.slice(1);return void 0!==a&&r.push(a),void 0!==i&&r.push(i),Xo(o,c,r)}function Zo(t){return function(n){return"function"==typeof n?(wt.deprecate({pkg:"FCL/SDK",subject:"Interopolation of functions into template literals",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0001-deprecate-params"}),Zo(t)(n(t))):String(n)}}function cr(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),e=1;e=0||(d[c]=u[c]);return d}(t,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=(n=ge)&&n.__esModule?n:{default:n};t.default=function(a){for(var o=a.A,u=a.C,i=a.D,c=a.W,l=0,d=0,g=0;g<5;g++){var v=2*g,m=2*(g+5),b=2*(g+10),E=2*(g+15),S=2*(g+20);u[v]=o[v]^o[m]^o[b]^o[E]^o[S],u[v+1]=o[v+1]^o[m+1]^o[b+1]^o[E+1]^o[S+1]}for(var N=0;N<5;N++){(0,r.default)(u,(N+1)%5)(c,0),c[0]=(l=c[0])<<1|(d=c[1])>>>31,c[1]=d<<1|l>>>31,i[2*N]=u[(N+4)%5*2]^c[0],i[2*N+1]=u[(N+4)%5*2+1]^c[1];for(var T=0;T<25;T+=5)o[2*(T+N)]^=i[2*N],o[2*(T+N)+1]^=i[2*N+1]}}})(Jo),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(Yo),r=o(qo),e=o(Ho),a=o(Jo);function o(i){return i&&i.__esModule?i:{default:i}}t.default=function(){var i=new Uint32Array(10),c=new Uint32Array(10),l=new Uint32Array(2);return function(d){for(var g=0;g<24;g++)(0,a.default)({A:d,C:i,D:c,W:l}),(0,e.default)({A:d,C:i,W:l}),(0,n.default)({A:d,C:i}),(0,r.default)({A:d,roundIndex:g});i.fill(0),c.fill(0),l.fill(0)}}}(zo),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=X,e=(n=zo)&&n.__esModule?n:{default:n},a=function(i,c){for(var l=0;l>>8,c[l+2]=i[d+1]>>>16,c[l+3]=i[d+1]>>>24,c[l+4]=i[d],c[l+5]=i[d]>>>8,c[l+6]=i[d]>>>16,c[l+7]=i[d]>>>24}return c};t.default=function(i){var c=this,l=i.capacity,d=i.padding,g=(0,e.default)(),v=l/8,m=200-l/4,b=0,E=new Uint32Array(50),S=r.Buffer.allocUnsafe(m);return this.absorb=function(N){for(var T=0;T=m&&(a(S,E),g(E),b=0);return c},this.squeeze=function(){var N=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},T={buffer:N.buffer||r.Buffer.allocUnsafe(v),padding:N.padding||d,queue:r.Buffer.allocUnsafe(S.length),state:new Uint32Array(E.length)};S.copy(T.queue);for(var R=0;R0&&void 0!==arguments[0]?arguments[0]:v;if(!this||this.constructor!==b)return new b(S);if(g&&!g.includes(S))throw new Error("Unsupported hash length");var N=new e.default({capacity:S});return this.update=function(T){var R=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";if(r.Buffer.isBuffer(T))return N.absorb(T),E;if("string"==typeof T)return E.update(r.Buffer.from(T,R));throw new TypeError("Not a string or buffer")},this.digest=function(){var T=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"binary",R="string"==typeof T?{format:T}:T,L=N.squeeze({buffer:R.buffer,padding:R.padding||m});return R.format&&"binary"!==R.format?L.toString(R.format):L},this.reset=function(){return N.reset(),E},this}},o=a({allowedSizes:[224,256,384,512],defaultSize:512,padding:1});t.Keccak=o;var u=a({allowedSizes:[224,256,384,512],defaultSize:512,padding:6});t.SHA3=u;var i=a({allowedSizes:[128,256],defaultSize:256,padding:31});t.SHAKE=i;var c=o;t.SHA3Hash=c,u.SHA3Hash=c,t.default=u}(he);var fr="UNKNOWN",me="SCRIPT",ve="TRANSACTION",ye="GET_TRANSACTION_STATUS",be="GET_ACCOUNT",we="GET_EVENTS",xe="PING",ke="GET_TRANSACTION",Ee="GET_BLOCK",Ie="GET_BLOCK_HEADER",Se="GET_COLLECTION",Re="ACCOUNT",_e="ARGUMENT",Te="authorizer",Ce="payer",Qo="proposer",Lc='{\n "kind":"'.concat(Re,'",\n "tempId":null,\n "addr":null,\n "keyId":null,\n "sequenceNum":null,\n "signature":null,\n "signingFunction":null,\n "resolve":null,\n "role": {\n "proposer":false,\n "authorizer":false,\n "payer":false,\n "param":false\n }\n}'),Uc='{\n "kind":"'.concat(_e,'",\n "tempId":null,\n "value":null,\n "asArgument":null,\n "xform":null,\n "resolve": null,\n "resolveArgument": null\n}'),tu='{\n "tag":"'.concat(fr,'",\n "assigns":{},\n "status":"').concat("OK",'",\n "reason":null,\n "accounts":{},\n "params":{},\n "arguments":{},\n "message": {\n "cadence":null,\n "refBlock":null,\n "computeLimit":null,\n "proposer":null,\n "payer":null,\n "authorizations":[],\n "params":[],\n "arguments":[]\n },\n "proposer":null,\n "authorizations":[],\n "payer":[],\n "events": {\n "eventType":null,\n "start":null,\n "end":null,\n "blockIds":[]\n },\n "transaction": {\n "id":null\n },\n "block": {\n "id":null,\n "height":null,\n "isSealed":null\n },\n "account": {\n "addr":null\n },\n "collection": {\n "id":null\n }\n}'),nu=new Set(Object.keys(JSON.parse(tu))),pr=function(){return JSON.parse(tu)},ru="abcdefghijklmnopqrstuvwxyz0123456789".split(""),Fc=function(){return ru[~~(Math.random()*ru.length)]},Oe=function(){return Array.from({length:10},Fc).join("")},eu=function(t){return"number"==typeof t},au=function(t){return Array.isArray(t)},ou=function(t){return null!==t&&"object"===z(t)},Pe=function(t){return null==t},wn=function(t){return"function"==typeof t},uu=function(t){if(!ou(t)||Pe(t)||eu(t))return!1;var n,r=bt(nu);try{for(r.s();!(n=r.n()).done;)if(!t.hasOwnProperty(n.value))return!1}catch(a){r.e(a)}finally{r.f()}return!0},ht=function(t){return t.status="OK",t},Ne=function(t,n){return t.status="BAD",t.reason=n,t},Ft=function(t){return function(n){return n.tag=t,ht(n)}},su=function(t){return null==t.keyId?t:(C(!isNaN(parseInt(t.keyId)),"account.keyId must be an integer"),O(O({},t),{},{keyId:parseInt(t.keyId)}))},dr=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){C("function"==typeof t||"object"===z(t),"prepAccount must be passed an authorization function or an account object"),C(null!=n.role,"Account must have a role");var e=JSON.parse(Lc),a=n.role,o=Oe();t.authorization&&wn(t.authorization)&&(t={resolve:t.authorization}),!t.authorization&&wn(t)&&(t={resolve:t});var u=t.resolve;return u&&(t.resolve=function(i){for(var c=arguments.length,l=new Array(c>1?c-1:0),d=1;d1&&void 0!==c[1]?c[1]:[],l.prev=1,l.t0=Hc,l.next=5,r;case 5:if(l.t1=l.sent,r=(0,l.t0)(l.t1),!Ue(r)){l.next=9;break}throw new Error("Interaction Error: ".concat(r.reason));case 9:if(e.length){l.next=11;break}return l.abrupt("return",r);case 11:return a=Fn(e),o=a[0],u=a.slice(1),l.next=14,o;case 14:if(!wn(i=l.sent)){l.next=17;break}return l.abrupt("return",gr(i(r),u));case 17:if(!Pe(i)&&i){l.next=19;break}return l.abrupt("return",gr(r,u));case 19:if(!uu(i)){l.next=21;break}return l.abrupt("return",gr(i,u));case 21:throw new Error("Invalid Interaction Composition");case 24:throw l.prev=24,l.t2=l.catch(1),l.t2;case 27:case"end":return l.stop()}},n,null,[[1,24]])}));return function(n){return t.apply(this,arguments)}}(),st=function t(){for(var n=arguments.length,r=new Array(n),e=0;e1&&void 0!==arguments[1]?arguments[1]:Wc;return function(r){return r.assigns[t]=n(r.assigns[t],r),ht(r)}},Fe=Object.freeze({__proto__:null,UNKNOWN:fr,SCRIPT:me,TRANSACTION:ve,GET_TRANSACTION_STATUS:ye,GET_ACCOUNT:be,GET_EVENTS:we,PING:xe,GET_TRANSACTION:ke,GET_BLOCK:Ee,GET_BLOCK_HEADER:Ie,GET_COLLECTION:Se,BAD:"BAD",OK:"OK",ACCOUNT:Re,PARAM:"PARAM",ARGUMENT:_e,AUTHORIZER:Te,PAYER:Ce,PROPOSER:Qo,interaction:pr,uuid:Oe,isNumber:eu,isArray:au,isObj:ou,isNull:Pe,isFn:wn,isInteraction:uu,Ok:ht,Bad:Ne,prepAccount:dr,makeArgument:iu,makeUnknown:jc,makeScript:cu,makeTransaction:fu,makeGetTransactionStatus:lu,makeGetTransaction:pu,makeGetAccount:du,makeGetEvents:hr,makePing:hu,makeGetBlock:gu,makeGetBlockHeader:mu,makeGetCollection:vu,isUnknown:Dc,isScript:Be,isTransaction:en,isGetTransactionStatus:Gc,isGetTransaction:Mc,isGetAccount:Le,isGetEvents:zc,isPing:Yc,isGetBlock:yu,isGetBlockHeader:qc,isGetCollection:Kc,isOk:bu,isBad:Ue,why:wu,isAccount:function(t){return t.kind===Re},isParam:function(t){return"PARAM"===t.kind},isArgument:function(t){return t.kind===_e},pipe:st,get:mr,put:vr,update:xu,destroy:function(t){return function(n){return delete n.assigns[t],ht(n)}}});function yr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return st(pr(),t)}var je=function(){return JSON.parse('{\n "tag":null,\n "transaction":null,\n "transactionStatus":null,\n "transactionId":null,\n "encodedData":null,\n "events":null,\n "account":null,\n "block":null,\n "blockHeader":null,\n "latestBlock":null,\n "collection":null\n}')};function Mn(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return st([gu,function(n){return n.block.isSealed=t,ht(n)}])}function xn(t){return st([du,function(n){return n.account.addr=Z(t),ht(n)}])}var Vc=function(){wt.deprecate({pkg:"@onflow/decode",subject:"Operating upon data of the latestBlock field of the response object",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/decode/WARNINGS.md#0001-Deprecating-latestBlock-field"})},ot=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r);case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),Jc=function(){var t=x(h.mark(function n(){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",null);case 1:case"end":return r.stop()}},n)}));return function(){return t.apply(this,arguments)}}(),Xc=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.staticType);case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),Zc=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{domain:r.domain,identifier:r.identifier});case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),$c=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{path:r.path,address:r.address,borrowType:r.borrowType});case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),Qc=function(){var t=x(h.mark(function n(r,e,a){return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!r){o.next=6;break}return o.next=3,kn(r,e,a);case 3:o.t0=o.sent,o.next=7;break;case 6:o.t0=null;case 7:return o.abrupt("return",o.t0);case 8:case"end":return o.stop()}},n)}));return function(n,r,e){return t.apply(this,arguments)}}(),tf=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{address:r.address,type:r.type});case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),nf=function(){var t=x(h.mark(function n(r,e,a){return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Promise.all(r.map(function(u){return new Promise((i=x(h.mark(function c(l){return h.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.t0=l,d.next=3,kn(u,e,[].concat(K(a),[u.type]));case 3:return d.t1=d.sent,d.abrupt("return",(0,d.t0)(d.t1));case 5:case"end":return d.stop()}},c)})),function(c){return i.apply(this,arguments)}));var i}));case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}},n)}));return function(n,r,e){return t.apply(this,arguments)}}(),rf=function(){var t=x(h.mark(function n(r,e,a){return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,r.reduce(function(){var u=x(h.mark(function i(c,l){return h.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,c;case 2:return c=d.sent,d.next=5,kn(l.key,e,[].concat(K(a),[l.key]));case 5:return d.t0=d.sent,d.next=8,kn(l.value,e,[].concat(K(a),[l.key]));case 8:return c[d.t0]=d.sent,d.abrupt("return",c);case 10:case"end":return d.stop()}},i)}));return function(i,c){return u.apply(this,arguments)}}(),Promise.resolve({}));case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}},n)}));return function(n,r,e){return t.apply(this,arguments)}}(),br=function(){var t=x(h.mark(function n(r,e,a){var o,u;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,r.fields.reduce(function(){var c=x(h.mark(function l(d,g){return h.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,d;case 2:return d=v.sent,v.next=5,kn(g.value,e,[].concat(K(a),[g.name]));case 5:return d[g.name]=v.sent,v.abrupt("return",d);case 7:case"end":return v.stop()}},l)}));return function(l,d){return c.apply(this,arguments)}}(),Promise.resolve({}));case 2:if(o=i.sent,!(u=r.id&&Eu(e,r.id))){i.next=10;break}return i.next=7,u(o);case 7:i.t0=i.sent,i.next=11;break;case 10:i.t0=o;case 11:return i.abrupt("return",i.t0);case 12:case"end":return i.stop()}},n)}));return function(n,r,e){return t.apply(this,arguments)}}(),ku={UInt:ot,Int:ot,UInt8:ot,Int8:ot,UInt16:ot,Int16:ot,UInt32:ot,Int32:ot,UInt64:ot,Int64:ot,UInt128:ot,Int128:ot,UInt256:ot,Int256:ot,Word8:ot,Word16:ot,Word32:ot,Word64:ot,UFix64:ot,Fix64:ot,String:ot,Character:ot,Bool:ot,Address:ot,Void:Jc,Optional:Qc,Reference:tf,Array:nf,Dictionary:rf,Event:br,Resource:br,Struct:br,Enum:br,Type:Xc,Path:Zc,Capability:$c},Eu=function(t,n){var r=Object.keys(t).find(function(e){return/^\/.*\/$/.test(e)?new RegExp(e.substring(1,e.length-1)).test(n):e===n});return n&&r&&t[r]},kn=function(){var t=x(h.mark(function n(r,e,a){var o;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(o=Eu(e,r.type)){u.next=3;break}throw new Error("Undefined Decoder Error: ".concat(r.type,"@").concat(a.join(".")));case 3:return u.next=5,o(r.value,e,a);case 5:return u.abrupt("return",u.sent);case 6:case"end":return u.stop()}},n)}));return function(n,r,e){return t.apply(this,arguments)}}(),De=function(){var t=x(h.mark(function n(r){var e,a,o,u,i=arguments;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return e=i.length>1&&void 0!==i[1]?i[1]:{},a=i.length>2&&void 0!==i[2]?i[2]:[],o=Object.keys(ku).filter(function(l){return!Object.keys(e).find(function(d){return new RegExp(d).test(l)})}).reduce(function(l,d){return l[d]=ku[d],l},e),u=O(O({},o),e),c.abrupt("return",kn(r,u,a));case 5:case"end":return c.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),Jt=function(){var t=x(h.mark(function n(r){var e,a=arguments;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(e=a.length>1&&void 0!==a[1]?a[1]:{},!r.encodedData){o.next=5;break}return o.abrupt("return",De(r.encodedData,e));case 5:if(!r.transactionStatus){o.next=16;break}return o.t0=O,o.t1=O({},r.transactionStatus),o.t2={},o.next=11,Promise.all(r.transactionStatus.events.map(function(){var u=x(h.mark(function i(c){return h.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.t0=c.type,l.t1=c.transactionId,l.t2=c.transactionIndex,l.t3=c.eventIndex,l.next=6,De(c.payload,e);case 6:return l.t4=l.sent,l.abrupt("return",{type:l.t0,transactionId:l.t1,transactionIndex:l.t2,eventIndex:l.t3,data:l.t4});case 8:case"end":return l.stop()}},i)}));return function(i){return u.apply(this,arguments)}}()));case 11:return o.t3=o.sent,o.t4={events:o.t3},o.abrupt("return",(0,o.t0)(o.t1,o.t2,o.t4));case 16:if(!r.transaction){o.next=20;break}return o.abrupt("return",r.transaction);case 20:if(!r.events){o.next=26;break}return o.next=23,Promise.all(r.events.map(function(){var u=x(h.mark(function i(c){return h.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.t0=c.blockId,l.t1=c.blockHeight,l.t2=c.blockTimestamp,l.t3=c.type,l.t4=c.transactionId,l.t5=c.transactionIndex,l.t6=c.eventIndex,l.next=9,De(c.payload,e);case 9:return l.t7=l.sent,l.abrupt("return",{blockId:l.t0,blockHeight:l.t1,blockTimestamp:l.t2,type:l.t3,transactionId:l.t4,transactionIndex:l.t5,eventIndex:l.t6,data:l.t7});case 11:case"end":return l.stop()}},i)}));return function(i){return u.apply(this,arguments)}}()));case 23:return o.abrupt("return",o.sent);case 26:if(!r.account){o.next=30;break}return o.abrupt("return",r.account);case 30:if(!r.block){o.next=34;break}return o.abrupt("return",r.block);case 34:if(!r.blockHeader){o.next=38;break}return o.abrupt("return",r.blockHeader);case 38:if(!r.latestBlock){o.next=43;break}return Vc(),o.abrupt("return",r.latestBlock);case 43:if(!r.transactionId){o.next=47;break}return o.abrupt("return",r.transactionId);case 47:if(!r.collection){o.next=49;break}return o.abrupt("return",r.collection);case 49:return o.abrupt("return",null);case 50:case"end":return o.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),Iu=function(t){return"function"==typeof t},Su=function(t){return"string"==typeof t};function Au(){return(Au=x(h.mark(function t(n){var r;return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!en(n)&&!Be(n)){e.next=11;break}if(r=mr(n,"ix.cadence"),C(Iu(r)||Su(r),"Cadence needs to be a function or a string."),!Iu(r)){e.next=7;break}return e.next=6,r({});case 6:r=e.sent;case 7:return C(Su(r),"Cadence needs to be a string at this point."),e.next=10,j().where(/^0x/).then(function(a){return Object.entries(a).reduce(function(o,u){var i=Lt(u,2),l=i[1],d=new RegExp("(\\b"+i[0]+"\\b)","g");return o.replace(d,l)},r)});case 10:n.message.cadence=e.sent;case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}},t)}))).apply(this,arguments)}var Ge=function(t){return"function"==typeof t};function ef(t){return C(null!=z(t.xform),"No type specified for argument: ".concat(t.value)),Ge(t.xform)?t.xform(t.value):Ge(t.xform.asArgument)?t.xform.asArgument(t.value):void C(!1,"Invalid Argument",t)}function Ru(t){return Me.apply(this,arguments)}function Me(){return Me=x(h.mark(function t(n){var r,a=arguments;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(C((r=a.length>1&&void 0!==a[1]?a[1]:3)>0,"Argument Resolve Recursion Limit Exceeded for Arg: ".concat(n.tempId)),!Ge(n.resolveArgument)){o.next=9;break}return o.next=5,n.resolveArgument();case 5:return o.abrupt("return",Ru(o.sent,r-1));case 9:return o.abrupt("return",n);case 10:case"end":return o.stop()}},t)})),Me.apply(this,arguments)}function ze(){return ze=x(h.mark(function t(n){var r,e,a,o,u;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!en(n)&&!Be(n)){c.next=11;break}r=0,e=Object.entries(n.arguments);case 2:if(!(re.signerIndex?1:r.signerIndexe.keyId?1:r.keyId3&&void 0!==d[3]?d[3]:3,"Account Resolve Recursion Limit Exceeded",{ix:n,accounts:r}),o=[],u=bt(r),g.prev=4,c=h.mark(function v(){var m,b,E,S;return h.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(b=(m=i.value).resolve,m.resolve=null,l=e||m,!vf(b)){N.next=8;break}return N.next=7,b(m,yf(m,n));case 7:m=N.sent;case 8:if(!Array.isArray(m)){N.next=13;break}return N.next=11,qe(n,m,l,a-1);case 11:N.next=30;break;case 13:if(m.addr&&(m.addr=Z(m.addr)),null!=m.addr&&null!=m.keyId&&(m.tempId=Vu(m)),n.accounts[m.tempId]=n.accounts[m.tempId]||m,n.accounts[m.tempId].role.proposer=n.accounts[m.tempId].role.proposer||m.role.proposer,n.accounts[m.tempId].role.payer=n.accounts[m.tempId].role.payer||m.role.payer,n.accounts[m.tempId].role.authorizer=n.accounts[m.tempId].role.authorizer||m.role.authorizer,n.accounts[m.tempId].role.proposer&&n.proposer===l.tempId&&(n.proposer=m.tempId),!n.accounts[m.tempId].role.payer){N.next=29;break}if(n.payer=Array.isArray(n.payer)?Array.from(new Set([].concat(K(n.payer),[m.tempId]).map(function(T){return T===l.tempId?m.tempId:T}))):Array.from(new Set([n.payer,m.tempId].map(function(T){return T===l.tempId?m.tempId:T}))),!(n.payer.length>1)){N.next=29;break}if(E=[],S=[],n.payer=n.payer.reduce(function(T,R){var L=n.accounts[R].addr,I=Vu(n.accounts[R]);return S.push(L),E.includes(I)?T:(E.push(I),[].concat(K(T),[R]))},[]),!(Array.from(new Set(S)).length>1)){N.next=29;break}throw new Error("Payer can not be different accounts");case 29:n.accounts[m.tempId].role.authorizer&&(e?o=Array.from(new Set([].concat(K(o),[m.tempId]))):n.authorizations=n.authorizations.map(function(T){return T===l.tempId?m.tempId:T}));case 30:l.tempId!=m.tempId&&delete n.accounts[l.tempId];case 31:case"end":return N.stop()}},v)}),u.s();case 7:if((i=u.n()).done){g.next=11;break}return g.delegateYield(c(),"t0",9);case 9:g.next=7;break;case 11:g.next=16;break;case 13:g.prev=13,g.t1=g.catch(4),u.e(g.t1);case 16:return g.prev=16,u.f(),g.finish(16);case 19:e&&(n.authorizations=n.authorizations.map(function(v){return v===e.tempId?o:v}).reduce(function(v,m){return Array.isArray(m)?[].concat(K(v),K(m)):[].concat(K(v),[m])},[]));case 20:case"end":return g.stop()}},t,null,[[4,13,16,19]])})),Ke.apply(this,arguments)}function Ju(){return(Ju=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!en(n)){r.next=13;break}return Array.isArray(n.payer)||wt.deprecate({pkg:"FCL",subject:'"ix.payer" must be an array. Support for ix.payer as a singular',message:"See changelog for more info."}),r.prev=2,r.next=5,qe(n,Object.values(n.accounts));case 5:return r.next=7,qe(n,Object.values(n.accounts));case 7:r.next=13;break;case 9:throw r.prev=9,r.t0=r.catch(2),console.error("=== SAD PANDA ===\n\n",r.t0,"\n\n=== SAD PANDA ==="),r.t0;case 13:return r.abrupt("return",n);case 14:case"end":return r.stop()}},t,null,[[2,9]])}))).apply(this,arguments)}function Xu(){return(Xu=x(h.mark(function t(n){var r,e,a,o;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!en(n)){u.next=16;break}return u.prev=1,r=Hu(n),e=Cu($u(n)),u.next=6,Promise.all(r.map(Zu(n,e)));case 6:return a=Wu(n),o=Ou(O(O({},$u(n)),{},{payloadSigs:r.map(function(i){return{address:n.accounts[i].addr,keyId:n.accounts[i].keyId,sig:n.accounts[i].signature}})})),u.next=10,Promise.all(a.map(Zu(n,o)));case 10:u.next=16;break;case 12:throw u.prev=12,u.t0=u.catch(1),console.error("Signatures",u.t0,{ix:n}),u.t0;case 16:return u.abrupt("return",n);case 17:case"end":return u.stop()}},t,null,[[1,12]])}))).apply(this,arguments)}function Zu(t,n){return r=x(h.mark(function e(a){var o;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(null==(o=t.accounts[a]).signature){c.next=3;break}return c.abrupt("return");case 3:return c.next=5,o.signingFunction(bf(o,n,t));case 5:t.accounts[a].signature=c.sent.signature;case 8:case"end":return c.stop()}},e)})),function(e){return r.apply(this,arguments)};var r}function bf(t,n,r){try{return{f_type:"Signable",f_vsn:"1.0.1",message:n,addr:Z(t.addr),keyId:t.keyId,roles:t.role,cadence:r.message.cadence,args:r.message.arguments.map(function(e){return r.arguments[e].asArgument}),data:{},interaction:r,voucher:Yn(r)}}catch(e){throw console.error("buildSignable",e),e}}function $u(t){var n=Z((Array.isArray(t.payer)?t.accounts[t.payer[0]]:t.accounts[t.payer]).addr);return{cadence:t.message.cadence,refBlock:t.message.refBlock||null,computeLimit:t.message.computeLimit,arguments:t.message.arguments.map(function(r){return t.arguments[r].asArgument}),proposalKey:{address:Z(t.accounts[t.proposer].addr),keyId:t.accounts[t.proposer].keyId,sequenceNum:t.accounts[t.proposer].sequenceNum},payer:n,authorizers:t.authorizations.map(function(r){return Z(t.accounts[r].addr)}).reduce(function(r,e){return r.find(function(a){return a===e})?r:[].concat(K(r),[e])},[])}}function Qu(){return(Qu=x(h.mark(function t(n){var r;return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=mr(n,"ix.validators",[]),e.abrupt("return",st(n,r.map(function(a){return function(o){return a(o,{Ok:ht,Bad:Ne})}})));case 2:case"end":return e.stop()}},t)}))).apply(this,arguments)}function ts(){return(ts=x(h.mark(function t(n){var r,e,a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:for(r=0,e=Object.keys(n.accounts);r1&&void 0!==arguments[1]?arguments[1]:wf;return r=x(h.mark(function e(a){var o,u;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return o=function(c){return["\nAccounts:",{proposer:c.proposer,authorizations:c.authorizations,payer:c.payer},"\n\nDetails:",c.accounts].filter(Boolean)},u=function(){for(var c,l=arguments.length,d=new Array(l),g=0;g1){var e=n[0],a=n[1];return G(function(u,i){var l=i.Bad;return e?(0,i.Ok)(u):l(u,a)})}var o=n[0];return function(u){return o(u,{Ok:ht,Bad:Ne})}}var Ot=function(){var t=x(h.mark(function n(){var r,e,a,o,u=arguments;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=u.length>0&&void 0!==u[0]?u[0]:[],e=u.length>1&&void 0!==u[1]?u[1]:{},i.next=4,j.first(["sdk.transport","sdk.send"],e.send||de);case 4:return G(a=i.sent,"Required value for sdk.transport is not defined in config. See: ".concat("https://github.com/onflow/fcl-js/blob/master/packages/sdk/CHANGELOG.md#0057-alpha1----2022-01-21")),i.next=8,j.first(["sdk.resolve"],e.resolve||He);case 8:if(o=i.sent,i.t0=e.node,i.t0){i.next=14;break}return i.next=13,j().get("accessNode.api");case 13:i.t0=i.sent;case 14:return e.node=i.t0,Array.isArray(r)&&(r=st(pr(),r)),i.t1=a,i.next=19,o(r);case 19:return i.t2=i.sent,i.t3={config:j,response:je,ix:Fe,Buffer:X.Buffer},i.t4=e,i.abrupt("return",(0,i.t1)(i.t2,i.t3,i.t4));case 23:case"end":return i.stop()}},n)}));return function(){return t.apply(this,arguments)}}();function Sn(t){return We.apply(this,arguments)}function We(){return We=x(h.mark(function t(n){var e;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,j().where(/^decoder\./);case 2:return e=Object.entries(a.sent).map(function(o){var u=Lt(o,2),i=u[0],c=u[1];return[i="/".concat(i.replace(/^decoder\./,""),"$/"),c]}),a.abrupt("return",Jt(n,Object.fromEntries(e)));case 5:case"end":return a.stop()}},t)})),We.apply(this,arguments)}var xf=function(t){zr(r,t);var n=Yr(r);function r(e){var a;Dr(this,r);var o="\n Encode Message From Signable Error: Unable to determine message encoding for signer addresss: ".concat(e,". \n Please ensure the address: ").concat(e," is intended to sign the given transaction as specified by the transaction signable.\n ").trim();return(a=n.call(this,o)).name="Unable To Determine Message Encoding For Signer Addresss",a}return Gr(r)}(ir(Error));function Ve(t){return xu("ix.validators",function(n){return Array.isArray(n)?n.push(t):[t]})}function xr(t){return st([function(n){return n.block.height=t,n},Ve(function(n){if("boolean"==typeof n.block.isSealed)throw new Error("Unable to specify both block height and isSealed.");if(n.block.id)throw new Error("Unable to specify both block height and block id.");return n})])}function Je(t){return st([function(n){return n.block.id=t,ht(n)},Ve(function(n,r){var e=r.Ok,a=r.Bad;return Le(n)?a(n,"Unable to specify a block id with a Get Account interaction."):"boolean"==typeof n.block.isSealed?a(n,"Unable to specify both block id and isSealed."):n.block.height?a(n,"Unable to specify both block id and block height."):e(n)})])}function qn(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.sealed,r=void 0!==n&&n,e=t.id,a=t.height,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C(!(r&&e||r&&a),'Method: block -- Cannot pass "sealed" with "id" or "height"'),C(!(e&&a),'Method: block -- Cannot pass "id" and "height" simultaneously'),e?Ot([Mn(),Je(e)],o).then(Jt):a?Ot([Mn(),xr(a)],o).then(Jt):Ot([Mn(r)],o).then(Jt)}function os(){return st((arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(function(n){return dr(n,{role:Te})}))}function us(t,n,r){return st([hr,function(e){return e.events.eventType=t,e.events.start=n,e.events.end=r,ht(e)}])}function ss(t){return st([lu,function(n){return n.transaction.id=t,ht(n)}])}function Xe(t){return function(n){return n.message.computeLimit=t,n}}function Ze(){return st((arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(iu))}function $e(t,n){return{value:t,xform:n}}function is(t){return Qe.apply(this,arguments)}function Qe(){return Qe=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",dr(n,{role:Qo}));case 1:case"end":return r.stop()}},t)})),Qe.apply(this,arguments)}function cs(t){return ta.apply(this,arguments)}function ta(){return ta=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",dr(n,{role:Ce}));case 1:case"end":return r.stop()}},t)})),ta.apply(this,arguments)}function fs(t){return st([function(n){return n.message.refBlock=t,ht(n)}])}function ls(){return st([cu,vr("ix.cadence",cr.apply(void 0,arguments))])}var kf=[];function ps(){return st([fu,vr("ix.cadence",cr.apply(void 0,arguments)),function(t){return t.message.refBlock=t.message.refBlock||null,t.authorizations=t.authorizations||kf,ht(t)}])}function Ef(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return C(t.account,"mockAccountResponse(ix) -- ix.account is missing",t),C(t.account.addr,"mockAccountResponse(ix) -- ix.account.addr is missing",t),{account:{addr:t.account.addr,keys:Array.from({length:n},function(e,a){return{index:a,sequenceNumber:42}})}}}var If=function(t){return t},Sf=["tempId"];function ds(t){return["SIGNATURE",t.addr,t.keyId].join(".")}function Kn(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){var r=O(O(O({},n),t),{},{signingFunction:t.signingFunction||n.signingFunction||function(e){return{addr:r.addr,keyId:r.keyId,signature:ds(r)}}});return r}}var hs,na={proposer:!1,authorizer:!1,payer:!1},Af=Object.freeze({__proto__:null,mockSend:function(){var n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:If;return n=x(h.mark(function r(e){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,e;case 2:e=a.sent,a.t0=!0,a.next=a.t0===Le(e)?6:a.t0===yu(e)?7:8;break;case 6:return a.abrupt("return",Ef(e));case 7:return a.abrupt("return",{tag:"GET_BLOCK",block:{id:"32"}});case 8:return a.abrupt("return",t(e));case 9:case"end":return a.stop()}},r)})),function(r){return n.apply(this,arguments)}},authzFn:Kn,authzResolve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){var r=t.tempId,e=Bc(t,Sf);return O(O({},n),{},{tempId:r||"WITH_RESOLVE",resolve:Kn(e)})}},authzResolveMany:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){var r=t.tempId||"AUTHZ_RESOLVE_MANY";return O(O({},n),{},{tempId:r,resolve:function(){return[t.proposer&&Kn(t.proposer)({role:O(O({},na),{},{proposer:!0})})].concat(K(t.authorizations.map(Kn).map(function(e){return e({role:O(O({},na),{},{authorizer:!0})})})),[t.payer&&Kn(t.payer)({role:O(O({},na),{},{payer:!0})})]).filter(Boolean)}})}},sig:ds,idof:function(t){return"".concat(at(t.addr),"-").concat(t.keyId)},run:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return yr([fs("123")].concat(K(t))).then(He)}}),kr=function(t){return function(n){return z(n)===t}},Xt=function(t){return null!=t},Rf=kr("object"),An=kr("string"),gs=kr("function"),_f=kr("number"),Tf="function"==typeof queueMicrotask?queueMicrotask:function(t){return(hs||(hs=Promise.resolve())).then(t).catch(function(n){return setTimeout(function(){throw n},0)})},Cf=function(){var t,n=[];return{deliver:function(r){return x(h.mark(function e(){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:n.push(r),t&&(t(n.shift()),t=void 0);case 2:case"end":return a.stop()}},e)}))()},receive:function(){return new Promise(function(r){var e=n.shift();if(e)return r(e);t=r})}}},ms="SUBSCRIBE",ra="UNSUBSCRIBE",Of="UPDATED",Q="object"===(typeof self>"u"?"undefined":z(self))&&self.self===self&&self||"object"===(typeof global>"u"?"undefined":z(global))&&global.global===global&&global||"object"===(typeof window>"u"?"undefined":z(window))&&window.window===window&&window;Q.FCL_REGISTRY=Q.FCL_REGISTRY??{};var Ht,Nf=0,Pt=function(t,n,r){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise(function(a,o){var u=e.expectReply||!1,i=null!=e.timeout?e.timeout:5e3;u&&i&&setTimeout(function(){return o(new Error("Timeout: ".concat(i,"ms passed without a response.")))},i);var c={to:t,from:e.from,tag:n,data:r,timeout:i,reply:a,reject:o};try{Q.FCL_REGISTRY[t]&&Q.FCL_REGISTRY[t].mailbox.deliver(c),u||a(!0)}catch(l){console.error("FCL.Actor -- Could Not Deliver Message",c,Q.FCL_REGISTRY[t],l)}})},Bf=function(t){delete Q.FCL_REGISTRY[t]},Lf=function(){var n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n=x(h.mark(function r(e){var a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if("function"!=typeof t.INIT){o.next=3;break}return o.next=3,t.INIT(e);case 3:return o.next=6,e.receive();case 6:if(a=o.sent,o.prev=7,"EXIT"!==a.tag){o.next=13;break}if("function"!=typeof t.TERMINATE){o.next=12;break}return o.next=12,t.TERMINATE(e,a,a.data||{});case 12:return o.abrupt("break",25);case 13:return o.next=15,t[a.tag](e,a,a.data||{});case 15:o.next=20;break;case 17:o.prev=17,o.t0=o.catch(7),console.error("".concat(e.self()," Error"),a,o.t0);case 20:return o.prev=20,o.abrupt("continue",3);case 23:o.next=3;break;case 25:case"end":return o.stop()}},r,null,[[7,17,20,23]])})),function(r){return n.apply(this,arguments)}},ea=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null==n&&(n=++Nf),null!=Q.FCL_REGISTRY[n])return n;Q.FCL_REGISTRY[n]={addr:n,mailbox:Cf(),subs:new Set,kvs:{},error:null};var r={self:function(){return n},receive:function(){return Q.FCL_REGISTRY[n].mailbox.receive()},send:function(e,a,o){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return u.from=n,Pt(e,a,o,u)},sendSelf:function(e,a,o){Q.FCL_REGISTRY[n]&&Pt(n,e,a,o)},broadcast:function(e,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o.from=n;var u,i=bt(Q.FCL_REGISTRY[n].subs);try{for(i.s();!(u=i.n()).done;)Pt(u.value,e,a,o)}catch(l){i.e(l)}finally{i.f()}},subscribe:function(e){return null!=e&&Q.FCL_REGISTRY[n].subs.add(e)},unsubscribe:function(e){return null!=e&&Q.FCL_REGISTRY[n].subs.delete(e)},subscriberCount:function(){return Q.FCL_REGISTRY[n].subs.size},hasSubs:function(){return!!Q.FCL_REGISTRY[n].subs.size},put:function(e,a){null!=e&&(Q.FCL_REGISTRY[n].kvs[e]=a)},get:function(e,a){return Q.FCL_REGISTRY[n].kvs[e]??a},delete:function(e){delete Q.FCL_REGISTRY[n].kvs[e]},update:function(e,a){null!=e&&(Q.FCL_REGISTRY[n].kvs[e]=a(Q.FCL_REGISTRY[n].kvs[e]))},keys:function(){return Object.keys(Q.FCL_REGISTRY[n].kvs)},all:function(){return Q.FCL_REGISTRY[n].kvs},where:function(e){return Object.keys(Q.FCL_REGISTRY[n].kvs).reduce(function(a,o){return e.test(o)?O(O({},a),{},q({},o,Q.FCL_REGISTRY[n].kvs[o])):a},{})},merge:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(e).forEach(function(a){return Q.FCL_REGISTRY[n].kvs[a]=e[a]})},fatalError:function(e){Q.FCL_REGISTRY[n].error=e;var a,o=bt(Q.FCL_REGISTRY[n].subs);try{for(o.s();!(a=o.n()).done;)Pt(a.value,Of)}catch(i){o.e(i)}finally{o.f()}}};return"object"===z(t)&&(t=Lf(t)),Tf(x(h.mark(function e(){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t(r);case 2:Bf(n);case 3:case"end":return a.stop()}},e)}))),n},Wt="config",vs="PUT_CONFIG",ys="GET_CONFIG",bs="GET_ALL_CONFIG",ws="UPDATE_CONFIG",xs="DELETE_CONFIG",ks="CLEAR_CONFIG",Es="WHERE_CONFIG",Hn="CONFIG/UPDATED",Is=function(t){return t},Ss=(q(Ht={},vs,function(t,n,r){var e=r.key,a=r.value;if(null==e)throw new Error("Missing 'key' for config/put.");t.put(e,a),t.broadcast(Hn,O({},t.all()))}),q(Ht,ys,function(t,n,r){var e=r.key,a=r.fallback;if(null==e)throw new Error("Missing 'key' for config/get");n.reply(t.get(e,a))}),q(Ht,bs,function(t,n){n.reply(O({},t.all()))}),q(Ht,ws,function(t,n,r){var e=r.key,a=r.fn;if(null==e)throw new Error("Missing 'key' for config/update");t.update(e,a||Is),t.broadcast(Hn,O({},t.all()))}),q(Ht,xs,function(t,n,r){var e=r.key;if(null==e)throw new Error("Missing 'key' for config/delete");t.delete(e),t.broadcast(Hn,O({},t.all()))}),q(Ht,ks,function(t,n){for(var r=0,e=Object.keys(t.all());r1?i[1]:void 0,(n=i.length>0&&void 0!==i[0]?i[0]:[]).length){c.next=4;break}return c.abrupt("return",r);case 4:return e=Fn(n),a=e[0],o=e.slice(1),c.next=7,oa(a);case 7:if(null!=(u=c.sent)){c.next=10;break}return c.abrupt("return",ua(o,r));case 10:return c.abrupt("return",u);case 11:case"end":return c.stop()}},t)})),sa.apply(this,arguments)}function Er(){return Pt(Wt,bs,null,{expectReply:!0,timeout:10})}function As(t){return Pt(Wt,ws,{key:t,fn:arguments.length>1&&void 0!==arguments[1]?arguments[1]:Is}),Et()}function Rs(t){return Pt(Wt,xs,{key:t}),Et()}function _s(t){return Pt(Wt,Es,{pattern:t},{expectReply:!0,timeout:10})}function Ts(t){return function(n,r,e){ea(Ss,Wt);var u,a="@EXIT",o=ea((u=x(h.mark(function i(c){var l,d;return h.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:c.send(n,ms);case 1:return g.next=4,c.receive();case 4:if(d=Q.FCL_REGISTRY[n].error,(l=g.sent).tag!==a){g.next=9;break}return c.send(n,ra),g.abrupt("return");case 9:if(!d){g.next=13;break}return e(null,d),c.send(n,ra),g.abrupt("return");case 13:e(l.data,null),g.next=1;break;case 16:case"end":return g.stop()}},i)})),function(i){return u.apply(this,arguments)}));return function(){return Pt(o,a)}}(Wt,0,t)}function Cs(t){return Pt(Wt,ks).then(Et(t))}function Et(t){return null!=t&&"object"===z(t)&&Object.keys(t).map(function(n){return aa(n,t[n])}),{put:aa,get:oa,all:Er,first:ua,update:As,delete:Rs,where:_s,subscribe:Ts,overload:Os}}ea(Ss,Wt),Et.put=aa,Et.get=oa,Et.all=Er,Et.first=ua,Et.update=As,Et.delete=Rs,Et.where=_s,Et.subscribe=Ts,Et.overload=Os;var Uf=function(t){return t};function Os(){var r,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uf;return new Promise((r=x(h.mark(function e(a,o){var u,i;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,Er();case 2:return u=c.sent,c.prev=3,Et(t),c.t0=n,c.next=8,Er();case 8:return c.t1=c.sent,c.next=11,(0,c.t0)(c.t1);case 11:return i=c.sent,c.next=14,Cs(u);case 14:a(i),c.next=22;break;case 17:return c.prev=17,c.t2=c.catch(3),c.next=21,Cs(u);case 21:o(c.t2);case 22:case"end":return c.stop()}},e,null,[[3,17]])})),function(e,a){return r.apply(this,arguments)}))}var Rn=Object.freeze({debug:5,info:4,log:3,warn:2,error:1}),Ff=function(t){var r=t.message;return["\n %c".concat(t.title,"\n ============================\n\n ").concat(r,"\n\n ============================\n ").replace(/\n[^\S\r\n]+/g,"\n").trim(),,"font-weight:bold;font-family:monospace;"]},Ir=function(){var t=x(h.mark(function n(r){var e,a,o,u,i,c,l,d,g,v,m,b;return h.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return c=r.title,l=r.message,d=r.level,v=void 0!==(g=r.always)&&g,E.next=3,Et.get("logger.level",Rn.warn);case 3:if(m=E.sent,v||!(m8)&&H("Expected at least one digit, and at most 8 digits following the decimal of the [U]Fix64 value but found ".concat(n[1].length," digits. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers")),n[1]=n[1].padEnd(8,"0"),{type:"UFix64",value:t=n.join(".")}}if(ct(t))return Ns(),{type:"UFix64",value:t.toString()};H("Expected String for UFix64")},function(t){return t}),al=V("Fix64",function(t){if(et(t)){var n=t.split(".");return 2!==n.length&&H("Expected one decimal but found ".concat(n.length," in the [U]Fix64 value. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers")),(0==n[1].length||n[1].length>8)&&H("Expected at least one digit, and at most 8 digits following the decimal of the [U]Fix64 value but found ".concat(n[1].length," digits. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers")),n[1]=n[1].padEnd(8,"0"),{type:"Fix64",value:t=n.join(".")}}if(ct(t))return Ns(),{type:"Fix64",value:t.toString()};H("Expected String for Fix64")},function(t){return t}),ol=V("String",function(t){if(et(t))return{type:"String",value:t};H("Expected String for type String")},function(t){return t}),ul=V("Character",function(t){if(et(t))return{type:"Character",value:t};H("Expected Character for type Character")},function(t){return t}),sl=V("Bool",function(t){if("boolean"==typeof t)return{type:"Bool",value:t};H("Expected Boolean for type Bool")},function(t){return t}),Bs=V("Address",function(t){if(et(t))return{type:"Address",value:t};H("Expected Address for type Address")},function(t){return t}),il=V("Void",function(t){if(!t||Ps(t))return{type:"Void"};H("Expected Void for type Void")},function(t){return t}),cl=V("Reference",function(t){if(pn(t))return{type:"Reference",value:t};H("Expected Object for type Reference")},function(t){return t}),Ls=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return V("Array",function(n){return{type:"Array",value:ln(t)?t.map(function(r,e){return r.asArgument(n[e])}):n.map(function(r){return t.asArgument(r)})}},function(n){return n})},fl=V("Path",function(t){if(pn(t))return et(t.domain)||H("Expected a string for the Path domain but found ".concat(t.domain,". Find out more about the Path type here: https://docs.onflow.org/cadence/json-cadence-spec/#path")),"storage"!==t.domain&&"private"!==t.domain&&"public"!==t.domain&&H('Expected either "storage", "private" or "public" as the Path domain but found '.concat(t.domain,". Find out more about the Path type here: https://docs.onflow.org/cadence/json-cadence-spec/#path")),et(t.identifier)||H("Expected a string for the Path identifier but found ".concat(t.identifier,". Find out more about the Path type here: https://docs.onflow.org/cadence/json-cadence-spec/#path")),{type:"Path",value:{domain:t.domain,identifier:t.identifier}};H("Expected Object for type Path")},function(t){return t}),Us=Object.freeze({__proto__:null,Address:Bs,Array:Ls,Bool:sl,Character:ul,Dictionary:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return V("Dictionary",function(n){if(pn(n))return{type:"Dictionary",value:ln(t)?t.map(function(r,e){return{key:r.key.asArgument(n[e].key),value:r.value.asArgument(n[e].value)}}):ln(n)?n.map(function(r){return{key:t.key.asArgument(r.key),value:t.value.asArgument(r.value)}}):[{key:t.key.asArgument(n.key),value:t.value.asArgument(n.value)}]};H("Expected Object for type Dictionary")},function(n){return n})},Enum:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return V("Enum",function(r){if(pn(r))return{type:"Enum",value:{id:t,fields:ln(n)?n.map(function(e,a){return{name:r.fields[a].name,value:e.value.asArgument(r.fields[a].value)}}):r.fields.map(function(e){return{name:e.name,value:n.value.asArgument(e.value)}})}};H("Expected Object for type Enum")},function(r){return r})},Event:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return V("Event",function(r){if(pn(r))return{type:"Event",value:{id:t,fields:ln(n)?n.map(function(e,a){return{name:r.fields[a].name,value:e.value.asArgument(r.fields[a].value)}}):r.fields.map(function(e){return{name:e.name,value:n.value.asArgument(e.value)}})}};H("Expected Object for type Event")},function(r){return r})},Fix64:al,Identity:jf,Int:Gf,Int128:Xf,Int16:qf,Int256:$f,Int32:Hf,Int64:Vf,Int8:zf,Optional:function(t){return V("Optional",function(n){return{type:"Optional",value:Ps(n)?null:t.asArgument(n)}},function(n){return n})},Path:fl,Reference:cl,Resource:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return V("Resource",function(r){if(pn(r))return{type:"Resource",value:{id:t,fields:ln(n)?n.map(function(e,a){return{name:r.fields[a].name,value:e.value.asArgument(r.fields[a].value)}}):r.fields.map(function(e){return{name:e.name,value:n.value.asArgument(e.value)}})}};H("Expected Object for type Resource")},function(r){return r})},String:ol,Struct:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return V("Struct",function(r){if(pn(r))return{type:"Struct",value:{id:t,fields:ln(n)?n.map(function(e,a){return{name:r.fields[a].name,value:e.value.asArgument(r.fields[a].value)}}):r.fields.map(function(e){return{name:e.name,value:n.value.asArgument(e.value)}})}};H("Expected Object for type Struct")},function(r){return r})},UFix64:el,UInt:Df,UInt128:Jf,UInt16:Yf,UInt256:Zf,UInt32:Kf,UInt64:Wf,UInt8:Mf,Void:il,Word16:tl,Word32:nl,Word64:rl,Word8:Qf,_Array:Ls});function Fs(t){return gs(t)?t($e,Us):[]}function js(t){return Ds.apply(this,arguments)}function Ds(){return(Ds=x(h.mark(function t(n){var r,e;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return C(void 0!==(r=n.url),"retrieve({ url }) -- url must be defined"),o.prev=2,o.next=5,_o(r);case 5:e=o.sent,o.next=11;break;case 8:throw o.prev=8,o.t0=o.catch(2),new Error("httpDocumentResolver Error: Failed to retrieve document.");case 11:if(!e.ok){o.next=17;break}return o.next=14,e.json();case 14:o.t1=o.sent,o.next=18;break;case 17:o.t1=null;case 18:return o.abrupt("return",o.t1);case 20:case"end":return o.stop()}},t,null,[[2,8]])}))).apply(this,arguments)}var Gs=new Map([["http",js],["https",js]]);function ll(t){return Ms.apply(this,arguments)}function Ms(){return(Ms=x(h.mark(function t(n){var r,e,a,o,u;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return C(void 0!==(r=n.url),"retrieve({ url }) -- url must be defined"),C("string"==typeof r,"retrieve({ url }) -- url must be a string"),c.next=5,j().where(/^document\.resolver\./);case 5:return e=c.sent,Object.keys(e).map(function(l){var d=e[l],g=l.replace(/^document\.resolver\./,"");Gs.set(g,d)}),C(a=/^(.*):\/\/([A-Za-z0-9\-\.]+)(:[0-9]+)?(.*)$/.exec(r),"Failed to parse URL"),o=a[1],C(a,"Failed to parse URL protocol"),C(u=Gs.get(o),"No resolver found for protcol=".concat(o)),c.next=15,u({url:r});case 15:return c.abrupt("return",c.sent);case 17:case"end":return c.stop()}},t)}))).apply(this,arguments)}function Wn(t){if(null==t)return null;if("1.0.0"===t.f_version)return t;throw new Error("normalizeInteractionTemplate Error: Invalid InteractionTemplate")}function zs(t){var n,r,e=t.network,a=t.template;if(G(null!=e,"deriveCadenceByNetwork({ network }) -- network must be defined"),G("string"==typeof e,"deriveCadenceByNetwork({ network }) -- network must be a string"),G(null!=a,"generateDependencyPin({ template }) -- template must be defined"),G("object"===z(a),"generateDependencyPin({ template }) -- template must be an object"),G("InteractionTemplate"===a.f_type,"generateDependencyPin({ template }) -- template must be an InteractionTemplate"),"1.0.0"===(a=Wn(a)).f_version)return Object.keys(null===(n=a)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.dependencies).map(function(o){var u,i,c,l=Object.values(null===(u=a)||void 0===u||null===(i=u.data)||void 0===i||null===(c=i.dependencies)||void 0===c?void 0:c[o]);G(l,"deriveCadenceByNetwork -- Could not find contracts for dependency placeholder: ".concat(o)),G(0===l.length,"deriveCadenceByNetwork -- Could not find contracts for dependency placeholder: ".concat(o));var d=l[0],g=null==d?void 0:d[e];return G(g,"deriveCadenceByNetwork -- Could not find ".concat(e," network information for dependency: ").concat(o)),[o,g.address]}).reduce(function(o,u){var i=Lt(u,2),l=i[1],d=new RegExp("(\\b"+i[0]+"\\b)","g");return o.replace(d,l)},a.data.cadence);throw new Error("deriveCadenceByNetwork Error: Unsupported template version")}function pl(t){return ia.apply(this,arguments)}function ia(){return ia=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,d,g,v,b;return h.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return e=n.template,E.next=3,j.get("flow.network");case 3:C(a=E.sent,"FCL configureDependencies Error: Missing configuration value for 'flow.network'"),o={},E.t0=e.f_version,E.next="1.0.0"===E.t0?9:12;break;case 9:for(u=Object.keys(null==e||null===(r=e.data)||void 0===r?void 0:r.dependencies),i=0,c=u;i0,"FCL configureDependencies Error: No contracts found in template for placeholder=".concat(d)),C(b=g[v[0]][a],"FCL configureDependencies Error: No dependency information for placeholder=".concat(d," contract=").concat(v[0]," network=").concat(a)),C(null==b?void 0:b.address,"FCL configureDependencies Error: No address information for placeholder=".concat(d," contract=").concat(v[0]," network=").concat(a)),o[d]=at(null==b?void 0:b.address);return E.abrupt("return",o);case 12:throw new Error("FCL configureDependencies Error: Unsupported template version");case 13:case"end":return E.stop()}},t)})),ia.apply(this,arguments)}function Ys(t){return qs.apply(this,arguments)}function qs(){return(qs=x(h.mark(function t(n){var r;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!An(null==n?void 0:n.template)){a.next=4;break}return a.next=3,ll({url:null==n?void 0:n.template});case 3:n.template=a.sent;case 4:if(r={},null==n||!n.template){a.next=10;break}return n.template=Wn(null==n?void 0:n.template),a.next=9,pl({template:n.template});case 9:r=a.sent;case 10:if(a.t0=n.cadence,a.t0){a.next=19;break}return a.t1=zs,a.t2=n.template,a.next=16,j().get("flow.network");case 16:a.t3=a.sent,a.t4={template:a.t2,network:a.t3},a.t0=(0,a.t1)(a.t4);case 19:return n.cadence=a.t0,n.dependencies=r,a.abrupt("return",n);case 23:case"end":return a.stop()}},t)}))).apply(this,arguments)}function Ks(t,n){return ca.apply(this,arguments)}function ca(){return ca=x(h.mark(function t(n,r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(C(Xt(r),"".concat(n,"(opts) -- opts is required")),C(Rf(r),"".concat(n,"(opts) -- opts must be an object")),C(!(r.cadence&&r.template),"".concat(n,"({ template, cadence }) -- cannot pass both cadence and template")),C(Xt(r.cadence||(null==r?void 0:r.template)),"".concat(n,"({ cadence }) -- cadence is required")),C(An(r.cadence)||(null==r?void 0:r.template),"".concat(n,"({ cadence }) -- cadence must be a string")),e.t0=C,e.t1=r.cadence,e.t1){e.next=11;break}return e.next=10,j().get("flow.network");case 10:e.t1=e.sent;case 11:return e.t2=e.t1,e.t3="".concat(n,'(opts) -- Required value for "flow.network" not defined in config. See: ',"https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/exec/query.md#configuration"),(0,e.t0)(e.t2,e.t3),e.t4=C,e.next=17,j().get("accessNode.api");case 17:e.t5=e.sent,e.t6="".concat(n,'(opts) -- Required value for "accessNode.api" not defined in config. See: ',"https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/exec/query.md#configuration"),(0,e.t4)(e.t5,e.t6);case 20:case"end":return e.stop()}},t)})),ca.apply(this,arguments)}function dl(t){return Hs.apply(this,arguments)}function Hs(){return(Hs=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Ks("mutate",n));case 1:case"end":return r.stop()}},t)}))).apply(this,arguments)}function hl(t){return Ws.apply(this,arguments)}function Ws(){return(Ws=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Ks("query",n));case 1:case"end":return r.stop()}},t)}))).apply(this,arguments)}function Sr(){return fa.apply(this,arguments)}function fa(){return fa=x(h.mark(function t(){var n,r=arguments;return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>0&&void 0!==r[0]?r[0]:{},e.next=3,hl(n);case 3:return e.next=5,Ys(n);case 5:return n=e.sent,e.abrupt("return",j().overload(n.dependencies||{},x(h.mark(function a(){return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Ot([ls(n.cadence),Ze(Fs(n.args||[])),n.limit&&"number"==typeof n.limit&&Xe(n.limit)]).then(Sn));case 1:case"end":return o.stop()}},a)}))));case 7:case"end":return e.stop()}},t)})),fa.apply(this,arguments)}function gl(t,n){return la.apply(this,arguments)}function la(){return la=x(h.mark(function t(n,r){var e,a,o,u,i;return h.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(null!=n&&null!=r){l.next=2;break}return l.abrupt("return",[]);case 2:return(e=new URL(n)).searchParams.append("code",r),l.next=6,fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}}).then(function(d){return d.json()});case 6:if(a=l.sent,!Array.isArray(a)){l.next=9;break}return l.abrupt("return",a);case 9:if(o=[],Array.isArray(a.authorizations)){u=bt(a.authorizations);try{for(u.s();!(i=u.n()).done;)o.push(O({type:"authz",keyId:a.keyId},i.value))}catch(d){u.e(d)}finally{u.f()}}return null!=a.provider&&o.push(O({type:"authn",id:"wallet-provider#authn"},a.provider)),l.abrupt("return",o);case 13:case"end":return l.stop()}},t)})),la.apply(this,arguments)}function ml(){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return[].concat(K(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),K(n))}var _n={f_type:"Service",f_vsn:"1.0.0"},Vs={f_type:"Identity",f_vsn:"1.0.0"},vl={f_type:"USER",f_vsn:"1.0.0"},yl={f_type:"PollingResponse",f_vsn:"1.0.0"},pa={f_type:"CompositeSignature",f_vsn:"1.0.0"};function Js(t){return null==t?null:"1.0.0"===t.f_vsn?t:O(O({old:t},_n),{},{type:"frame",endpoint:t.endpoint,params:t.params||{},data:t.data||{}})}function Xs(t){return null==t?null:"1.0.0"===t.f_vsn?t:O(O({},_n),{},{type:"back-channel-rpc",endpoint:t.endpoint,method:t.method,params:t.params||{},data:t.data||{}})}function Zs(t){return null==t?null:(null==t.method&&(t=O(O({},t),{},{type:"local-view",method:"VIEW/IFRAME"})),"1.0.0"===t.f_vsn?t:O(O({},_n),{},{type:t.type||"local-view",method:t.method,endpoint:t.endpoint,data:t.data||{},params:t.params||{}}))}var bl={"back-channel-rpc":Xs,"pre-authz":function(t){return null==t?null:"1.0.0"===t.f_vsn?t:O(O({},_n),{},{type:t.type,uid:t.id,endpoint:t.endpoint,method:t.method,identity:O(O({},Vs),{},{address:at(t.addr),keyId:t.keyId}),params:t.params,data:t.data})},authz:function(t){return null==t?null:"1.0.0"===t.f_vsn?t:O(O({},_n),{},{type:t.type,uid:t.id,endpoint:t.endpoint,method:t.method,identity:O(O({},Vs),{},{address:at(t.addr),keyId:t.keyId}),params:t.params,data:t.data})},authn:function(t){return null==t?null:"1.0.0"===t.f_vsn?t:O(O({},_n),{},{type:t.type,uid:t.id,endpoint:t.authn,id:t.pid,provider:{address:at(t.addr),name:t.name,icon:t.icon}})},frame:Js,"open-id":function(t){return null==t?null:"1.0.0"===t.f_vsn?t:null},"user-signature":function(t){if(null==t)return null;if("1.0.0"===t.f_vsn)return t;throw new Error("Invalid user-signature service")},"local-view":Zs,"account-proof":function(t){if(null==t)return null;if("1.0.0"===t.f_vsn)return t;throw new Error("FCL Normalizer Error: Invalid account-proof service")},"authn-refresh":function(t){if(null==t)return null;if("1.0.0"===t.f_vsn)return t;throw new Error("Invalid authn-refresh service")}};function wl(t,n){try{return bl[t.type](t,n)}catch(r){return console.error("Unrecognized FCL Service Type [".concat(t.type,"]"),t,r),t}}function xl(t){return fn([t.provider.address||t.provider.name||"UNSPECIFIED",t.id]).toString("hex")}function kl(t){return t.addr=t.addr?at(t.addr):null,t.paddr=t.paddr?at(t.paddr):null,t}function El(t,n){return n.find(function(r){return r.type===t})}function $s(t){return da.apply(this,arguments)}function da(){return da=x(h.mark(function t(n){var r,e;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return n=kl(n),a.t0=ml,a.t1=n.services||[],a.next=5,gl(n.hks,n.code);case 5:return a.t2=a.sent,r=(0,a.t0)(a.t1,a.t2).map(function(o){return wl(o,n)}),e=El("authn",r),a.abrupt("return",O(O({},vl),{},{addr:at(n.addr),cid:xl(e),loggedIn:!0,services:r,expiresAt:n.expires}));case 9:case"end":return a.stop()}},t)})),da.apply(this,arguments)}function Ar(){var n=arguments.length>1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).find(function(r){return r.type===n})}function Vn(t){var n=new URL(t.endpoint);if(n.searchParams.append("l6n",window.location.origin),null!=t.params)for(var r=0,e=Object.entries(t.params||{});r1&&void 0!==arguments[1]?arguments[1]:{},r=n.method||"POST",e="GET"===r?void 0:JSON.stringify(n.data||t.data||{});return fetch(Vn(t),{method:r,headers:O(O(O({},t.headers||{}),n.headers||{}),{},{"Content-Type":"application/json"}),body:e}).then(function(a){return a.json()})}function Zt(t){var n,r;return null==t?null:"1.0.0"===t.f_vsn?t:O(O({},yl),{},{status:null!==(n=t.status)&&void 0!==n?n:"APPROVED",reason:null!==(r=t.reason)&&void 0!==r?r:null,data:t.compositeSignature||t.data||O({},t)||{},updates:Xs(t.authorizationUpdates),local:Js((t.local||[])[0])})}var ti={"HTTP/GET":"GET","HTTP/POST":"POST"},Il=function(t){return C(ti[t.method],"Invalid Service Method for type back-channel-rpc",{service:t}),ti[t.method]};function ni(t){return ha.apply(this,arguments)}function ha(){return ha=x(h.mark(function t(n){var r,e,a=arguments;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r=a.length>1&&void 0!==a[1]?a[1]:function(){return!0},C(n,"Missing Polling Service",{service:n}),r()){o.next=4;break}throw new Error("Externally Halted");case 4:return o.next=6,Qs(n,{method:Il(n)}).then(Zt);case 6:o.t0=(e=o.sent).status,o.next="APPROVED"===o.t0?10:"DECLINED"===o.t0?11:12;break;case 10:return o.abrupt("return",e.data);case 11:throw new Error("Declined: ".concat(e.reason||"No reason supplied."));case 12:return o.next=14,new Promise(function(u){return setTimeout(u,500)});case 14:return o.abrupt("return",ni(e.updates,r));case 15:case"end":return o.stop()}},t)})),ha.apply(this,arguments)}var Rr="FCL_IFRAME";function ri(t){C(!document.getElementById(Rr),"Attempt at triggering multiple Frames",{src:t});var n=document.createElement("iframe");return n.src=t,n.id=Rr,n.allow="usb *; hid *",n.frameBorder="0",n.style.cssText="\n position:fixed;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n height: 100%;\n width: 100vw;\n display:block;\n background:rgba(0,0,0,0.25);\n z-index: 2147483647;\n box-sizing: border-box;\n color-scheme: light;\n",document.body.append(n),[n.contentWindow,function(){document.getElementById(Rr)&&document.getElementById(Rr).remove()}]}var Dt=null,ei=null;function ai(t){var n;return null==Dt||null!==(n=Dt)&&void 0!==n&&n.closed?Dt=function(r,e,a,o,u){var i=a.top.outerHeight/2+a.top.screenY-385,c=a.top.outerWidth/2+a.top.screenX-320,l=a.open(r,"FCL_POP","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=".concat(640,", height=").concat(770,", top=").concat(i,", left=").concat(c));if(!l)throw new Error("Popup failed to open (was it blocked by a popup blocker?)");return l}(t,0,window):(ei!==t&&Dt.location.replace(t),Dt.focus()),ei=t,[Dt,function(){Dt&&!Dt.closed&&Dt.close(),Dt=null}]}var Gt=null,oi=null;function ui(t){var n;if(null==Gt||null!==(n=Gt)&&void 0!==n&&n.closed){if(!(Gt=window.open(t,"_blank")))throw new Error("Tab failed to open (was it blocked by the browser?)")}else oi!==t&&Gt.location.replace(t),Gt.focus();return oi=t,[Gt,function(){Gt&&!Gt.closed&&Gt.close(),Gt=null}]}var Sl={"VIEW/IFRAME":ri,"VIEW/POP":ai,"VIEW/TAB":ui};function Al(t){return ga.apply(this,arguments)}function ga(){return ga=x(h.mark(function t(n){var r,e=arguments;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r=e.length>1&&void 0!==e[1]?e[1]:{},a.prev=1,a.abrupt("return",Sl[n.method](Vn(n),r));case 5:throw a.prev=5,a.t0=a.catch(1),console.error("execLocal({service, opts = {}})",a.t0,{service:n,opts:r}),a.t0;case 9:case"end":return a.stop()}},t,null,[[1,5]])})),ga.apply(this,arguments)}function si(t){return ma.apply(this,arguments)}function ma(){return ma=x(h.mark(function t(n){var r,e,a,o,u,c,l,d;return h.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return r=n.service,e=n.body,a=n.config,g.next=3,Qs(r,{data:O({fclVersion:Ut,service:{params:r.params,data:r.data,type:r.type},config:a},e)}).then(Zt);case 3:if("APPROVED"!==(o=g.sent).status){g.next=8;break}return g.abrupt("return",o.data);case 8:if("DECLINED"!==o.status){g.next=12;break}throw new Error("Declined: ".concat(o.reason||"No reason supplied."));case 12:if("REDIRECT"!==o.status){g.next=16;break}return g.abrupt("return",o);case 16:if("PENDING"!==o.status){g.next=28;break}return u=!0,g.next=20,Al(Zs(o.local));case 20:return c=Lt(g.sent,2),l=c[1],d=function(){try{l(),u=!1}catch(v){console.error("Frame Close Error",v)}},g.abrupt("return",ni(o.updates,function(){return u}).then(function(v){return d(),v}).catch(function(v){throw console.error(v),d(),v}));case 28:throw console.error("Auto Decline: Invalid Response",{service:r,resp:o}),new Error("Auto Decline: Invalid Response");case 30:case"end":return g.stop()}},t)})),ma.apply(this,arguments)}var ii="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",Rl=ii.length;function va(){for(var t="",n=32;n--;)t+=ii[Math.random()*Rl|0];return t}var wa,Jn,ci,xa,_r="FCL:VIEW:CLOSE",ya="FCL:VIEW:READY",ba="FCL:VIEW:RESPONSE",ft=function(t){return"string"==typeof t&&t.toLowerCase()},_l=new Set(["monetizationstart","monetizationpending","monetizationprogress","monetizationstop"]),dn=function(t,n){return console.warn("DEPRECATION NOTICE","Received ".concat(t,", please use ").concat(n," for this and future versions of FCL"))},Tr=function(t){var n=t.close,r=t.send,e=t.onReady,a=t.onResponse,o=t.onMessage;return function(u){try{if("object"!==z(u.data)||_l.has(u.data.type))return;ft(u.data.type)===ft(_r)&&n(),ft(u.data.type)===ft(ya)&&e(u,{send:r,close:n}),ft(u.data.type)===ft(ba)&&a(u,{send:r,close:n}),o(u,{send:r,close:n}),ft(u.data.type)===ft("FCL:FRAME:READY")&&(dn(u.data.type,ya),e(u,{send:r,close:n})),ft(u.data.type)===ft("FCL:FRAME:RESPONSE")&&(dn(u.data.type,ba),a(u,{send:r,close:n})),ft(u.data.type)===ft("FCL:FRAME:CLOSE")&&(dn(u.data.type,_r),n()),ft(u.data.type)===ft("FCL::CHALLENGE::RESPONSE")&&(dn(u.data.type,ba),a(u,{send:r,close:n})),ft(u.data.type)===ft("FCL::AUTHZ_READY")&&(dn(u.data.type,ya),e(u,{send:r,close:n})),ft(u.data.type)===ft("FCL::CHALLENGE::CANCEL")&&(dn(u.data.type,_r),n()),ft(u.data.type)===ft("FCL::CANCEL")&&(dn(u.data.type,_r),n())}catch(i){console.error("Frame Callback Error",i),n()}}},Tn=function(){},Cn=function(){},On=function(){},Pn=function(){},fi={"HTTP/RPC":si,"HTTP/POST":si,"IFRAME/RPC":function(t){var n=t.service,r=t.body,e=t.config,a=t.opts;return new Promise(function(o,u){var i=va(),c=a.includeOlderJsonRpcCall;!function(l){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==l)return{send:Tn,close:Tn};var g=d.onClose||Tn,E=Tr({close:R,send:L,onReady:d.onReady||Tn,onResponse:d.onResponse||Tn,onMessage:d.onMessage||Tn});window.addEventListener("message",E);var S=Lt(ri(Vn(l)),2),N=S[0],T=S[1];return{send:L,close:R};function R(){try{window.removeEventListener("message",E),T(),g()}catch(I){console.error("Frame Close Error",I)}}function L(I){try{N.postMessage(JSON.parse(JSON.stringify(I||{})),"*")}catch(W){console.error("Frame Send Error",I,W)}}}(n,{onReady:function(l,d){return x(h.mark(function g(){var v;return h.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:v=d.send,m.prev=1,v({type:"FCL:VIEW:READY:RESPONSE",fclVersion:Ut,body:r,service:{params:n.params,data:n.data,type:n.type},config:e}),v({fclVersion:Ut,type:"FCL:FRAME:READY:RESPONSE",body:r,service:{params:n.params,data:n.data,type:n.type},config:e,deprecated:{message:"FCL:FRAME:READY:RESPONSE is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),c&&v({jsonrpc:"2.0",id:i,method:"fcl:sign",params:[r,n.params],deprecated:{message:"jsonrpc is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),m.next=10;break;case 7:throw m.prev=7,m.t0=m.catch(1),m.t0;case 10:case"end":return m.stop()}},g,null,[[1,7]])}))()},onResponse:function(l,d){var g=d.close;try{if("object"!==z(l.data))return;var v=Zt(l.data);switch(v.status){case"APPROVED":o(v.data),g();break;case"DECLINED":u("Declined: ".concat(v.reason||"No reason supplied")),g();break;case"REDIRECT":o(v),g();break;default:u("Declined: No reason supplied"),g()}}catch(m){throw console.error("execIframeRPC onResponse error",m),m}},onMessage:function(l,d){var g=d.close;try{if("object"!==z(l.data)||"2.0"!==l.data.jsonrpc||l.data.id!==i)return;var v=Zt(l.data.result);switch(v.status){case"APPROVED":o(v.data),g();break;case"DECLINED":u("Declined: ".concat(v.reason||"No reason supplied")),g();break;case"REDIRECT":o(v),g();break;default:u("Declined: No reason supplied"),g()}}catch(m){throw console.error("execIframeRPC onMessage error",m),m}},onClose:function(){u("Declined: Externally Halted")}})})},"POP/RPC":function(t){var n=t.service,r=t.body,e=t.config,a=t.opts;return new Promise(function(o,u){var i=va(),c=a.redir,l=a.includeOlderJsonRpcCall;!function(d){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==d)return{send:Cn,close:Cn};var v=g.onClose||Cn,S=Tr({close:I,send:W,onReady:g.onReady||Cn,onResponse:g.onResponse||Cn,onMessage:g.onMessage||Cn});window.addEventListener("message",S);var N=Lt(ai(Vn(d)),2),T=N[0],R=N[1],L=setInterval(function(){T&&T.closed&&I()},500);return{send:W,close:I};function I(){try{window.removeEventListener("message",S),clearInterval(L),R(),v()}catch(lt){console.error("Popup Close Error",lt)}}function W(lt){try{T.postMessage(JSON.parse(JSON.stringify(lt||{})),"*")}catch(It){console.error("Popup Send Error",lt,It)}}}(n,{onReady:function(d,g){return x(h.mark(function v(){var m;return h.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:m=g.send,b.prev=1,m({fclVersion:Ut,type:"FCL:VIEW:READY:RESPONSE",body:r,service:{params:n.params,data:n.data,type:n.type},config:e}),m({fclVersion:Ut,type:"FCL:FRAME:READY:RESPONSE",body:r,service:{params:n.params,data:n.data,type:n.type},config:e,deprecated:{message:"FCL:FRAME:READY:RESPONSE is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),l&&m({jsonrpc:"2.0",id:i,method:"fcl:sign",params:[r,n.params]}),b.next=10;break;case 7:throw b.prev=7,b.t0=b.catch(1),b.t0;case 10:case"end":return b.stop()}},v,null,[[1,7]])}))()},onResponse:function(d,g){var v=g.close;try{if("object"!==z(d.data))return;var m=Zt(d.data);switch(m.status){case"APPROVED":o(m.data),!c&&v();break;case"DECLINED":u("Declined: ".concat(m.reason||"No reason supplied")),v();break;case"REDIRECT":o(m),v();break;default:u("Declined: No reason supplied"),v()}}catch(b){throw console.error("execPopRPC onResponse error",b),b}},onMessage:function(d,g){var v=g.close;try{if("object"!==z(d.data)||"2.0"!==d.data.jsonrpc||d.data.id!==i)return;var m=Zt(d.data.result);switch(m.status){case"APPROVED":o(m.data),!c&&v();break;case"DECLINED":u("Declined: ".concat(m.reason||"No reason supplied")),v();break;case"REDIRECT":o(m),v();break;default:u("Declined: No reason supplied"),v()}}catch(b){throw console.error("execPopRPC onMessage error",b),b}},onClose:function(){u("Declined: Externally Halted")}})})},"TAB/RPC":function(t){var n=t.service,r=t.body,e=t.config,a=t.opts;return new Promise(function(o,u){var i=va(),c=a.redir,l=a.includeOlderJsonRpcCall;!function(d){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==d)return{send:On,close:On};var v=g.onClose||On,S=Tr({close:I,send:W,onReady:g.onReady||On,onResponse:g.onResponse||On,onMessage:g.onMessage||On});window.addEventListener("message",S);var N=Lt(ui(Vn(d)),2),T=N[0],R=N[1],L=setInterval(function(){T&&T.closed&&I()},500);return{send:W,close:I};function I(){try{window.removeEventListener("message",S),clearInterval(L),R(),v()}catch(lt){console.error("Tab Close Error",lt)}}function W(lt){try{T.postMessage(JSON.parse(JSON.stringify(lt||{})),"*")}catch(It){console.error("Tab Send Error",lt,It)}}}(n,{onReady:function(d,g){return x(h.mark(function v(){var m;return h.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:m=g.send,b.prev=1,m({fclVersion:Ut,type:"FCL:VIEW:READY:RESPONSE",body:r,service:{params:n.params,data:n.data,type:n.type},config:e}),m({fclVersion:Ut,type:"FCL:FRAME:READY:RESPONSE",body:r,service:{params:n.params,data:n.data,type:n.type},config:e,deprecated:{message:"FCL:FRAME:READY:RESPONSE is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),l&&m({jsonrpc:"2.0",id:i,method:"fcl:sign",params:[r,n.params]}),b.next=10;break;case 7:throw b.prev=7,b.t0=b.catch(1),b.t0;case 10:case"end":return b.stop()}},v,null,[[1,7]])}))()},onResponse:function(d,g){var v=g.close;try{if("object"!==z(d.data))return;var m=Zt(d.data);switch(m.status){case"APPROVED":o(m.data),!c&&v();break;case"DECLINED":u("Declined: ".concat(m.reason||"No reason supplied")),v();break;case"REDIRECT":o(m),v();break;default:u("Declined: No reason supplied"),v()}}catch(b){throw console.error("execPopRPC onResponse error",b),b}},onMessage:function(d,g){var v=g.close;try{if("object"!==z(d.data)||"2.0"!==d.data.jsonrpc||d.data.id!==i)return;var m=Zt(d.data.result);switch(m.status){case"APPROVED":o(m.data),!c&&v();break;case"DECLINED":u("Declined: ".concat(m.reason||"No reason supplied")),v();break;case"REDIRECT":o(m),v();break;default:u("Declined: No reason supplied"),v()}}catch(b){throw console.error("execPopRPC onMessage error",b),b}},onClose:function(){u("Declined: Externally Halted")}})})},"EXT/RPC":function(t){var n=t.service,r=t.body,e=t.config;return new Promise(function(a,o){!function(u){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==u)return{send:Pn,close:Pn};var c=i.onClose||Pn,v=Tr({close:m,send:b,onReady:i.onReady||Pn,onResponse:i.onResponse||Pn,onMessage:i.onMessage||Pn});return window.addEventListener("message",v),b({service:u}),{send:b,close:m};function m(){try{window.removeEventListener("message",v),c()}catch(E){console.error("Ext Close Error",E)}}function b(E){try{window&&window.postMessage(JSON.parse(JSON.stringify(E||{})),"*")}catch(S){console.error("Ext Send Error",E,S)}}}(n,{onReady:function(u,i){return x(h.mark(function c(){var l;return h.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:l=i.send,d.prev=1,l({fclVersion:Ut,type:"FCL:VIEW:READY:RESPONSE",body:r,service:{params:n.params,data:n.data,type:n.type},config:e}),d.next=8;break;case 5:throw d.prev=5,d.t0=d.catch(1),d.t0;case 8:case"end":return d.stop()}},c,null,[[1,5]])}))()},onResponse:function(u,i){var c=i.close;try{if("object"!==z(u.data))return;var l=Zt(u.data);switch(l.status){case"APPROVED":a(l.data),c();break;case"DECLINED":o("Declined: ".concat(l.reason||"No reason supplied")),c();break;case"REDIRECT":a(l),c();break;default:o("Declined: No reason supplied"),c()}}catch(d){throw console.error("execExtRPC onResponse error",d),d}},onClose:function(){o("Declined: Externally Halted")}})})}},Tl=["ServicePlugin"],Cl=["discovery-service"],Xn=(wa=new Set,Jn=new Map(Object.entries(fi)),ci=function(t){return wa=new Set(K(t))},Object.freeze({add:function(t){if(C(Cl.includes(t.type),"Service Plugin type ".concat(t.type," is not supported")),"discovery-service"===t.type){var n=function(a){var o=a.services,u=a.serviceStrategy;C(Array.isArray(o)&&o.length,"Array of Discovery Services is required");var i,c=bt(o);try{for(c.s();!(i=c.n()).done;){var l=i.value;C(Xt(l.f_type)&&"Service"===l.f_type,"Service is required"),C(Xt(l.type)&&"authn"===l.type,"Service must be type authn. Received ".concat(l.type)),C(l.method in fi||u.method===l.method,"Service method ".concat(l.method," is not supported"))}}catch(d){c.e(d)}finally{c.f()}return C(Xt(u),"Service strategy is required"),C(Xt(u.method)&&An(u.method),"Service strategy method is required"),C(Xt(u.exec)&&gs(u.exec),"Service strategy exec function is required"),{discoveryServices:o,serviceStrategy:u}}(t),e=n.serviceStrategy;ci(n.discoveryServices),Jn.has(e.method)?wt({title:"Add Service Plugin",message:"Service strategy for ".concat(e.method," already exists"),level:St.warn}):Jn.set(e.method,e.exec)}},getServices:function(){return K(wa)},getStrategy:function(t){return Jn.get(t)},getStrategies:function(){return K(Jn.keys())}})),Ol=(xa=new Map,Object.freeze({add:function(t){var n,r=function(o){var u;C(o,"No plugins supplied");var i,c=bt(u=Array.isArray(o)?K(o):[o]);try{for(c.s();!(i=c.n()).done;){var l=i.value;C(Xt(l.name),"Plugin name is required"),C(Xt(l.f_type),"Plugin f_type is required"),C(Tl.includes(l.f_type),"Plugin type ".concat(l.f_type," is not supported"))}}catch(d){c.e(d)}finally{c.f()}return u}(t),e=bt(r);try{for(e.s();!(n=e.n()).done;){var a=n.value;xa.set(a.name,a),"ServicePlugin"===a.f_type&&Xn.add(a)}}catch(o){e.e(o)}finally{e.f()}},getPlugins:function(){return xa}})),Pl=function(){var t=x(h.mark(function n(r){var e,a,o,u,i;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a=r.body,o=r.config,u=r.opts,i=Xn.getStrategy((e=r.service).method),c.abrupt("return",i({service:e,body:a,config:o,opts:u}));case 3:case"end":return c.stop()}},n)}));return function(n){return t.apply(this,arguments)}}();function hn(t){return ka.apply(this,arguments)}function ka(){return ka=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,d,g,v,m;return h.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return l=void 0===(c=n.config)?{}:c,g=void 0===(d=n.opts)?{}:d,(i=void 0===(u=n.msg)?{}:u).data=(o=n.service).data,b.next=4,xo(/^service\./);case 4:return b.t0=b.sent,b.next=7,xo(/^app\.detail\./);case 7:return b.t1=b.sent,b.t2=O(O({},l.client),{},{fclVersion:Ut,fclLibrary:"https://github.com/onflow/fcl-js",hostname:null!==(r=null===(e=window)||void 0===e||null===(a=e.location)||void 0===a?void 0:a.hostname)&&void 0!==r?r:null}),v={services:b.t0,app:b.t1,client:b.t2},b.prev=10,b.next=13,Pl({service:o,body:i,config:v,opts:g});case 13:if("REDIRECT"!==(m=b.sent).status){b.next=21;break}return C(o.type===m.data.type,"Cannot shift recursive service type in execService"),b.next=18,hn({service:m.data,msg:i,config:v,opts:g});case 18:return b.abrupt("return",b.sent);case 21:return b.abrupt("return",m);case 22:b.next=28;break;case 24:throw b.prev=24,b.t3=b.catch(10),wt({title:"Error on execService ".concat(null==o?void 0:o.type),message:b.t3,level:St.error}),b.t3;case 28:case"end":return b.stop()}},t,null,[[10,24]])})),ka.apply(this,arguments)}function Ea(t){return null==t?null:"1.0.0"===t.f_vsn?t:O(O({},pa),{},{addr:Z(t.addr||t.address),signature:t.signature||t.sig,keyId:t.keyId})}var Nn,li=function(){var t=x(h.mark(function n(){var r,e;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e=(null===(r=window)||void 0===r?void 0:r.fcl_extensions)||[],a.abrupt("return",[].concat(K(e),K(Xn.getServices())));case 2:case"end":return a.stop()}},n)}));return function(){return t.apply(this,arguments)}}();function Nl(t){return pi.apply(this,arguments)}function pi(){return(pi=x(h.mark(function t(n){var r,e,a,o,u;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,j.get("discovery.authn.include",[]);case 2:return e=i.sent,i.next=5,j.first(["discovery.wallet.method","discovery.wallet.method.default"]);case 5:if(a=i.sent,o=null!=n&&n.method?n.method:a,null===(r=null==n?void 0:n.endpoint)||void 0===r){i.next=11;break}i.t0=r,i.next=14;break;case 11:return i.next=13,j.first(["discovery.wallet","challenge.handshake"]);case 13:i.t0=i.sent;case 14:return C(u=i.t0,'\n If no service is passed to "authenticate," then "discovery.wallet" must be defined in fcl config.\n See: "https://docs.onflow.org/fcl/reference/api/#setting-configuration-values"\n '),i.abrupt("return",O(O({},n),{},{type:"authn",endpoint:u,method:o,discoveryAuthnInclude:e}));case 17:case"end":return i.stop()}},t)}))).apply(this,arguments)}function Bl(t){return Ia.apply(this,arguments)}function Ia(){return Ia=x(h.mark(function t(n){var r,e,a,o,u,i;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a=n.types,c.next=3,j.get("discovery.authn.endpoint");case 3:return o=c.sent,C(Boolean(o),'"discovery.authn.endpoint" in config must be defined.'),c.next=7,j.get("discovery.authn.include",[]);case 7:return u=c.sent,i=new URL(o),c.t0=fetch,c.t1=i,c.t2={"Content-Type":"application/json"},c.t3=JSON,c.t4=a,c.t5=Ut,c.t6=u,c.next=18,li();case 18:return c.t7=c.sent,c.t8=Xn.getStrategies(),c.t9=null===(r=window)||void 0===r||null===(e=r.navigator)||void 0===e?void 0:e.userAgent,c.t10={type:c.t4,fclVersion:c.t5,include:c.t6,clientServices:c.t7,supportedStrategies:c.t8,userAgent:c.t9},c.t11=c.t3.stringify.call(c.t3,c.t10),c.t12={method:"POST",headers:c.t2,body:c.t11},c.abrupt("return",(0,c.t0)(c.t1,c.t12).then(function(l){return l.json()}));case 25:case"end":return c.stop()}},t)})),Ia.apply(this,arguments)}var di,hi,gn,Zn="authn",gi="UPDATED",mi="UPDATE_RESULTS",Sa=function(){var t=x(h.mark(function n(){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Bl({types:[Zn]});case 3:dt(Zn,mi,{results:e.sent}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),wt({title:"".concat(e.t0.name," Error fetching Discovery API services."),message:e.t0.message,level:St.error});case 10:case"end":return e.stop()}},n,null,[[0,7]])}));return function(){return t.apply(this,arguments)}}(),Ul=(q(Nn={},Nr,(hi=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:typeof window>"u"&&console.warn("\n %cFCL Warning\n ============================\n ".concat('"fcl.discovery" is only available in the browser.',"\n For more info, please see the docs: https://docs.onflow.org/fcl/\n ============================\n "),"font-weight:bold;font-family:monospace;"),"complete"===document.readyState?Sa():window.onload=x(h.mark(function o(){return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:Sa();case 1:case"end":return u.stop()}},o)}));case 2:case"end":return r.stop()}},t)})),function(t){return hi.apply(this,arguments)})),q(Nn,mi,function(t,n,r){t.merge(r),t.broadcast(gi,O({},t.all()))}),q(Nn,cn,function(t,n){t.subscribe(n.from),t.send(n.from,gi,O({},t.all()))}),q(Nn,nn,function(t,n){return t.unsubscribe(n.from)}),q(Nn,"SNAPSHOT",(di=x(h.mark(function t(n,r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.reply(O({},n.all())));case 1:case"end":return e.stop()}},t)})),function(t,n){return di.apply(this,arguments)})),Nn),vi=function(){return rn(Ul,Zn)},Fl={authn:{subscribe:function(t){return ur(Zn,vi,t)},snapshot:function(){return ro(Zn,vi)},update:function(){return Sa()}}};function Dl(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)||function jl(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)||typeof navigator<"u"&&/iPad/.test(navigator.userAgent)}()}var yi,bi,Gl=function(t){return"function"==typeof t},Mt="CURRENT_USER",Aa="CURRENT_USER/UPDATED",wi="SNAPSHOT",Ra="SET_CURRENT_USER",xi="DEL_CURRENT_USER",_a='{\n "f_type": "User",\n "f_vsn": "1.0.0",\n "addr":null,\n "cid":null,\n "loggedIn":null,\n "expiresAt":null,\n "services":[]\n}',Ml=function(){var t=x(h.mark(function n(r){var e,a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return e=JSON.parse(_a),o.next=3,r.get(Mt);case 3:if(null==(a=o.sent)||e.f_vsn===a.f_vsn){o.next=7;break}return r.removeItem(Mt),o.abrupt("return",e);case 7:return o.abrupt("return",a||e);case 8:case"end":return o.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),zl=(q(gn={},Nr,function(){var t=x(h.mark(function n(r){var e,a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return typeof window>"u"&&console.warn('\n %cFCL Warning\n ============================\n "currentUser" is only available in the browser.\n For more info, please see the docs: https://docs.onflow.org/fcl/\n ============================\n ',"font-weight:bold;font-family:monospace;"),r.merge(JSON.parse(_a)),o.next=4,j.first(["fcl.storage","fcl.storage.default"]);case 4:if(!(e=o.sent).can){o.next=10;break}return o.next=8,Ml(e);case 8:Yl(a=o.sent)&&r.merge(a);case 10:case"end":return o.stop()}},n)}));return function(n){return t.apply(this,arguments)}}()),q(gn,cn,function(t,n){t.subscribe(n.from),t.send(n.from,Aa,O({},t.all()))}),q(gn,nn,function(t,n){t.unsubscribe(n.from)}),q(gn,wi,(bi=x(h.mark(function t(n,r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r.reply(O({},n.all()));case 1:case"end":return e.stop()}},t)})),function(t,n){return bi.apply(this,arguments)})),q(gn,Ra,function(){var t=x(h.mark(function n(r,e,a){var o;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return r.merge(a),u.next=3,j.first(["fcl.storage","fcl.storage.default"]);case 3:(o=u.sent).can&&o.put(Mt,r.all()),r.broadcast(Aa,O({},r.all()));case 6:case"end":return u.stop()}},n)}));return function(n,r,e){return t.apply(this,arguments)}}()),q(gn,xi,(yi=x(h.mark(function t(n,r){var e;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return n.merge(JSON.parse(_a)),a.next=3,j.first(["fcl.storage","fcl.storage.default"]);case 3:(e=a.sent).can&&e.put(Mt,n.all()),n.broadcast(Aa,O({},n.all()));case 6:case"end":return a.stop()}},t)})),function(t,n){return yi.apply(this,arguments)})),gn),Bn=function(){return rn(zl,Mt)};function Yl(t){return null==t.expiresAt||0===t.expiresAt||t.expiresAt>Date.now()}function ql(){return ki.apply(this,arguments)}function ki(){return(ki=x(h.mark(function t(){var n,r;return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j.get("fcl.accountProof.resolver");case 2:if(Gl(n=e.sent)){e.next=5;break}return e.abrupt("return");case 5:return e.next=7,n();case 7:if(null!=(r=e.sent)){e.next=10;break}return e.abrupt("return");case 10:return C("string"==typeof r.appIdentifier,"appIdentifier must be a string"),C(/^[0-9a-f]+$/i.test(r.nonce),"Nonce must be a hex string"),e.abrupt("return",r);case 13:case"end":return e.stop()}},t)}))).apply(this,arguments)}var Kl=function(){var t=x(h.mark(function n(r){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.t0=r.discoveryAuthnInclude,a.next=4,li();case 4:return a.t1=a.sent,a.t2=Xn.getStrategies(),a.t3={discoveryAuthnInclude:a.t0,clientServices:a.t1,supportedStrategies:a.t2},a.abrupt("return",{client:a.t3});case 8:case"end":return a.stop()}},n)}));return function(n){return t.apply(this,arguments)}}();function $n(){return Ta.apply(this,arguments)}function Ta(){return Ta=x(h.mark(function t(){var n,r,e,a,o,u,i,c=arguments;return h.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(u=void 0!==(o=(e=c.length>0&&void 0!==c[0]?c[0]:{}).redir)&&o,!(a=e.service)||null!=a&&null!==(n=a.provider)&&void 0!==n&&n.is_installed||null==a||null===(r=a.provider)||void 0===r||!r.requires_install){l.next=4;break}return window.location.href=null==a||null===(i=a.provider)||void 0===i?void 0:i.install_link,l.abrupt("return");case 4:return l.abrupt("return",new Promise(function(){var d=x(h.mark(function g(v,m){var b,E,S,N,T,R,L;return h.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return Bn(),b={redir:u},I.next=4,Qn();case 4:return E=I.sent,I.next=7,Nl(a);case 7:return S=I.sent,N=Ar(E.services,"authn-refresh"),I.prev=9,I.next=12,ql();case 12:T=I.sent,I.next=19;break;case 15:return I.prev=15,I.t0=I.catch(9),console.error("Error During Authentication: Could not resolve account proof data.\n ".concat(I.t0)),I.abrupt("return",m(I.t0));case 19:if(!E.loggedIn){I.next=47;break}if(!N){I.next=46;break}return I.prev=21,I.next=24,hn({service:N,msg:T,opts:b});case 24:return R=I.sent,I.t1=dt,I.t2=Mt,I.t3=Ra,I.next=30,$s(R);case 30:I.t4=I.sent,(0,I.t1)(I.t2,I.t3,I.t4),I.next=37;break;case 34:I.prev=34,I.t5=I.catch(21),console.error("Error: Could not refresh authentication.",I.t5);case 37:return I.prev=37,I.t6=v,I.next=41,Qn();case 41:return I.t7=I.sent,I.abrupt("return",(0,I.t6)(I.t7));case 44:I.next=47;break;case 46:return I.abrupt("return",v(E));case 47:return I.prev=47,I.t8=hn,I.t9=S,I.t10=T,I.next=53,Kl(S);case 53:return I.t11=I.sent,I.t12=b,I.t13={service:I.t9,msg:I.t10,config:I.t11,opts:I.t12},I.next=58,(0,I.t8)(I.t13);case 58:return L=I.sent,I.t14=dt,I.t15=Mt,I.t16=Ra,I.next=64,$s(L);case 64:I.t17=I.sent,(0,I.t14)(I.t15,I.t16,I.t17),I.next=71;break;case 68:I.prev=68,I.t18=I.catch(47),console.error("Error while authenticating",I.t18);case 71:return I.prev=71,I.t19=v,I.next=75,Qn();case 75:return I.t20=I.sent,(0,I.t19)(I.t20),I.finish(71);case 78:case"end":return I.stop()}},g,null,[[9,15],[21,34,37,44],[47,68,71,78]])}));return function(g,v){return d.apply(this,arguments)}}()));case 5:case"end":return l.stop()}},t)})),Ta.apply(this,arguments)}function Ei(){Bn(),dt(Mt,xi)}function Hl(t){var d,n={f_type:"PreAuthzResponse",f_vsn:"1.0.0",proposer:((d=t)||{}).proposer,payer:(d||{}).payer||[],authorization:(d||{}).authorization||[]},r=[];null!=n.proposer&&r.push(["PROPOSER",n.proposer]);var e,a=bt(n.payer||[]);try{for(a.s();!(e=a.n()).done;)r.push(["PAYER",e.value])}catch(d){a.e(d)}finally{a.f()}var u,i=bt(n.authorization||[]);try{for(i.s();!(u=i.n()).done;)r.push(["AUTHORIZER",u.value])}catch(d){i.e(d)}finally{i.f()}var l=r.map(function(d){var g=Lt(d,2),v=g[0],m=g[1];return{tempId:[m.identity.address,m.identity.keyId].join("|"),addr:m.identity.address,keyId:m.identity.keyId,signingFunction:function(b){return hn({service:m,msg:b})},role:{proposer:"PROPOSER"===v,payer:"PAYER"===v,authorizer:"AUTHORIZER"===v}}});return l}function Ii(t){return Ca.apply(this,arguments)}function Ca(){return Ca=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return Bn(),r.abrupt("return",O(O({},n),{},{tempId:"CURRENT_USER",resolve:function(e,a){return x(h.mark(function o(){var u,i,c,l;return h.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,$n({redir:!0});case 2:if(i=Ar((u=d.sent).services,"authz"),!(c=Ar(u.services,"pre-authz"))){d.next=11;break}return d.t0=Hl,d.next=9,hn({service:c,msg:a});case 9:return d.t1=d.sent,d.abrupt("return",(0,d.t0)(d.t1));case 11:if(!i){d.next=14;break}return Dl()&&"WC/RPC"===i.method&&(l=window.open("","_blank")),d.abrupt("return",O(O({},e),{},{tempId:"CURRENT_USER",resolve:null,addr:Z(i.identity.address),keyId:i.identity.keyId,sequenceNum:null,signature:null,signingFunction:function(g){return x(h.mark(function v(){return h.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.t0=Ea,m.next=3,hn({service:i,msg:g,opts:{includeOlderJsonRpcCall:!0,windowRef:l}});case 3:return m.t1=m.sent,m.abrupt("return",(0,m.t0)(m.t1));case 5:case"end":return m.stop()}},v)}))()}}));case 14:throw new Error("No Authz or PreAuthz Service configured for CURRENT_USER");case 15:case"end":return d.stop()}},o)}))()}}));case 2:case"end":return r.stop()}},t)})),Ca.apply(this,arguments)}function Si(t){Bn();var e,n="@EXIT",r=rn((e=x(h.mark(function a(o){var u;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:o.send(Mt,cn);case 1:return i.next=4,o.receive();case 4:if((u=i.sent).tag!==n){i.next=8;break}return o.send(Mt,nn),i.abrupt("return");case 8:t(u.data),i.next=1;break;case 11:case"end":return i.stop()}},a)})),function(a){return e.apply(this,arguments)}));return function(){return dt(r,n)}}function Qn(){return Bn(),dt(Mt,wi,null,{expectReply:!0,timeout:0})}function Ai(){return Ri.apply(this,arguments)}function Ri(){return(Ri=x(h.mark(function t(){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$n();case 2:return e.abrupt("return",$e(at(e.sent.addr),Bs));case 5:case"end":return e.stop()}},t)}))).apply(this,arguments)}var Wl=function(t){return C(/^[0-9a-f]+$/i.test(t),"Message must be a hex string"),{message:t}};function _i(t){return Oa.apply(this,arguments)}function Oa(){return Oa=x(h.mark(function t(n){var e,a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return Bn(),o.next=3,$n({redir:!0});case 3:return C(e=Ar(o.sent.services,"user-signature"),"Current user must have authorized a signing service."),o.prev=6,o.next=9,hn({service:e,msg:Wl(n)});case 9:if(a=o.sent,!Array.isArray(a)){o.next=14;break}return o.abrupt("return",a.map(function(u){return Ea(u)}));case 14:return o.abrupt("return",[Ea(a)]);case 15:o.next=20;break;case 17:return o.prev=17,o.t0=o.catch(6),o.abrupt("return",o.t0);case 20:case"end":return o.stop()}},t,null,[[6,17]])})),Oa.apply(this,arguments)}var xt=function(){return{authenticate:$n,unauthenticate:Ei,authorization:Ii,signUserMessage:_i,subscribe:Si,snapshot:Qn,resolveArgument:Ai}};function Pa(){return Pa=x(h.mark(function t(){var n,r,e,a=arguments;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return n=a.length>0&&void 0!==a[0]?a[0]:{},o.prev=1,o.next=4,dl(n);case 4:return o.next=6,Ys(n);case 6:return n=o.sent,o.next=9,j().get("fcl.authz",xt().authorization);case 9:return e=o.sent,r=j().overload(n.dependencies||{},x(h.mark(function u(){return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Ot([ps(n.cadence),Ze(Fs(n.args||[])),n.limit&&_f(n.limit)&&Xe(n.limit),is(n.proposer||n.authz||e),cs(n.payer||n.authz||e),os(n.authorizations||[n.authz||e])]).then(Sn));case 1:case"end":return i.stop()}},u)}))),o.abrupt("return",r);case 14:throw o.prev=14,o.t0=o.catch(1),o.t0;case 17:case"end":return o.stop()}},t,null,[[1,14]])})),Pa.apply(this,arguments)}xt.authenticate=$n,xt.unauthenticate=Ei,xt.authorization=Ii,xt.signUserMessage=_i,xt.subscribe=Si,xt.snapshot=Qn,xt.resolveArgument=Ai;var Ti=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=function(a){var o;return a.deprecated&&console.warn("DEPRECATION NOTICE",a.deprecated.message),null==a||null===(o=a.body)||void 0===o||delete o.interaction,a},e=function(a){var o=a.data;"object"===z(o)&&null!=z(o)&&o.type===t&&n(r(o))};return window.addEventListener("message",e),function(){return window.removeEventListener("message",e)}},Ln=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(window.location!==window.parent.location)window.parent.postMessage(O(O({},n),{},{type:t}),"*");else{if(!window.opener)throw new Error("Unable to communicate with parent FCL instance");window.opener.postMessage(O(O({},n),{},{type:t}),"*")}},Vl=function(t,n){return X.Buffer.from(t.padEnd(2*n,"0"),"hex")},Ci=function(t){return X.Buffer.from(t.padStart(16,"0"),"hex")},Oi=function(t){return X.Buffer.from(t,"hex")},Pi=function(t){var n=t.address,r=t.nonce,e=t.appIdentifier,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];C(n,"Encode Message For Provable Authn Error: address must be defined"),C(r,"Encode Message For Provable Authn Error: nonce must be defined"),C(e,"Encode Message For Provable Authn Error: appIdentifier must be defined"),C(r.length>=64,"Encode Message For Provable Authn Error: nonce must be minimum of 32 bytes");var o=Vl(X.Buffer.from("FCL-ACCOUNT-PROOF-V0.0").toString("hex"),32);return a?X.Buffer.concat([o,fn([e,Ci(Z(n)),Oi(r)])]).toString("hex"):fn([e,Ci(Z(n)),Oi(r)]).toString("hex")},Jl=Object.freeze({__proto__:null,sendMsgToFCL:Ln,ready:function(t){Ti("FCL:VIEW:READY:RESPONSE",t),Ln("FCL:VIEW:READY")},close:function(){Ln("FCL:VIEW:CLOSE")},approve:function(t){Ln("FCL:VIEW:RESPONSE",{f_type:"PollingResponse",f_vsn:"1.0.0",status:"APPROVED",reason:null,data:t})},decline:function(t){Ln("FCL:VIEW:RESPONSE",{f_type:"PollingResponse",f_vsn:"1.0.0",status:"DECLINED",reason:t,data:null})},redirect:function(t){Ln("FCL:VIEW:RESPONSE",{f_type:"PollingResponse",f_vsn:"1.0.0",status:"REDIRECT",reason:null,data:t})},onMessageFromFCL:Ti,encodeMessageFromSignable:function(t,n){var r,e,a=(r=t.voucher,(e=new Set(r.authorizers)).add(r.proposalKey.address),e.delete(r.payer),Array.from(e).map(at)),o=Array.from(new Set([t.voucher.payer])).map(at),u=a.includes(at(n)),i=o.includes(at(n));if(!u&&!i)throw new xf(n);var c={cadence:t.voucher.cadence,refBlock:t.voucher.refBlock,computeLimit:t.voucher.computeLimit,arguments:t.voucher.arguments,proposalKey:O(O({},t.voucher.proposalKey),{},{address:Z(t.voucher.proposalKey.address)}),payer:Z(t.voucher.payer),authorizers:t.voucher.authorizers.map(Z),payloadSigs:t.voucher.payloadSigs.map(function(l){return O(O({},l),{},{address:Z(l.address)})})};return u?Cu(c):Ou(c)},CompositeSignature:function(t,n,r){this.f_type=pa.f_type,this.f_vsn=pa.f_vsn,this.addr=at(t),this.keyId=Number(n),this.signature=r},encodeAccountProof:Pi,injectExtService:function(t){"authn"===t.type&&null!=t.endpoint?(Array.isArray(window.fcl_extensions)||(window.fcl_extensions=[]),window.fcl_extensions.push(t)):console.warn("Authn service is required")}}),Xl="ACCOUNT_PROOF",Zl="USER_SIGNATURE",Ni=function(t){if(t.appIdentifier){var r=t.address,e=t.nonce,a=t.signatures;return C(An(t.appIdentifier),"verifyAccountProof({ appIdentifier }) -- appIdentifier must be a string"),C(An(r)&&16===Z(r).length,"verifyAccountProof({ address }) -- address must be a valid address"),C(/^[0-9a-f]+$/i.test(e),"nonce must be a hex string"),C(Array.isArray(a)&&a.every(function(c,l,d){return"CompositeSignature"===c.f_type}),"Must include an Array of CompositeSignatures to verify"),C(a.map(function(c){return c.addr}).every(function(c,l,d){return c===d[0]}),"User signatures to be verified must be from a single account address"),!0}var u=t.address,i=t.compSigs;return C(/^[0-9a-f]+$/i.test(t.message),"Signed message must be a hex string"),C(An(u)&&16===Z(u).length,"verifyUserSignatures({ address }) -- address must be a valid address"),C(Array.isArray(i)&&i.every(function(c,l,d){return"CompositeSignature"===c.f_type}),"Must include an Array of CompositeSignatures to verify"),C(i.map(function(c){return c.addr}).every(function(c,l,d){return c===d[0]}),"User signatures to be verified must be from a single account address"),!0},Bi=function(){var t=x(h.mark(function n(r,e){var a,o;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return a="ACCOUNT_PROOF"===r?"verifyAccountProofSignatures":"verifyUserSignatures",i.next=3,j.get("flow.network");case 3:if(o=i.sent){i.next=9;break}return i.next=7,j.get("env");case 7:(o=i.sent)&&wt.deprecate({pkg:"FCL",subject:'Using the "env" configuration key for specifying the flow network',message:'Please use "flow.network" instead.',transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/TRANSITIONS.md#0001-deprecate-env-config-key"});case 9:return C(e.fclCryptoContract||"testnet"===o||"mainnet"===o,"${verifyFunction}({ fclCryptoContract }) -- config.flow.network must be specified (testnet || mainnet) or contract address provided via opts.fclCryptoContract"),i.abrupt("return","\n import FCLCrypto from ".concat(e.fclCryptoContract?e.fclCryptoContract:"testnet"===o?"0x74daa6f9c7ef24b1":"0xb4b82a1c9d21d284","\n\n pub fun main(\n address: Address, \n message: String, \n keyIndices: [Int], \n signatures: [String]\n ): Bool {\n return FCLCrypto.").concat(a,"(address: address, message: message, keyIndices: keyIndices, signatures: signatures)\n }\n "));case 12:case"end":return i.stop()}},n)}));return function(n,r){return t.apply(this,arguments)}}();function Na(){return Na=x(h.mark(function t(n,r){var e,a,o,u,i,c,l,d,g,v,m=arguments;return h.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:u=m.length>2&&void 0!==m[2]?m[2]:{},Ni({appIdentifier:n,address:e=r.address,nonce:a=r.nonce,signatures:o=r.signatures}),i=Pi({address:e,nonce:a,appIdentifier:n},!1),c=[],l=[],d=bt(o);try{for(d.s();!(g=d.n()).done;)c.push((v=g.value).signature),l.push(v.keyId.toString())}catch(E){d.e(E)}finally{d.f()}return b.t0=Sr,b.next=11,Bi(Xl,u);case 11:return b.t1=b.sent,b.t2=function(E,S){return[E(at(e),S.Address),E(i,S.String),E(l,S.Array(S.Int)),E(c,S.Array(S.String))]},b.t3={cadence:b.t1,args:b.t2},b.abrupt("return",(0,b.t0)(b.t3));case 15:case"end":return b.stop()}},t)})),Na.apply(this,arguments)}function Li(t,n){return Ba.apply(this,arguments)}function Ba(){return Ba=x(h.mark(function t(n,r){var e,a,o,u,i,c,l,d=arguments;return h.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:e=d.length>2&&void 0!==d[2]?d[2]:{},a=at(r[0].addr),Ni({message:n,address:a,compSigs:r}),o=[],u=[],i=bt(r);try{for(i.s();!(c=i.n()).done;)o.push((l=c.value).signature),u.push(l.keyId.toString())}catch(v){i.e(v)}finally{i.f()}return g.t0=Sr,g.next=10,Bi(Zl,e);case 10:return g.t1=g.sent,g.t2=function(v,m){return[v(a,m.Address),v(n,m.String),v(u,m.Array(m.Int)),v(o,m.Array(m.String))]},g.t3={cadence:g.t1,args:g.t2},g.abrupt("return",(0,g.t0)(g.t3));case 14:case"end":return g.stop()}},t)})),Ba.apply(this,arguments)}var Un,Cr,$l=Object.freeze({__proto__:null,verifyAccountProof:function(t,n){return Na.apply(this,arguments)},verifyUserSignatures:Li}),Ql=wt.deprecate({pkg:"FCL",subject:"fcl.verifyUserSignatures()",message:"Please use fcl.AppUtils.verifyUserSignatures()",callback:function(t,n){return Li(t,n)}}),tp=function(){var t=x(h.mark(function n(){var r,e,a,o=arguments;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return r=o.length>0&&void 0!==o[0]?o[0]:[],e=o.length>1&&void 0!==o[1]?o[1]:{},u.next=4,j.first(["sdk.resolve"],e.resolve||He);case 4:if(a=u.sent,!Array.isArray(r)){u.next=9;break}return u.next=8,st(pr(),r);case 8:r=u.sent;case 9:return u.t0=JSON,u.t1=Yn,u.next=13,a(r);case 13:return u.t2=u.sent,u.t3=(0,u.t1)(u.t2),u.abrupt("return",u.t0.stringify.call(u.t0,u.t3,null,2));case 16:case"end":return u.stop()}},n)}));return function(){return t.apply(this,arguments)}}(),La="POLL",np=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ot([ss(r)]).then(Sn));case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),Ua=function(t){return t.status>=4},Ui=function(t){return t.status>=3},Fi=function(t){return t.status>=2},rp=(q(Un={},Nr,function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r.sendSelf(La);case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}()),q(Un,cn,function(t,n){t.subscribe(n.from),t.send(n.from,Br,t.all())}),q(Un,nn,function(t,n){t.unsubscribe(n.from)}),q(Un,no,function(){var t=x(h.mark(function n(r,e){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:e.reply(r.all());case 1:case"end":return a.stop()}},n)}));return function(n,r){return t.apply(this,arguments)}}()),q(Un,La,function(){var t=x(h.mark(function n(r){var e;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,np(r.self());case 3:e=a.sent,a.next=9;break;case 6:return a.prev=6,a.t0=a.catch(0),a.abrupt("return",r.fatalError(a.t0));case 9:Ua(e)||setTimeout(function(){return r.sendSelf(La)},2500),o=r.all(),u=e,JSON.stringify(o)!==JSON.stringify(u)&&r.broadcast(Br,e),r.merge(e);case 12:case"end":return a.stop()}var o,u},n,null,[[0,6]])}));return function(n){return t.apply(this,arguments)}}()),Un),ji=function(t){if("object"===z(t)&&(t=t.transactionId),null==t)throw new Error("transactionId required");return t},Di=function(t){return rn(rp,ji(t))};function mn(t){function n(e){return ur(ji(t),Di,e)}function r(e){return function(){var o=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).suppress||!1;return new Promise(function(u,i){var c=n(function(l,d){!d&&!l.statusCode||o?e(l)&&(u(l),c()):(i(d||l.errorMessage),c())})})}}return{snapshot:function(){return ro(t,Di)},subscribe:n,onceFinalized:r(Fi),onceExecuted:r(Ui),onceSealed:r(Ua)}}mn.isUnknown=function(t){return t.status>=0},mn.isPending=function(t){return t.status>=1},mn.isFinalized=Fi,mn.isExecuted=Ui,mn.isSealed=Ua,mn.isExpired=function(t){return 5===t.status};var vn="TICK",Or="hwm",Fa=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=setTimeout,e.t1=function(){return r.sendSelf(vn)},e.next=4,j().get("fcl.eventPollRate",1e4);case 4:return e.t2=e.sent,e.abrupt("return",(0,e.t0)(e.t1,e.t2));case 6:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),ep=(q(Cr={},vn,function(){var t=x(h.mark(function n(r){var e,a,u,i;return h.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(r.hasSubs()){l.next=2;break}return l.abrupt("return");case 2:if(null!=(e=r.get(Or))){l.next=18;break}return l.t0=r,l.t1=Or,l.next=8,qn();case 8:return l.t2=l.sent,l.t0.put.call(l.t0,l.t1,l.t2),l.t3=r,l.t4=vn,l.next=14,Fa(r);case 14:l.t5=l.sent,l.t3.put.call(l.t3,l.t4,l.t5),l.next=34;break;case 18:return l.next=20,qn();case 20:if(r.put(Or,a=l.sent),!(e.height1&&void 0!==d[1]?d[1]:{},G(null!=(r=n.template),"getInteractionTemplateAudits({ template }) -- template must be defined"),G("InteractionTemplate"===(r=Wn(r)).f_type,"getInteractionTemplateAudits({ template }) -- template must be an InteractionTemplate"),g.next=7,Mi({template:r});case 7:if((o=g.sent)===r.id){g.next=11;break}throw wt({title:"getInteractionTemplateAudits Debug Error",message:"Could not recompute and match template ID\n computed: ".concat(o,"\n template: ").concat(r.id,"\n "),level:St.debug}),new Error("getInteractionTemplateAudits Error: Could not recompute and match template ID");case 11:g.t0=r.f_version,g.next="1.0.0"===g.t0?14:33;break;case 14:if(g.t1=e,g.t1){g.next=19;break}return g.next=18,j().get("flow.auditors");case 18:g.t1=g.sent;case 19:if(G(u=g.t1,"getInteractionTemplateAudits Error: Required configuration for 'fcl.auditors' is not set"),G(Array.isArray(u),"getInteractionTemplateAudits Error: Required configuration for 'fcl.auditors' is not an array"),i=a.flowInteractionAuditContract){g.next=29;break}return g.next=26,j().get("flow.network");case 26:G("mainnet"===(c=g.sent)||"testnet"===c,"getInteractionTemplateAudits Error: Unable to determine address for FlowInteractionTemplateAudit contract. Set configuration for 'fcl.network' to 'mainnet' or 'testnet'"),i="mainnet"===c?"0xfd100e39d50a13e6":"0xf78bfc12d0a786dc";case 29:return g.next=31,Sr({cadence:"\n import FlowInteractionTemplateAudit from ".concat(i,"\n pub fun main(templateId: String, auditors: [Address]): {Address:Bool} {\n return FlowInteractionTemplateAudit.getHasTemplateBeenAuditedByAuditors(templateId: templateId, auditors: auditors)\n }\n "),args:function(v,m){return[v(o,m.String),v(u,m.Array(m.Address))]}});case 31:return g.abrupt("return",g.sent);case 33:throw new Error("getInteractionTemplateAudits Error: Unsupported template version");case 34:case"end":return g.stop()}},t)})),Da.apply(this,arguments)}function zi(t){return{contractName:t.contractName,address:t.address,contract:""}}function op(t){var n,r=[],e=bt(t.match(/import ((\w|,| )+)* from 0x\w+/g)||[]);try{for(e.s();!(n=e.n()).done;){var a,u=/import ((\w+|, |)*) from (0x\w+)/g.exec(n.value),i=bt(u[1].match(/((?:\w+)+),?/g)||[]);try{for(i.s();!(a=i.n()).done;)r.push(zi({address:u[3],contractName:a.value.replace(/,/g,"")}))}catch(l){i.e(l)}finally{i.f()}}}catch(l){e.e(l)}finally{e.f()}return r}function Ga(t){return Ma.apply(this,arguments)}function Ma(){return Ma=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,d,g,v,m,b,E=arguments;return h.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:e=n.contractName,a=n.blockHeight,o=E.length>1&&void 0!==E[1]?E[1]:{},G(null!=(r=n.address),"generateDependencyPin({ address }) -- address must be defined"),G(null!=e,"generateDependencyPin({ contractName }) -- contractName must be defined"),G(null!=a,"generateDependencyPin({ blockHeight }) -- blockHeight must be defined"),G("string"==typeof r,"generateDependencyPin({ address }) -- address must be a string"),G("string"==typeof e,"generateDependencyPin({ contractName }) -- contractName must be a string"),G("number"==typeof a,"generateDependencyPin({ blockHeight }) -- blockHeight must be a number"),u=[zi({contractName:e,address:r})],i=0,c=u;case 10:if(!(i1&&void 0!==i[1]?i[1]:{},c.next=4,qn({sealed:!0},a);case 4:return c.abrupt("return",Ga({address:r,contractName:e,blockHeight:null==(o=c.sent)?void 0:o.height},a));case 7:case"end":return c.stop()}},t)})),za.apply(this,arguments)}function up(t){if(null==t)return null;if("1.0.0"===t.f_version)return t;throw new Error("normalizeInteractionTemplateInterface Error: Invalid InteractionTemplateInterface")}function Ya(){return Ya=x(h.mark(function t(n){var r,e,a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:G(null!=(r=n.templateInterface),"generateTemplateInterfaceId({ templateInterface }) -- templateInterface must be defined"),G("object"===z(r),"generateTemplateInterfaceId({ templateInterface }) -- templateInterface must be an object"),G("InteractionTemplateInterface"==typeof r.f_type,"generateTemplateInterfaceId({ templateInterface }) -- templateInterface object must be an InteractionTemplate"),r=up(r),o.t0=r.f_version,o.next="1.0.0"===o.t0?8:25;break;case 8:return e=r.data,o.t1=fn,o.next=12,J("InteractionTemplateInterface");case 12:return o.t2=o.sent,o.next=15,J("1.0.0");case 15:return o.t3=o.sent,o.next=18,J(e.flip);case 18:return o.t4=o.sent,o.next=21,Promise.all(Object.keys(e.arguments).map(function(){var u=x(h.mark(function i(c){return h.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,J(c);case 2:return l.t0=l.sent,l.next=5,J(String(e.arguments[c].index));case 5:return l.t1=l.sent,l.next=8,J(e.arguments[c].type);case 8:return l.t2=l.sent,l.abrupt("return",[l.t0,l.t1,l.t2]);case 10:case"end":return l.stop()}},i)}));return function(i){return u.apply(this,arguments)}}()));case 21:return o.t5=o.sent,o.t6=[o.t2,o.t3,o.t4,o.t5],a=(0,o.t1)(o.t6).toString("hex"),o.abrupt("return",J(a));case 25:throw new Error("generateTemplateInterfaceId Error: Unsupported templateInterface version");case 26:case"end":return o.stop()}},t)})),Ya.apply(this,arguments)}function Yi(t){return qa.apply(this,arguments)}function qa(){return qa=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,g,v,m,S,N,T=arguments;return h.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:e=n.blockHeight,a=n.network,o=T.length>1&&void 0!==T[1]?T[1]:{},G(null!=(r=n.template),"generateDependencyPin({ template }) -- template must be defined"),G("object"===z(r),"generateDependencyPin({ template }) -- template must be an object"),G("InteractionTemplate"===r.f_type,"generateDependencyPin({ template }) -- template must be an InteractionTemplate"),r=Wn(r),G(null!=a,"generateDependencyPin({ network }) network must be defined"),G(null!=e,"generateDependencyPin({ blockHeight }) blockHeight must be defined"),G("number"==typeof e,"generateDependencyPin({ blockHeight }) blockHeight must be a number"),R.t0=r.f_version,R.next="1.0.0"===R.t0?12:38;break;case 12:u=Object.keys(r.data.dependencies),i=0,c=u;case 14:if(!(i1&&void 0!==i[1]?i[1]:{},c.next=4,qn({sealed:!0});case 4:return c.abrupt("return",Yi({template:r,network:e,blockHeight:null==(o=c.sent)?void 0:o.height},a));case 7:case"end":return c.stop()}},t)})),Ka.apply(this,arguments)}var sp=Object.freeze({__proto__:null,getInteractionTemplateAudits:function(t){return Da.apply(this,arguments)},generateDependencyPin:Ga,generateDependencyPinAtLatestSealedBlock:function(t){return za.apply(this,arguments)},generateTemplateId:Mi,generateTemplateInterfaceId:function(t){return Ya.apply(this,arguments)},verifyDependencyPinsSame:Yi,verifyDependencyPinsSameAtLatestSealedBlock:function(t){return Ka.apply(this,arguments)},deriveCadenceByNetwork:zs,getTemplateMessage:function(t){var n,r,e,a=t.localization,o=void 0===a?"en-US":a,u=t.messageKey,i=t.template;G(u,"getMessage({ messageKey }) -- messageKey must be defined"),G("stirng"==typeof u,"getMessage({ messageKey }) -- messageKey must be a string"),G(o,"getMessage({ localization }) -- localization must be defined"),G("stirng"==typeof o,"getMessage({ localization }) -- localization must be a string"),G(null!=i,"generateTemplateId({ template }) -- template must be defined"),G("object"===z(i),"generateTemplateId({ template }) -- template must be an object"),G("InteractionTemplate"==typeof i.f_type,"generateTemplateId({ template }) -- template object must be an InteractionTemplate");var c=null==i||null===(n=i.data)||void 0===n?void 0:n.messages;return null==c||null===(r=c[u])||void 0===r||null===(e=r.i18n)||void 0===e?void 0:e[o]},getTemplateArgumentMessage:function(t){var n,r,e,a,o,u=t.localization,i=void 0===u?"en-US":u,c=t.argumentLabel,l=t.messageKey,d=t.template;G(l,"getMessage({ messageKey }) -- messageKey must be defined"),G("stirng"==typeof l,"getMessage({ messageKey }) -- messageKey must be a string"),G(c,"getMessage({ argumentLabel }) -- argumentLabel must be defined"),G("stirng"==typeof l,"getMessage({ argumentLabel }) -- argumentLabel must be a string"),G(i,"getMessage({ localization }) -- localization must be defined"),G("stirng"==typeof i,"getMessage({ localization }) -- localization must be a string"),G(null!=d,"generateTemplateId({ template }) -- template must be defined"),G("object"===z(d),"generateTemplateId({ template }) -- template must be an object"),G("InteractionTemplate"==typeof d.f_type,"generateTemplateId({ template }) -- template object must be an InteractionTemplate");var g=null==d||null===(n=d.data)||void 0===n?void 0:n.arguments;return null==g||null===(r=g[c])||void 0===r||null===(e=r.messages)||void 0===e||null===(a=e[l])||void 0===a||null===(o=a.i18n)||void 0===o?void 0:o[i]}}),ip=xt().authorization,cp=Us;B.AppUtils=$l,B.InteractionTemplateUtils=sp,B.TestUtils=Af,B.VERSION=Ut,B.WalletUtils=Jl,B.account=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.height,e=n.id,a=arguments.length>2?arguments[2]:void 0;return C(!(e&&r),'Method: account -- Cannot pass "id" and "height" simultaneously'),e?Ot([xn(t),Je(e)],a).then(Jt):r?Ot([xn(t),xr(r)],a).then(Jt):Ot([xn(t)],a).then(Jt)},B.arg=$e,B.args=Ze,B.atBlockHeight=xr,B.atBlockId=Je,B.authenticate=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xt().authenticate(t)},B.authorization=function(t,n,r,e){return{addr:t,signingFunction:n,keyId:r,sequenceNum:e}},B.authorizations=os,B.authz=ip,B.block=qn,B.build=yr,B.cadence=cr,B.cdc=cr,B.config=j,B.createSignableVoucher=Yn,B.currentUser=xt,B.decode=Sn,B.discovery=Fl,B.display=function(t){return at(t)},B.events=function(t){return{subscribe:function(n){return ur(t,ap,n)}}},B.getAccount=xn,B.getBlock=Mn,B.getBlockHeader=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return st([mu,function(n){return n.block.isSealed=t,ht(n)}])},B.getCollection=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return st([vu,function(n){return n.collection.id=t,n}])},B.getEvents=function(t,n,r){return void 0===n&&void 0===r||wt.deprecate({pkg:"FCL/SDK",subject:"Passing a start and end into getEvents",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0005-deprecate-start-end-get-events-builder"}),st([hr,function(e){return e.events.eventType=t,e.events.start=n,e.events.end=r,ht(e)}])},B.getEventsAtBlockHeightRange=us,B.getEventsAtBlockIds=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return st([hr,function(r){return r.events.eventType=t,r.events.blockIds=n,ht(r)}])},B.getTransaction=function(t){return st([pu,function(n){return n.transaction.id=t,ht(n)}])},B.getTransactionStatus=ss,B.invariant=G,B.isBad=Ue,B.isOk=bu,B.limit=Xe,B.logIn=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xt().authenticate(t)},B.mutate=function(){return Pa.apply(this,arguments)},B.param=function(t){return wt.deprecate({pkg:"FCL/SDK",message:"The param builder has been removed from the Flow JS-SDK/FCL.",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0001-deprecate-params",level:St.error})},B.params=function(t){return wt.deprecate({pkg:"FCL/SDK",message:"The params builder has been removed from the Flow JS-SDK/FCL.",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0001-deprecate-params",level:St.error})},B.payer=cs,B.ping=function(){return hu},B.pipe=st,B.pluginRegistry=Ol,B.proposer=is,B.query=Sr,B.reauthenticate=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xt().unauthenticate(),xt().authenticate(t)},B.ref=fs,B.sansPrefix=Z,B.script=ls,B.send=Ot,B.serialize=tp,B.signUp=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xt().authenticate(t)},B.t=cp,B.transaction=ps,B.tx=mn,B.unauthenticate=function(){return xt().unauthenticate()},B.validator=Ve,B.verifyUserSignatures=Ql,B.voucherIntercept=function(t){return vr("ix.voucher-intercept",t)},B.voucherToTxId=function(t){return function(t){var n=new he.SHA3(256);return n.update(X.Buffer.from(t,"hex")),n.digest().toString("hex")}(Ye(function(t){pf(t);var n=Du(t),r=function(e){return e.map(function(a){var u=a.keyId,i=a.sig;return{signerIndex:n.get(a.address),keyId:u,sig:i}}).sort(function(a,o){return a.signerIndex>o.signerIndex?1:a.signerIndexo.keyId?1:a.keyId{"use strict";B.r(er),B.d(er,{getFlowProvider:()=>yn});var tn=B(18983);tn.config({"accessNode.api":"https://rest-mainnet.onflow.org","discovery.wallet":"https://fcl-discovery.onflow.org/authn"});var yn=function(){return tn}}}]); \ No newline at end of file diff --git a/angular-bare-bones-demo/dist/795.f6cd60318a520391.js b/angular-bare-bones-demo/dist/296.1e4f5630973db106.js similarity index 99% rename from angular-bare-bones-demo/dist/795.f6cd60318a520391.js rename to angular-bare-bones-demo/dist/296.1e4f5630973db106.js index 3a010852a..c6608a428 100644 --- a/angular-bare-bones-demo/dist/795.f6cd60318a520391.js +++ b/angular-bare-bones-demo/dist/296.1e4f5630973db106.js @@ -1 +1 @@ -(self.webpackChunkAngular_bare_bones_demo=self.webpackChunkAngular_bare_bones_demo||[]).push([[795],{38795:(je,Ze,Fe)=>{"use strict";Fe.r(Ze),Fe.d(Ze,{getTorusProviderInstance:()=>Me});var Ie=Fe(30039),$e=Fe.n(Ie),Me=function(){return Ye=void 0,ze=void 0,Ge=function(){return function(Ye,ze){var Ge,C,t,n,Te={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function o(d){return function(p){return function c(d){if(Ge)throw new TypeError("Generator is already executing.");for(;n&&(n=0,d[0]&&(Te=0)),Te;)try{if(Ge=1,C&&(t=2&d[0]?C.return:d[0]?C.throw||((t=C.return)&&t.call(C),0):C.next)&&!(t=t.call(C,d[1])).done)return t;switch(C=0,t&&(d=[2&d[0],t.value]),d[0]){case 0:case 1:t=d;break;case 4:return Te.label++,{value:d[1],done:!1};case 5:Te.label++,C=d[1],d=[0];continue;case 7:d=Te.ops.pop(),Te.trys.pop();continue;default:if(!(t=(t=Te.trys).length>0&&t[t.length-1])&&(6===d[0]||2===d[0])){Te=0;continue}if(3===d[0]&&(!t||d[1]>t[0]&&d[1]{var Ie=Fe(91052).default,$e=Fe(48243).default,Oe=Fe(69466).default,xe=Fe(94745).default,Me=Fe(91291).default;self,je.exports=(()=>(()=>{var Ye={4320:function(C,t,n){"use strict";var o=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.JsonRpcError=void 0;const c=n(2451),d=o(n(4445)),p=n(8164);class s extends Error{constructor(a,y,b){if(!Number.isInteger(a))throw new Error('"code" must be an integer.');if(!y||"string"!=typeof y)throw new Error('"message" must be a non-empty string.');super(y),this.code=a,void 0!==b&&(this.data=b)}serialize(){const a={code:this.code,message:this.message};return void 0!==this.data&&(a.data=this.data,(0,c.isPlainObject)(this.data)&&(a.data.cause=(0,p.serializeCause)(this.data.cause))),this.stack&&(a.stack=this.stack),a}toString(){return(0,d.default)(this.serialize(),e,2)}}function e(i,a){if("[Circular]"!==a)return a}t.JsonRpcError=s,t.EthereumProviderError=class extends s{constructor(i,a,y){if(b=i,!(Number.isInteger(b)&&b>=1e3&&b<=4999))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');var b;super(i,a,y)}}},537:(C,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},2546:(C,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.providerErrors=t.rpcErrors=void 0;const o=n(4320),c=n(537),d=n(8164);function p(i,a){const[y,b]=e(a);return new o.JsonRpcError(i,y??(0,d.getMessageFromCode)(i),b)}function s(i,a){const[y,b]=e(a);return new o.EthereumProviderError(i,y??(0,d.getMessageFromCode)(i),b)}function e(i){if(i){if("string"==typeof i)return[i];if("object"==typeof i&&!Array.isArray(i)){const{message:a,data:y}=i;if(a&&"string"!=typeof a)throw new Error("Must specify string message.");return[a??void 0,y]}}return[]}t.rpcErrors={parse:i=>p(c.errorCodes.rpc.parse,i),invalidRequest:i=>p(c.errorCodes.rpc.invalidRequest,i),invalidParams:i=>p(c.errorCodes.rpc.invalidParams,i),methodNotFound:i=>p(c.errorCodes.rpc.methodNotFound,i),internal:i=>p(c.errorCodes.rpc.internal,i),server:i=>{if(!i||"object"!=typeof i||Array.isArray(i))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:a}=i;if(!Number.isInteger(a)||a>-32005||a<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return p(a,i)},invalidInput:i=>p(c.errorCodes.rpc.invalidInput,i),resourceNotFound:i=>p(c.errorCodes.rpc.resourceNotFound,i),resourceUnavailable:i=>p(c.errorCodes.rpc.resourceUnavailable,i),transactionRejected:i=>p(c.errorCodes.rpc.transactionRejected,i),methodNotSupported:i=>p(c.errorCodes.rpc.methodNotSupported,i),limitExceeded:i=>p(c.errorCodes.rpc.limitExceeded,i)},t.providerErrors={userRejectedRequest:i=>s(c.errorCodes.provider.userRejectedRequest,i),unauthorized:i=>s(c.errorCodes.provider.unauthorized,i),unsupportedMethod:i=>s(c.errorCodes.provider.unsupportedMethod,i),disconnected:i=>s(c.errorCodes.provider.disconnected,i),chainDisconnected:i=>s(c.errorCodes.provider.chainDisconnected,i),custom:i=>{if(!i||"object"!=typeof i||Array.isArray(i))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:a,message:y,data:b}=i;if(!y||"string"!=typeof y)throw new Error('"message" must be a nonempty string');return new o.EthereumProviderError(a,y,b)}}},9428:(C,t,n)=>{"use strict";t.PY=t.Xy=t.yd=void 0;var o=n(4320);Object.defineProperty(t,"yd",{enumerable:!0,get:function(){return o.EthereumProviderError}});var c=n(8164);Object.defineProperty(t,"Xy",{enumerable:!0,get:function(){return c.serializeError}});var d=n(2546);Object.defineProperty(t,"PY",{enumerable:!0,get:function(){return d.rpcErrors}}),n(537)},8164:(C,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeCause=t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const o=n(2451),c=n(537),d=c.errorCodes.rpc.internal,p={code:d,message:s(d)};function s(y,b="Unspecified error message. This is a bug, please report it."){if(e(y)){const g=y.toString();if((0,o.hasProperty)(c.errorValues,g))return c.errorValues[g].message;if((E=y)>=-32099&&E<=-32e3)return t.JSON_RPC_SERVER_ERROR_MESSAGE}var E;return b}function e(y){return Number.isInteger(y)}function i(y){return Array.isArray(y)?y.map(b=>(0,o.isValidJson)(b)?b:(0,o.isObject)(b)?a(b):null):(0,o.isObject)(y)?a(y):(0,o.isValidJson)(y)?y:null}function a(y){return Object.getOwnPropertyNames(y).reduce((b,g)=>{const E=y[g];return(0,o.isValidJson)(E)&&(b[g]=E),b},{})}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=s,t.isValidCode=e,t.serializeError=function(y,{fallbackError:b=p,shouldIncludeStack:g=!0}={}){if(!(0,o.isJsonRpcError)(b))throw new Error("Must provide fallback error with integer number code and string message.");const E=(v=b,(A=y)&&"object"==typeof A&&"serialize"in A&&"function"==typeof A.serialize?A.serialize():(0,o.isJsonRpcError)(A)?A:{...v,data:{cause:i(A)}});var A,v;return g||delete E.stack,E},t.serializeCause=i},1422:(C,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertExhaustive=t.assertStruct=t.assert=t.AssertionError=void 0;const o=n(7884);function c(p,s){return e=p,Boolean("string"==typeof(null===(a=null===(i=null==e?void 0:e.prototype)||void 0===i?void 0:i.constructor)||void 0===a?void 0:a.name))?new p({message:s}):p({message:s});var e,i,a}class d extends Error{constructor(s){super(s.message),this.code="ERR_ASSERTION"}}t.AssertionError=d,t.assert=function(p,s="Assertion failed.",e=d){if(!p)throw s instanceof Error?s:c(e,s)},t.assertStruct=function(p,s,e="Assertion failed",i=d){try{(0,o.assert)(p,s)}catch(a){throw c(i,`${e}: ${function(y){const b="object"==typeof(g=y)&&null!==g&&"message"in g?y.message:String(y);var g;return b.endsWith(".")?b.slice(0,-1):b}(a)}.`)}},t.assertExhaustive=function(p){throw new Error("Invalid branch reached. Should be detected during compilation.")}},7207:(C,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.base64=void 0;const o=n(7884),c=n(1422);t.base64=(d,p={})=>{var s,e;const i=null!==(s=p.paddingRequired)&&void 0!==s&&s,a=null!==(e=p.characterSet)&&void 0!==e?e:"base64";let y,b;return"base64"===a?y=String.raw`[A-Za-z0-9+\/]`:((0,c.assert)("base64url"===a),y=String.raw`[-_A-Za-z0-9]`),b=i?new RegExp(`^(?:${y}{4})*(?:${y}{3}=|${y}{2}==)?$`,"u"):new RegExp(`^(?:${y}{4})*(?:${y}{2,3}|${y}{3}=|${y}{2}==)?$`,"u"),(0,o.pattern)(d,b)}},8476:(C,t,n)=>{"use strict";var o=n(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.createDataView=t.concatBytes=t.valueToBytes=t.stringToBytes=t.numberToBytes=t.signedBigIntToBytes=t.bigIntToBytes=t.hexToBytes=t.bytesToString=t.bytesToNumber=t.bytesToSignedBigInt=t.bytesToBigInt=t.bytesToHex=t.assertIsBytes=t.isBytes=void 0;const c=n(1422),d=n(2009),i=function(){const O=[];return()=>{if(0===O.length)for(let L=0;L<256;L++)O.push(L.toString(16).padStart(2,"0"));return O}}();function a(O){return O instanceof Uint8Array}function y(O){(0,c.assert)(a(O),"Value must be a Uint8Array.")}function b(O){if(y(O),0===O.length)return"0x";const L=i(),I=new Array(O.length);for(let k=0;k=BigInt(0),"Value must be a non-negative bigint."),E(O.toString(16))}function v(O){return(0,c.assert)("number"==typeof O,"Value must be a number."),(0,c.assert)(O>=0,"Value must be a non-negative number."),(0,c.assert)(Number.isSafeInteger(O),"Value is not a safe integer. Use `bigIntToBytes` instead."),E(O.toString(16))}function _(O){return(0,c.assert)("string"==typeof O,"Value must be a string."),(new TextEncoder).encode(O)}function P(O){if("bigint"==typeof O)return A(O);if("number"==typeof O)return v(O);if("string"==typeof O)return O.startsWith("0x")?E(O):_(O);if(a(O))return O;throw new TypeError(`Unsupported value type: "${typeof O}".`)}t.isBytes=a,t.assertIsBytes=y,t.bytesToHex=b,t.bytesToBigInt=g,t.bytesToSignedBigInt=function(O){y(O);let L=BigInt(0);for(const I of O)L=(L<0,"Byte length must be greater than 0."),(0,c.assert)(function(F,G){(0,c.assert)(G>0);const B=F>>BigInt(31);return!((~F&B)+(F&~B)>>BigInt(8*G-1))}(O,L),"Byte length is too small to represent the given value.");let I=O;const k=new Uint8Array(L);for(let F=0;F>=BigInt(8);return k.reverse()},t.numberToBytes=v,t.stringToBytes=_,t.valueToBytes=P,t.concatBytes=function(O){const L=new Array(O.length);let I=0;for(let F=0;F{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChecksumStruct=void 0;const o=n(7884),c=n(7207);t.ChecksumStruct=(0,o.size)((0,c.base64)((0,o.string)(),{paddingRequired:!0}),44,44)},3557:(C,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHex=t.createBytes=t.createBigInt=t.createNumber=void 0;const o=n(7884),c=n(1422),d=n(8476),p=n(2009),s=(0,o.union)([(0,o.number)(),(0,o.bigint)(),(0,o.string)(),p.StrictHexStruct]),e=(0,o.coerce)((0,o.number)(),s,Number),i=(0,o.coerce)((0,o.bigint)(),s,BigInt),a=((0,o.union)([p.StrictHexStruct,(0,o.instance)(Uint8Array)]),(0,o.coerce)((0,o.instance)(Uint8Array),(0,o.union)([p.StrictHexStruct]),d.hexToBytes)),y=(0,o.coerce)(p.StrictHexStruct,(0,o.instance)(Uint8Array),d.bytesToHex);t.createNumber=function(b){try{const g=(0,o.create)(b,e);return(0,c.assert)(Number.isFinite(g),`Expected a number-like value, got "${b}".`),g}catch(g){throw g instanceof o.StructError?new Error(`Expected a number-like value, got "${b}".`):g}},t.createBigInt=function(b){try{return(0,o.create)(b,i)}catch(g){throw g instanceof o.StructError?new Error(`Expected a number-like value, got "${String(g.value)}".`):g}},t.createBytes=function(b){if("string"==typeof b&&"0x"===b.toLowerCase())return new Uint8Array;try{return(0,o.create)(b,a)}catch(g){throw g instanceof o.StructError?new Error(`Expected a bytes-like value, got "${String(g.value)}".`):g}},t.createHex=function(b){if(b instanceof Uint8Array&&0===b.length||"string"==typeof b&&"0x"===b.toLowerCase())return"0x";try{return(0,o.create)(b,y)}catch(g){throw g instanceof o.StructError?new Error(`Expected a bytes-like value, got "${String(g.value)}".`):g}}},4283:function(C,t){"use strict";var n,o,c=this&&this.__classPrivateFieldSet||function(e,i,a,y,b){if("m"===y)throw new TypeError("Private method is not writable");if("a"===y&&!b)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?e!==i||!b:!i.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===y?b.call(e,a):b?b.value=a:i.set(e,a),a},d=this&&this.__classPrivateFieldGet||function(e,i,a,y){if("a"===a&&!y)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?e!==i||!y:!i.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?y:"a"===a?y.call(e):y?y.value:i.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.FrozenSet=t.FrozenMap=void 0;class p{constructor(i){n.set(this,void 0),c(this,n,new Map(i),"f"),Object.freeze(this)}get size(){return d(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return d(this,n,"f")[Symbol.iterator]()}entries(){return d(this,n,"f").entries()}forEach(i,a){return d(this,n,"f").forEach((y,b,g)=>i.call(a,y,b,this))}get(i){return d(this,n,"f").get(i)}has(i){return d(this,n,"f").has(i)}keys(){return d(this,n,"f").keys()}values(){return d(this,n,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([i,a])=>`${String(i)} => ${String(a)}`).join(", ")} `:""}}`}}t.FrozenMap=p;class s{constructor(i){o.set(this,void 0),c(this,o,new Set(i),"f"),Object.freeze(this)}get size(){return d(this,o,"f").size}[(o=new WeakMap,Symbol.iterator)](){return d(this,o,"f")[Symbol.iterator]()}entries(){return d(this,o,"f").entries()}forEach(i,a){return d(this,o,"f").forEach((y,b,g)=>i.call(a,y,b,this))}has(i){return d(this,o,"f").has(i)}keys(){return d(this,o,"f").keys()}values(){return d(this,o,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(i=>String(i)).join(", ")} `:""}}`}}t.FrozenSet=s,Object.freeze(p),Object.freeze(p.prototype),Object.freeze(s),Object.freeze(s.prototype)},5345:(C,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2009:(C,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const o=n(7884),c=n(1422);function d(s){return(0,o.is)(s,t.HexStruct)}function p(s){return(0,o.is)(s,t.StrictHexStruct)}t.HexStruct=(0,o.pattern)((0,o.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,o.pattern)((0,o.string)(),/^0x[0-9a-f]+$/iu),t.isHexString=d,t.isStrictHexString=p,t.assertIsHexString=function(s){(0,c.assert)(d(s),"Value must be a hexadecimal string.")},t.assertIsStrictHexString=function(s){(0,c.assert)(p(s),'Value must be a hexadecimal string, starting with "0x".')},t.add0x=function(s){return s.startsWith("0x")?s:s.startsWith("0X")?`0x${s.substring(2)}`:`0x${s}`},t.remove0x=function(s){return s.startsWith("0x")||s.startsWith("0X")?s.substring(2):s}},2451:function(C,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(d,p,s,e){void 0===e&&(e=s);var i=Object.getOwnPropertyDescriptor(p,s);i&&!("get"in i?!p.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return p[s]}}),Object.defineProperty(d,e,i)}:function(d,p,s,e){void 0===e&&(e=s),d[e]=p[s]}),c=this&&this.__exportStar||function(d,p){for(var s in d)"default"===s||Object.prototype.hasOwnProperty.call(p,s)||o(p,d,s)};Object.defineProperty(t,"__esModule",{value:!0}),c(n(1422),t),c(n(7207),t),c(n(8476),t),c(n(5013),t),c(n(3557),t),c(n(4283),t),c(n(5345),t),c(n(2009),t),c(n(2497),t),c(n(3732),t),c(n(160),t),c(n(6215),t),c(n(9679),t),c(n(9108),t),c(n(7772),t),c(n(7749),t),c(n(8426),t)},2497:(C,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.getJsonSize=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=void 0;const o=n(7884),c=n(1422);t.UnsafeJsonStruct=(0,o.union)([(0,o.literal)(null),(0,o.boolean)(),(0,o.define)("finite number",d=>(0,o.is)(d,(0,o.number)())&&Number.isFinite(d)),(0,o.string)(),(0,o.array)((0,o.lazy)(()=>t.UnsafeJsonStruct)),(0,o.record)((0,o.string)(),(0,o.lazy)(()=>t.UnsafeJsonStruct))]),t.JsonStruct=(0,o.define)("Json",(d,p)=>{function s(e,i){const a=[...i.validator(e,p)];return!(a.length>0)||a}try{const e=s(d,t.UnsafeJsonStruct);return!0!==e?e:s(JSON.parse(JSON.stringify(d)),t.UnsafeJsonStruct)}catch(e){return e instanceof RangeError&&"Circular reference detected"}}),t.isValidJson=function(d){return(0,o.is)(d,t.JsonStruct)},t.getJsonSize=function(d){(0,c.assertStruct)(d,t.JsonStruct,"Invalid JSON value");const p=JSON.stringify(d);return(new TextEncoder).encode(p).byteLength},t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,o.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,o.nullable)((0,o.union)([(0,o.number)(),(0,o.string)()])),t.JsonRpcErrorStruct=(0,o.object)({code:(0,o.integer)(),message:(0,o.string)(),data:(0,o.optional)(t.JsonStruct),stack:(0,o.optional)((0,o.string)())}),t.JsonRpcParamsStruct=(0,o.optional)((0,o.union)([(0,o.record)((0,o.string)(),t.JsonStruct),(0,o.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,o.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,o.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,o.omit)(t.JsonRpcRequestStruct,["id"]),t.isJsonRpcNotification=function(d){return(0,o.is)(d,t.JsonRpcNotificationStruct)},t.assertIsJsonRpcNotification=function(d,p){(0,c.assertStruct)(d,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",p)},t.isJsonRpcRequest=function(d){return(0,o.is)(d,t.JsonRpcRequestStruct)},t.assertIsJsonRpcRequest=function(d,p){(0,c.assertStruct)(d,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",p)},t.PendingJsonRpcResponseStruct=(0,o.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,o.optional)((0,o.unknown)()),error:(0,o.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,o.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,o.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,o.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]),t.isPendingJsonRpcResponse=function(d){return(0,o.is)(d,t.PendingJsonRpcResponseStruct)},t.assertIsPendingJsonRpcResponse=function(d,p){(0,c.assertStruct)(d,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",p)},t.isJsonRpcResponse=function(d){return(0,o.is)(d,t.JsonRpcResponseStruct)},t.assertIsJsonRpcResponse=function(d,p){(0,c.assertStruct)(d,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",p)},t.isJsonRpcSuccess=function(d){return(0,o.is)(d,t.JsonRpcSuccessStruct)},t.assertIsJsonRpcSuccess=function(d,p){(0,c.assertStruct)(d,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",p)},t.isJsonRpcFailure=function(d){return(0,o.is)(d,t.JsonRpcFailureStruct)},t.assertIsJsonRpcFailure=function(d,p){(0,c.assertStruct)(d,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",p)},t.isJsonRpcError=function(d){return(0,o.is)(d,t.JsonRpcErrorStruct)},t.assertIsJsonRpcError=function(d,p){(0,c.assertStruct)(d,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",p)},t.getJsonRpcIdValidator=function(d){const{permitEmptyString:p,permitFractions:s,permitNull:e}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},d);return i=>Boolean("number"==typeof i&&(s||Number.isInteger(i))||"string"==typeof i&&(p||i.length>0)||e&&null===i)}},3732:(C,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},160:function(C,t,n){"use strict";var o=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.createProjectLogger=void 0;const c=(0,o(n(1227)).default)("metamask");t.createProjectLogger=function(d){return c.extend(d)},t.createModuleLogger=function(d,p){return d.extend(p)}},6215:(C,t)=>{"use strict";function n(c){return c.charCodeAt(0)<=127}var o;Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0,t.isNonEmptyArray=function(c){return Array.isArray(c)&&c.length>0},t.isNullOrUndefined=function(c){return null==c},t.isObject=function(c){return Boolean(c)&&"object"==typeof c&&!Array.isArray(c)},t.hasProperty=(c,d)=>Object.hasOwnProperty.call(c,d),(o=t.JsonSize||(t.JsonSize={}))[o.Null=4]="Null",o[o.Comma=1]="Comma",o[o.Wrapper=1]="Wrapper",o[o.True=4]="True",o[o.False=5]="False",o[o.Quote=1]="Quote",o[o.Colon=1]="Colon",o[o.Date=24]="Date",t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,t.isPlainObject=function(c){if("object"!=typeof c||null===c)return!1;try{let d=c;for(;null!==Object.getPrototypeOf(d);)d=Object.getPrototypeOf(d);return Object.getPrototypeOf(c)===d}catch{return!1}},t.isASCII=n,t.calculateStringSize=function(c){var d;return c.split("").reduce((p,s)=>n(s)?p+1:p+2,0)+(null!==(d=c.match(t.ESCAPE_CHARACTERS_REGEXP))&&void 0!==d?d:[]).length},t.calculateNumberSize=function(c){return c.toString().length}},9679:(C,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBigInt=t.hexToNumber=t.bigIntToHex=t.numberToHex=void 0;const o=n(1422),c=n(2009);t.numberToHex=d=>((0,o.assert)("number"==typeof d,"Value must be a number."),(0,o.assert)(d>=0,"Value must be a non-negative number."),(0,o.assert)(Number.isSafeInteger(d),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,c.add0x)(d.toString(16))),t.bigIntToHex=d=>((0,o.assert)("bigint"==typeof d,"Value must be a bigint."),(0,o.assert)(d>=0,"Value must be a non-negative bigint."),(0,c.add0x)(d.toString(16))),t.hexToNumber=d=>{(0,c.assertIsHexString)(d);const p=parseInt(d,16);return(0,o.assert)(Number.isSafeInteger(p),"Value is not a safe integer. Use `hexToBigInt` instead."),p},t.hexToBigInt=d=>((0,c.assertIsHexString)(d),BigInt((0,c.add0x)(d)))},9108:(C,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7772:(C,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,(n=t.Duration||(t.Duration={}))[n.Millisecond=1]="Millisecond",n[n.Second=1e3]="Second",n[n.Minute=6e4]="Minute",n[n.Hour=36e5]="Hour",n[n.Day=864e5]="Day",n[n.Week=6048e5]="Week",n[n.Year=31536e6]="Year";const o=(c,d)=>{if(p=c,!(Number.isInteger(p)&&p>=0))throw new Error(`"${d}" must be a non-negative integer. Received: "${c}".`);var p};t.inMilliseconds=function(c,d){return o(c,"count"),c*d},t.timeSince=function(c){return o(c,"timestamp"),Date.now()-c}},7749:(C,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8426:(C,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const o=n(5393),c=n(7884),d=n(1422);t.VersionStruct=(0,c.refine)((0,c.string)(),"Version",p=>null!==(0,o.valid)(p)||`Expected SemVer version, got "${p}"`),t.VersionRangeStruct=(0,c.refine)((0,c.string)(),"Version range",p=>null!==(0,o.validRange)(p)||`Expected SemVer range, got "${p}"`),t.isValidSemVerVersion=function(p){return(0,c.is)(p,t.VersionStruct)},t.isValidSemVerRange=function(p){return(0,c.is)(p,t.VersionRangeStruct)},t.assertIsSemVerVersion=function(p){(0,d.assertStruct)(p,t.VersionStruct)},t.assertIsSemVerRange=function(p){(0,d.assertStruct)(p,t.VersionRangeStruct)},t.gtVersion=function(p,s){return(0,o.gt)(p,s)},t.gtRange=function(p,s){return(0,o.gtr)(p,s)},t.satisfiesVersionRange=function(p,s){return(0,o.satisfies)(p,s,{includePrerelease:!0})}},3066:(C,t,n)=>{"use strict";const o=n(4403),c=Symbol("max"),d=Symbol("length"),p=Symbol("lengthCalculator"),s=Symbol("allowStale"),e=Symbol("maxAge"),i=Symbol("dispose"),a=Symbol("noDisposeOnSet"),y=Symbol("lruList"),b=Symbol("cache"),g=Symbol("updateAgeOnGet"),E=()=>1,A=(I,k,F)=>{const G=I[b].get(k);if(G){const B=G.value;if(v(I,B)){if(P(I,G),!I[s])return}else F&&(I[g]&&(G.value.now=Date.now()),I[y].unshiftNode(G));return B.value}},v=(I,k)=>{if(!k||!k.maxAge&&!I[e])return!1;const F=Date.now()-k.now;return k.maxAge?F>k.maxAge:I[e]&&F>I[e]},_=I=>{if(I[d]>I[c])for(let k=I[y].tail;I[d]>I[c]&&null!==k;){const F=k.prev;P(I,k),k=F}},P=(I,k)=>{if(k){const F=k.value;I[i]&&I[i](F.key,F.value),I[d]-=F.length,I[b].delete(F.key),I[y].removeNode(k)}};class O{constructor(k,F,G,B,T){this.key=k,this.value=F,this.length=G,this.now=B,this.maxAge=T||0}}const L=(I,k,F,G)=>{let B=F.value;v(I,B)&&(P(I,F),I[s]||(B=void 0)),B&&k.call(G,B.value,B.key,I)};C.exports=class{constructor(I){if("number"==typeof I&&(I={max:I}),I||(I={}),I.max&&("number"!=typeof I.max||I.max<0))throw new TypeError("max must be a non-negative number");this[c]=I.max||1/0;const k=I.length||E;if(this[p]="function"!=typeof k?E:k,this[s]=I.stale||!1,I.maxAge&&"number"!=typeof I.maxAge)throw new TypeError("maxAge must be a number");this[e]=I.maxAge||0,this[i]=I.dispose,this[a]=I.noDisposeOnSet||!1,this[g]=I.updateAgeOnGet||!1,this.reset()}set max(I){if("number"!=typeof I||I<0)throw new TypeError("max must be a non-negative number");this[c]=I||1/0,_(this)}get max(){return this[c]}set allowStale(I){this[s]=!!I}get allowStale(){return this[s]}set maxAge(I){if("number"!=typeof I)throw new TypeError("maxAge must be a non-negative number");this[e]=I,_(this)}get maxAge(){return this[e]}set lengthCalculator(I){"function"!=typeof I&&(I=E),I!==this[p]&&(this[p]=I,this[d]=0,this[y].forEach(k=>{k.length=this[p](k.value,k.key),this[d]+=k.length})),_(this)}get lengthCalculator(){return this[p]}get length(){return this[d]}get itemCount(){return this[y].length}rforEach(I,k){k=k||this;for(let F=this[y].tail;null!==F;){const G=F.prev;L(this,I,F,k),F=G}}forEach(I,k){k=k||this;for(let F=this[y].head;null!==F;){const G=F.next;L(this,I,F,k),F=G}}keys(){return this[y].toArray().map(I=>I.key)}values(){return this[y].toArray().map(I=>I.value)}reset(){this[i]&&this[y]&&this[y].length&&this[y].forEach(I=>this[i](I.key,I.value)),this[b]=new Map,this[y]=new o,this[d]=0}dump(){return this[y].map(I=>!v(this,I)&&{k:I.key,v:I.value,e:I.now+(I.maxAge||0)}).toArray().filter(I=>I)}dumpLru(){return this[y]}set(I,k,F){if((F=F||this[e])&&"number"!=typeof F)throw new TypeError("maxAge must be a number");const G=F?Date.now():0,B=this[p](k,I);if(this[b].has(I)){if(B>this[c])return P(this,this[b].get(I)),!1;const Q=this[b].get(I).value;return this[i]&&(this[a]||this[i](I,Q.value)),Q.now=G,Q.maxAge=F,Q.value=k,this[d]+=B-Q.length,Q.length=B,this.get(I),_(this),!0}const T=new O(I,k,B,G,F);return T.length>this[c]?(this[i]&&this[i](I,k),!1):(this[d]+=T.length,this[y].unshift(T),this[b].set(I,this[y].head),_(this),!0)}has(I){if(!this[b].has(I))return!1;const k=this[b].get(I).value;return!v(this,k)}get(I){return A(this,I,!0)}peek(I){return A(this,I,!1)}pop(){const I=this[y].tail;return I?(P(this,I),I.value):null}del(I){P(this,this[b].get(I))}load(I){this.reset();const k=Date.now();for(let F=I.length-1;F>=0;F--){const G=I[F],B=G.e||0;if(0===B)this.set(G.k,G.v);else{const T=B-k;T>0&&this.set(G.k,G.v,T)}}}prune(){this[b].forEach((I,k)=>A(this,k,!1))}}},7809:(C,t,n)=>{const o=Symbol("SemVer ANY");class c{static get ANY(){return o}constructor(g,E){if(E=d(E),g instanceof c){if(g.loose===!!E.loose)return g;g=g.value}g=g.trim().split(/\s+/).join(" "),i("comparator",g,E),this.options=E,this.loose=!!E.loose,this.parse(g),this.value=this.semver===o?"":this.operator+this.semver.version,i("comp",this)}parse(g){const A=g.match(this.options.loose?p[s.COMPARATORLOOSE]:p[s.COMPARATOR]);if(!A)throw new TypeError(`Invalid comparator: ${g}`);this.operator=void 0!==A[1]?A[1]:"","="===this.operator&&(this.operator=""),this.semver=A[2]?new a(A[2],this.options.loose):o}toString(){return this.value}test(g){if(i("Comparator.test",g,this.options.loose),this.semver===o||g===o)return!0;if("string"==typeof g)try{g=new a(g,this.options)}catch{return!1}return e(g,this.operator,this.semver,this.options)}intersects(g,E){if(!(g instanceof c))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new y(g.value,E).test(this.value):""===g.operator?""===g.value||new y(this.value,E).test(g.semver):!((E=d(E)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===g.value)||!E.includePrerelease&&(this.value.startsWith("<0.0.0")||g.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!g.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!g.operator.startsWith("<"))&&(this.semver.version!==g.semver.version||!this.operator.includes("=")||!g.operator.includes("="))&&!(e(this.semver,"<",g.semver,E)&&this.operator.startsWith(">")&&g.operator.startsWith("<"))&&!(e(this.semver,">",g.semver,E)&&this.operator.startsWith("<")&&g.operator.startsWith(">")))}}C.exports=c;const d=n(3459),{safeRe:p,t:s}=n(8416),e=n(2928),i=n(2494),a=n(808),y=n(5579)},5579:(C,t,n)=>{class o{constructor(U,ie){if(ie=d(ie),U instanceof o)return U.loose===!!ie.loose&&U.includePrerelease===!!ie.includePrerelease?U:new o(U.raw,ie);if(U instanceof p)return this.raw=U.value,this.set=[[U]],this.format(),this;if(this.options=ie,this.loose=!!ie.loose,this.includePrerelease=!!ie.includePrerelease,this.raw=U.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(K=>this.parseRange(K)).filter(K=>K.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const K=this.set[0];if(this.set=this.set.filter(X=>!v(X[0])),0===this.set.length)this.set=[K];else if(this.set.length>1)for(const X of this.set)if(1===X.length&&_(X[0])){this.set=[X];break}}this.format()}format(){return this.range=this.set.map(U=>U.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(U){const ie=((this.options.includePrerelease&&E)|(this.options.loose&&A))+":"+U,K=c.get(ie);if(K)return K;const X=this.options.loose;U=U.replace(X?i[a.HYPHENRANGELOOSE]:i[a.HYPHENRANGE],ge(this.options.includePrerelease)),s("hyphen replace",U),U=U.replace(i[a.COMPARATORTRIM],y),s("comparator trim",U);let ee=(U=(U=U.replace(i[a.TILDETRIM],b)).replace(i[a.CARETTRIM],g)).split(" ").map(se=>O(se,this.options)).join(" ").split(/\s+/).map(se=>D(se,this.options));X&&(ee=ee.filter(se=>(s("loose invalid filter",se,this.options),!!se.match(i[a.COMPARATORLOOSE])))),s("range list",ee);const Z=new Map,W=ee.map(se=>new p(se,this.options));for(const se of W){if(v(se))return[se];Z.set(se.value,se)}Z.size>1&&Z.has("")&&Z.delete("");const ue=[...Z.values()];return c.set(ie,ue),ue}intersects(U,ie){if(!(U instanceof o))throw new TypeError("a Range is required");return this.set.some(K=>P(K,ie)&&U.set.some(X=>P(X,ie)&&K.every(te=>X.every(ee=>te.intersects(ee,ie)))))}test(U){if(!U)return!1;if("string"==typeof U)try{U=new e(U,this.options)}catch{return!1}for(let ie=0;ie"<0.0.0-0"===re.value,_=re=>""===re.value,P=(re,U)=>{let ie=!0;const K=re.slice();let X=K.pop();for(;ie&&K.length;)ie=K.every(te=>X.intersects(te,U)),X=K.pop();return ie},O=(re,U)=>(s("comp",re,U),re=F(re,U),s("caret",re),re=I(re,U),s("tildes",re),re=B(re,U),s("xrange",re),re=Q(re,U),s("stars",re),re),L=re=>!re||"x"===re.toLowerCase()||"*"===re,I=(re,U)=>re.trim().split(/\s+/).map(ie=>k(ie,U)).join(" "),k=(re,U)=>re.replace(U.loose?i[a.TILDELOOSE]:i[a.TILDE],(K,X,te,ee,Z)=>{let W;return s("tilde",re,K,X,te,ee,Z),L(X)?W="":L(te)?W=`>=${X}.0.0 <${+X+1}.0.0-0`:L(ee)?W=`>=${X}.${te}.0 <${X}.${+te+1}.0-0`:Z?(s("replaceTilde pr",Z),W=`>=${X}.${te}.${ee}-${Z} <${X}.${+te+1}.0-0`):W=`>=${X}.${te}.${ee} <${X}.${+te+1}.0-0`,s("tilde return",W),W}),F=(re,U)=>re.trim().split(/\s+/).map(ie=>G(ie,U)).join(" "),G=(re,U)=>{s("caret",re,U);const K=U.includePrerelease?"-0":"";return re.replace(U.loose?i[a.CARETLOOSE]:i[a.CARET],(X,te,ee,Z,W)=>{let ue;return s("caret",re,X,te,ee,Z,W),L(te)?ue="":L(ee)?ue=`>=${te}.0.0${K} <${+te+1}.0.0-0`:L(Z)?ue="0"===te?`>=${te}.${ee}.0${K} <${te}.${+ee+1}.0-0`:`>=${te}.${ee}.0${K} <${+te+1}.0.0-0`:W?(s("replaceCaret pr",W),ue="0"===te?"0"===ee?`>=${te}.${ee}.${Z}-${W} <${te}.${ee}.${+Z+1}-0`:`>=${te}.${ee}.${Z}-${W} <${te}.${+ee+1}.0-0`:`>=${te}.${ee}.${Z}-${W} <${+te+1}.0.0-0`):(s("no pr"),ue="0"===te?"0"===ee?`>=${te}.${ee}.${Z}${K} <${te}.${ee}.${+Z+1}-0`:`>=${te}.${ee}.${Z}${K} <${te}.${+ee+1}.0-0`:`>=${te}.${ee}.${Z} <${+te+1}.0.0-0`),s("caret return",ue),ue})},B=(re,U)=>(s("replaceXRanges",re,U),re.split(/\s+/).map(ie=>T(ie,U)).join(" ")),T=(re,U)=>(re=re.trim()).replace(U.loose?i[a.XRANGELOOSE]:i[a.XRANGE],(K,X,te,ee,Z,W)=>{s("xRange",re,K,X,te,ee,Z,W);const ue=L(te),se=ue||L(ee),me=se||L(Z);return"="===X&&me&&(X=""),W=U.includePrerelease?"-0":"",ue?K=">"===X||"<"===X?"<0.0.0-0":"*":X&&me?(se&&(ee=0),Z=0,">"===X?(X=">=",se?(te=+te+1,ee=0,Z=0):(ee=+ee+1,Z=0)):"<="===X&&(X="<",se?te=+te+1:ee=+ee+1),"<"===X&&(W="-0"),K=`${X+te}.${ee}.${Z}${W}`):se?K=`>=${te}.0.0${W} <${+te+1}.0.0-0`:me&&(K=`>=${te}.${ee}.0${W} <${te}.${+ee+1}.0-0`),s("xRange return",K),K}),Q=(re,U)=>(s("replaceStars",re,U),re.trim().replace(i[a.STAR],"")),D=(re,U)=>(s("replaceGTE0",re,U),re.trim().replace(i[U.includePrerelease?a.GTE0PRE:a.GTE0],"")),ge=re=>(U,ie,K,X,te,ee,Z,W,ue,se,me,ve,Se)=>`${ie=L(K)?"":L(X)?`>=${K}.0.0${re?"-0":""}`:L(te)?`>=${K}.${X}.0${re?"-0":""}`:ee?`>=${ie}`:`>=${ie}${re?"-0":""}`} ${W=L(ue)?"":L(se)?`<${+ue+1}.0.0-0`:L(me)?`<${ue}.${+se+1}.0-0`:ve?`<=${ue}.${se}.${me}-${ve}`:re?`<${ue}.${se}.${+me+1}-0`:`<=${W}`}`.trim(),we=(re,U,ie)=>{for(let K=0;K0){const X=re[K].semver;if(X.major===U.major&&X.minor===U.minor&&X.patch===U.patch)return!0}return!1}return!0}},808:(C,t,n)=>{const o=n(2494),{MAX_LENGTH:c,MAX_SAFE_INTEGER:d}=n(1493),{safeRe:p,t:s}=n(8416),e=n(3459),{compareIdentifiers:i}=n(9417);class a{constructor(b,g){if(g=e(g),b instanceof a){if(b.loose===!!g.loose&&b.includePrerelease===!!g.includePrerelease)return b;b=b.version}else if("string"!=typeof b)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof b}".`);if(b.length>c)throw new TypeError(`version is longer than ${c} characters`);o("SemVer",b,g),this.options=g,this.loose=!!g.loose,this.includePrerelease=!!g.includePrerelease;const E=b.trim().match(g.loose?p[s.LOOSE]:p[s.FULL]);if(!E)throw new TypeError(`Invalid Version: ${b}`);if(this.raw=b,this.major=+E[1],this.minor=+E[2],this.patch=+E[3],this.major>d||this.major<0)throw new TypeError("Invalid major version");if(this.minor>d||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>d||this.patch<0)throw new TypeError("Invalid patch version");this.prerelease=E[4]?E[4].split(".").map(A=>{if(/^[0-9]+$/.test(A)){const v=+A;if(v>=0&&v=0;)"number"==typeof this.prerelease[v]&&(this.prerelease[v]++,v=-2);if(-1===v){if(g===this.prerelease.join(".")&&!1===E)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(A)}}if(g){let v=[g,A];!1===E&&(v=[g]),0===i(this.prerelease[0],g)?isNaN(this.prerelease[1])&&(this.prerelease=v):this.prerelease=v}break}default:throw new Error(`invalid increment argument: ${b}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}C.exports=a},7321:(C,t,n)=>{const o=n(9706);C.exports=(c,d)=>{const p=o(c.trim().replace(/^[=v]+/,""),d);return p?p.version:null}},2928:(C,t,n)=>{const o=n(6393),c=n(3),d=n(690),p=n(6155),s=n(1675),e=n(8800);C.exports=(i,a,y,b)=>{switch(a){case"===":return"object"==typeof i&&(i=i.version),"object"==typeof y&&(y=y.version),i===y;case"!==":return"object"==typeof i&&(i=i.version),"object"==typeof y&&(y=y.version),i!==y;case"":case"=":case"==":return o(i,y,b);case"!=":return c(i,y,b);case">":return d(i,y,b);case">=":return p(i,y,b);case"<":return s(i,y,b);case"<=":return e(i,y,b);default:throw new TypeError(`Invalid operator: ${a}`)}}},5054:(C,t,n)=>{const o=n(808),c=n(9706),{safeRe:d,t:p}=n(8416);C.exports=(s,e)=>{if(s instanceof o)return s;if("number"==typeof s&&(s=String(s)),"string"!=typeof s)return null;let i=null;if((e=e||{}).rtl){let a;for(;(a=d[p.COERCERTL].exec(s))&&(!i||i.index+i[0].length!==s.length);)i&&a.index+a[0].length===i.index+i[0].length||(i=a),d[p.COERCERTL].lastIndex=a.index+a[1].length+a[2].length;d[p.COERCERTL].lastIndex=-1}else i=s.match(d[p.COERCE]);return null===i?null:c(`${i[2]}.${i[3]||"0"}.${i[4]||"0"}`,e)}},9457:(C,t,n)=>{const o=n(808);C.exports=(c,d,p)=>{const s=new o(c,p),e=new o(d,p);return s.compare(e)||s.compareBuild(e)}},8992:(C,t,n)=>{const o=n(6837);C.exports=(c,d)=>o(c,d,!0)},6837:(C,t,n)=>{const o=n(808);C.exports=(c,d,p)=>new o(c,p).compare(new o(d,p))},9603:(C,t,n)=>{const o=n(9706);C.exports=(c,d)=>{const p=o(c,null,!0),s=o(d,null,!0),e=p.compare(s);if(0===e)return null;const i=e>0,a=i?p:s,y=i?s:p,b=!!a.prerelease.length;if(y.prerelease.length&&!b)return y.patch||y.minor?a.patch?"patch":a.minor?"minor":"major":"major";const g=b?"pre":"";return p.major!==s.major?g+"major":p.minor!==s.minor?g+"minor":p.patch!==s.patch?g+"patch":"prerelease"}},6393:(C,t,n)=>{const o=n(6837);C.exports=(c,d,p)=>0===o(c,d,p)},690:(C,t,n)=>{const o=n(6837);C.exports=(c,d,p)=>o(c,d,p)>0},6155:(C,t,n)=>{const o=n(6837);C.exports=(c,d,p)=>o(c,d,p)>=0},624:(C,t,n)=>{const o=n(808);C.exports=(c,d,p,s,e)=>{"string"==typeof p&&(e=s,s=p,p=void 0);try{return new o(c instanceof o?c.version:c,p).inc(d,s,e).version}catch{return null}}},1675:(C,t,n)=>{const o=n(6837);C.exports=(c,d,p)=>o(c,d,p)<0},8800:(C,t,n)=>{const o=n(6837);C.exports=(c,d,p)=>o(c,d,p)<=0},745:(C,t,n)=>{const o=n(808);C.exports=(c,d)=>new o(c,d).major},1561:(C,t,n)=>{const o=n(808);C.exports=(c,d)=>new o(c,d).minor},3:(C,t,n)=>{const o=n(6837);C.exports=(c,d,p)=>0!==o(c,d,p)},9706:(C,t,n)=>{const o=n(808);C.exports=(c,d,p=!1)=>{if(c instanceof o)return c;try{return new o(c,d)}catch(s){if(!p)return null;throw s}}},8660:(C,t,n)=>{const o=n(808);C.exports=(c,d)=>new o(c,d).patch},7674:(C,t,n)=>{const o=n(9706);C.exports=(c,d)=>{const p=o(c,d);return p&&p.prerelease.length?p.prerelease:null}},3370:(C,t,n)=>{const o=n(6837);C.exports=(c,d,p)=>o(d,c,p)},6646:(C,t,n)=>{const o=n(9457);C.exports=(c,d)=>c.sort((p,s)=>o(s,p,d))},7819:(C,t,n)=>{const o=n(5579);C.exports=(c,d,p)=>{try{d=new o(d,p)}catch{return!1}return d.test(c)}},3124:(C,t,n)=>{const o=n(9457);C.exports=(c,d)=>c.sort((p,s)=>o(p,s,d))},5557:(C,t,n)=>{const o=n(9706);C.exports=(c,d)=>{const p=o(c,d);return p?p.version:null}},5393:(C,t,n)=>{const o=n(8416),c=n(1493),d=n(808),p=n(9417),s=n(9706),e=n(5557),i=n(7321),a=n(624),y=n(9603),b=n(745),g=n(1561),E=n(8660),A=n(7674),v=n(6837),_=n(3370),P=n(8992),O=n(9457),L=n(3124),I=n(6646),k=n(690),F=n(1675),G=n(6393),B=n(3),T=n(6155),Q=n(8800),D=n(2928),ge=n(5054),we=n(7809),re=n(5579),U=n(7819),ie=n(458),K=n(6449),X=n(1940),te=n(442),ee=n(7677),Z=n(9455),W=n(7922),ue=n(3670),se=n(451),me=n(4501),ve=n(4854);C.exports={parse:s,valid:e,clean:i,inc:a,diff:y,major:b,minor:g,patch:E,prerelease:A,compare:v,rcompare:_,compareLoose:P,compareBuild:O,sort:L,rsort:I,gt:k,lt:F,eq:G,neq:B,gte:T,lte:Q,cmp:D,coerce:ge,Comparator:we,Range:re,satisfies:U,toComparators:ie,maxSatisfying:K,minSatisfying:X,minVersion:te,validRange:ee,outside:Z,gtr:W,ltr:ue,intersects:se,simplifyRange:me,subset:ve,SemVer:d,re:o.re,src:o.src,tokens:o.t,SEMVER_SPEC_VERSION:c.SEMVER_SPEC_VERSION,RELEASE_TYPES:c.RELEASE_TYPES,compareIdentifiers:p.compareIdentifiers,rcompareIdentifiers:p.rcompareIdentifiers}},1493:C=>{C.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},2494:(C,t,n)=>{var o=n(4155);const c="object"==typeof o&&o.env&&o.env.NODE_DEBUG&&/\bsemver\b/i.test(o.env.NODE_DEBUG)?(...d)=>console.error("SEMVER",...d):()=>{};C.exports=c},9417:C=>{const t=/^[0-9]+$/,n=(o,c)=>{const d=t.test(o),p=t.test(c);return d&&p&&(o=+o,c=+c),o===c?0:d&&!p?-1:p&&!d?1:on(c,o)}},3459:C=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});C.exports=o=>o?"object"!=typeof o?t:o:n},8416:(C,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:o}=n(1493),c=n(2494),d=(t=C.exports={}).re=[],p=t.safeRe=[],s=t.src=[],e=t.t={};let i=0;const a=(y,b,g)=>{const E=b.split("\\s*").join("\\s{0,1}").split("\\s+").join("\\s"),A=i++;c(y,A,b),e[y]=A,s[A]=b,d[A]=new RegExp(b,g?"g":void 0),p[A]=new RegExp(E,g?"g":void 0)};a("NUMERICIDENTIFIER","0|[1-9]\\d*"),a("NUMERICIDENTIFIERLOOSE","[0-9]+"),a("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),a("MAINVERSION",`(${s[e.NUMERICIDENTIFIER]})\\.(${s[e.NUMERICIDENTIFIER]})\\.(${s[e.NUMERICIDENTIFIER]})`),a("MAINVERSIONLOOSE",`(${s[e.NUMERICIDENTIFIERLOOSE]})\\.(${s[e.NUMERICIDENTIFIERLOOSE]})\\.(${s[e.NUMERICIDENTIFIERLOOSE]})`),a("PRERELEASEIDENTIFIER",`(?:${s[e.NUMERICIDENTIFIER]}|${s[e.NONNUMERICIDENTIFIER]})`),a("PRERELEASEIDENTIFIERLOOSE",`(?:${s[e.NUMERICIDENTIFIERLOOSE]}|${s[e.NONNUMERICIDENTIFIER]})`),a("PRERELEASE",`(?:-(${s[e.PRERELEASEIDENTIFIER]}(?:\\.${s[e.PRERELEASEIDENTIFIER]})*))`),a("PRERELEASELOOSE",`(?:-?(${s[e.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[e.PRERELEASEIDENTIFIERLOOSE]})*))`),a("BUILDIDENTIFIER","[0-9A-Za-z-]+"),a("BUILD",`(?:\\+(${s[e.BUILDIDENTIFIER]}(?:\\.${s[e.BUILDIDENTIFIER]})*))`),a("FULLPLAIN",`v?${s[e.MAINVERSION]}${s[e.PRERELEASE]}?${s[e.BUILD]}?`),a("FULL",`^${s[e.FULLPLAIN]}$`),a("LOOSEPLAIN",`[v=\\s]*${s[e.MAINVERSIONLOOSE]}${s[e.PRERELEASELOOSE]}?${s[e.BUILD]}?`),a("LOOSE",`^${s[e.LOOSEPLAIN]}$`),a("GTLT","((?:<|>)?=?)"),a("XRANGEIDENTIFIERLOOSE",`${s[e.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),a("XRANGEIDENTIFIER",`${s[e.NUMERICIDENTIFIER]}|x|X|\\*`),a("XRANGEPLAIN",`[v=\\s]*(${s[e.XRANGEIDENTIFIER]})(?:\\.(${s[e.XRANGEIDENTIFIER]})(?:\\.(${s[e.XRANGEIDENTIFIER]})(?:${s[e.PRERELEASE]})?${s[e.BUILD]}?)?)?`),a("XRANGEPLAINLOOSE",`[v=\\s]*(${s[e.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[e.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[e.XRANGEIDENTIFIERLOOSE]})(?:${s[e.PRERELEASELOOSE]})?${s[e.BUILD]}?)?)?`),a("XRANGE",`^${s[e.GTLT]}\\s*${s[e.XRANGEPLAIN]}$`),a("XRANGELOOSE",`^${s[e.GTLT]}\\s*${s[e.XRANGEPLAINLOOSE]}$`),a("COERCE",`(^|[^\\d])(\\d{1,${o}})(?:\\.(\\d{1,${o}}))?(?:\\.(\\d{1,${o}}))?(?:$|[^\\d])`),a("COERCERTL",s[e.COERCE],!0),a("LONETILDE","(?:~>?)"),a("TILDETRIM",`(\\s*)${s[e.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",a("TILDE",`^${s[e.LONETILDE]}${s[e.XRANGEPLAIN]}$`),a("TILDELOOSE",`^${s[e.LONETILDE]}${s[e.XRANGEPLAINLOOSE]}$`),a("LONECARET","(?:\\^)"),a("CARETTRIM",`(\\s*)${s[e.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",a("CARET",`^${s[e.LONECARET]}${s[e.XRANGEPLAIN]}$`),a("CARETLOOSE",`^${s[e.LONECARET]}${s[e.XRANGEPLAINLOOSE]}$`),a("COMPARATORLOOSE",`^${s[e.GTLT]}\\s*(${s[e.LOOSEPLAIN]})$|^$`),a("COMPARATOR",`^${s[e.GTLT]}\\s*(${s[e.FULLPLAIN]})$|^$`),a("COMPARATORTRIM",`(\\s*)${s[e.GTLT]}\\s*(${s[e.LOOSEPLAIN]}|${s[e.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",a("HYPHENRANGE",`^\\s*(${s[e.XRANGEPLAIN]})\\s+-\\s+(${s[e.XRANGEPLAIN]})\\s*$`),a("HYPHENRANGELOOSE",`^\\s*(${s[e.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[e.XRANGEPLAINLOOSE]})\\s*$`),a("STAR","(<|>)?=?\\s*\\*"),a("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),a("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},7922:(C,t,n)=>{const o=n(9455);C.exports=(c,d,p)=>o(c,d,">",p)},451:(C,t,n)=>{const o=n(5579);C.exports=(c,d,p)=>(c=new o(c,p),d=new o(d,p),c.intersects(d,p))},3670:(C,t,n)=>{const o=n(9455);C.exports=(c,d,p)=>o(c,d,"<",p)},6449:(C,t,n)=>{const o=n(808),c=n(5579);C.exports=(d,p,s)=>{let e=null,i=null,a=null;try{a=new c(p,s)}catch{return null}return d.forEach(y=>{a.test(y)&&(e&&-1!==i.compare(y)||(e=y,i=new o(e,s)))}),e}},1940:(C,t,n)=>{const o=n(808),c=n(5579);C.exports=(d,p,s)=>{let e=null,i=null,a=null;try{a=new c(p,s)}catch{return null}return d.forEach(y=>{a.test(y)&&(e&&1!==i.compare(y)||(e=y,i=new o(e,s)))}),e}},442:(C,t,n)=>{const o=n(808),c=n(5579),d=n(690);C.exports=(p,s)=>{p=new c(p,s);let e=new o("0.0.0");if(p.test(e)||(e=new o("0.0.0-0"),p.test(e)))return e;e=null;for(let i=0;i{const g=new o(b.semver.version);switch(b.operator){case">":0===g.prerelease.length?g.patch++:g.prerelease.push(0),g.raw=g.format();case"":case">=":y&&!d(g,y)||(y=g);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${b.operator}`)}}),!y||e&&!d(e,y)||(e=y)}return e&&p.test(e)?e:null}},9455:(C,t,n)=>{const o=n(808),c=n(7809),{ANY:d}=c,p=n(5579),s=n(7819),e=n(690),i=n(1675),a=n(8800),y=n(6155);C.exports=(b,g,E,A)=>{let v,_,P,O,L;switch(b=new o(b,A),g=new p(g,A),E){case">":v=e,_=a,P=i,O=">",L=">=";break;case"<":v=i,_=y,P=e,O="<",L="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(b,g,A))return!1;for(let I=0;I{B.semver===d&&(B=new c(">=0.0.0")),F=F||B,G=G||B,v(B.semver,F.semver,A)?F=B:P(B.semver,G.semver,A)&&(G=B)}),F.operator===O||F.operator===L||(!G.operator||G.operator===O)&&_(b,G.semver)||G.operator===L&&P(b,G.semver))return!1}return!0}},4501:(C,t,n)=>{const o=n(7819),c=n(6837);C.exports=(d,p,s)=>{const e=[];let i=null,a=null;const y=d.sort((A,v)=>c(A,v,s));for(const A of y)o(A,p,s)?(a=A,i||(i=A)):(a&&e.push([i,a]),a=null,i=null);i&&e.push([i,null]);const b=[];for(const[A,v]of e)b.push(A===v?A:v||A!==y[0]?v?A===y[0]?`<=${v}`:`${A} - ${v}`:`>=${A}`:"*");const g=b.join(" || "),E="string"==typeof p.raw?p.raw:String(p);return g.length{const o=n(5579),c=n(7809),{ANY:d}=c,p=n(7819),s=n(6837),e=[new c(">=0.0.0-0")],i=[new c(">=0.0.0")],a=(g,E,A)=>{if(g===E)return!0;if(1===g.length&&g[0].semver===d){if(1===E.length&&E[0].semver===d)return!0;g=A.includePrerelease?e:i}if(1===E.length&&E[0].semver===d){if(A.includePrerelease)return!0;E=i}const v=new Set;let _,P,O,L,I,k,F;for(const T of g)">"===T.operator||">="===T.operator?_=y(_,T,A):"<"===T.operator||"<="===T.operator?P=b(P,T,A):v.add(T.semver);if(v.size>1||_&&P&&(O=s(_.semver,P.semver,A),O>0||0===O&&(">="!==_.operator||"<="!==P.operator)))return null;for(const T of v){if(_&&!p(T,String(_),A)||P&&!p(T,String(P),A))return null;for(const Q of E)if(!p(T,String(Q),A))return!1;return!0}let G=!(!P||A.includePrerelease||!P.semver.prerelease.length)&&P.semver,B=!(!_||A.includePrerelease||!_.semver.prerelease.length)&&_.semver;G&&1===G.prerelease.length&&"<"===P.operator&&0===G.prerelease[0]&&(G=!1);for(const T of E){if(F=F||">"===T.operator||">="===T.operator,k=k||"<"===T.operator||"<="===T.operator,_)if(B&&T.semver.prerelease&&T.semver.prerelease.length&&T.semver.major===B.major&&T.semver.minor===B.minor&&T.semver.patch===B.patch&&(B=!1),">"===T.operator||">="===T.operator){if(L=y(_,T,A),L===T&&L!==_)return!1}else if(">="===_.operator&&!p(_.semver,String(T),A))return!1;if(P)if(G&&T.semver.prerelease&&T.semver.prerelease.length&&T.semver.major===G.major&&T.semver.minor===G.minor&&T.semver.patch===G.patch&&(G=!1),"<"===T.operator||"<="===T.operator){if(I=b(P,T,A),I===T&&I!==P)return!1}else if("<="===P.operator&&!p(P.semver,String(T),A))return!1;if(!T.operator&&(P||_)&&0!==O)return!1}return!(_&&k&&!P&&0!==O||P&&F&&!_&&0!==O||B||G)},y=(g,E,A)=>{if(!g)return E;const v=s(g.semver,E.semver,A);return v>0?g:v<0||">"===E.operator&&">="===g.operator?E:g},b=(g,E,A)=>{if(!g)return E;const v=s(g.semver,E.semver,A);return v<0?g:v>0||"<"===E.operator&&"<="===g.operator?E:g};C.exports=(g,E,A={})=>{if(g===E)return!0;g=new o(g,A),E=new o(E,A);let v=!1;e:for(const _ of g.set){for(const P of E.set){const O=a(_,P,A);if(v=v||null!==O,O)continue e}if(v)return!1}return!0}},458:(C,t,n)=>{const o=n(5579);C.exports=(c,d)=>new o(c,d).set.map(p=>p.map(s=>s.value).join(" ").trim().split(" "))},7677:(C,t,n)=>{const o=n(5579);C.exports=(c,d)=>{try{return new o(c,d).range||"*"}catch{return null}}},9332:C=>{"use strict";C.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let n=this.head;n;n=n.next)yield n.value}}},4403:(C,t,n)=>{"use strict";function o(e){var i=this;if(i instanceof o||(i=new o),i.tail=null,i.head=null,i.length=0,e&&"function"==typeof e.forEach)e.forEach(function(b){i.push(b)});else if(arguments.length>0)for(var a=0,y=arguments.length;a1)a=i;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");y=this.head.next,a=this.head.value}for(var b=0;null!==y;b++)a=e(a,y.value,b),y=y.next;return a},o.prototype.reduceReverse=function(e,i){var a,y=this.tail;if(arguments.length>1)a=i;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");y=this.tail.prev,a=this.tail.value}for(var b=this.length-1;null!==y;b--)a=e(a,y.value,b),y=y.prev;return a},o.prototype.toArray=function(){for(var e=new Array(this.length),i=0,a=this.head;null!==a;i++)e[i]=a.value,a=a.next;return e},o.prototype.toArrayReverse=function(){for(var e=new Array(this.length),i=0,a=this.tail;null!==a;i++)e[i]=a.value,a=a.prev;return e},o.prototype.slice=function(e,i){(i=i||this.length)<0&&(i+=this.length),(e=e||0)<0&&(e+=this.length);var a=new o;if(ithis.length&&(i=this.length);for(var y=0,b=this.head;null!==b&&ythis.length&&(i=this.length);for(var y=this.length,b=this.tail;null!==b&&y>i;y--)b=b.prev;for(;null!==b&&y>e;y--,b=b.prev)a.push(b.value);return a},o.prototype.splice=function(e,i,...a){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var y=0,b=this.head;null!==b&&y{"use strict";const{AbortController:t,AbortSignal:n}=typeof self<"u"?self:typeof window<"u"?window:void 0;C.exports=t,C.exports.AbortSignal=n,C.exports.default=t},9742:(C,t)=>{"use strict";t.byteLength=function(i){var a=s(i),b=a[1];return 3*(a[0]+b)/4-b},t.toByteArray=function(i){var a,y,L,b=s(i),g=b[0],E=b[1],A=new c(3*(g+(L=E))/4-L),v=0,_=E>0?g-4:g;for(y=0;y<_;y+=4)a=o[i.charCodeAt(y)]<<18|o[i.charCodeAt(y+1)]<<12|o[i.charCodeAt(y+2)]<<6|o[i.charCodeAt(y+3)],A[v++]=a>>16&255,A[v++]=a>>8&255,A[v++]=255&a;return 2===E&&(a=o[i.charCodeAt(y)]<<2|o[i.charCodeAt(y+1)]>>4,A[v++]=255&a),1===E&&(a=o[i.charCodeAt(y)]<<10|o[i.charCodeAt(y+1)]<<4|o[i.charCodeAt(y+2)]>>2,A[v++]=a>>8&255,A[v++]=255&a),A},t.fromByteArray=function(i){for(var a,y=i.length,b=y%3,g=[],E=16383,A=0,v=y-b;Av?v:A+E));return 1===b?g.push(n[(a=i[y-1])>>2]+n[a<<4&63]+"=="):2===b&&g.push(n[(a=(i[y-2]<<8)+i[y-1])>>10]+n[a>>4&63]+n[a<<2&63]+"="),g.join("")};for(var n=[],o=[],c=typeof Uint8Array<"u"?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0;p<64;++p)n[p]=d[p],o[d.charCodeAt(p)]=p;function s(i){var a=i.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=i.indexOf("=");return-1===y&&(y=a),[y,y===a?0:4-y%4]}function e(i,a,y){for(var g,E=[],A=a;A>18&63]+n[g>>12&63]+n[g>>6&63]+n[63&g]);return E.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},8764:(C,t,n)=>{"use strict";const o=n(9742),c=n(645),d="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=e,t.SlowBuffer=function(r){return+r!=r&&(r=0),e.alloc(+r)},t.INSPECT_MAX_BYTES=50;const p=2147483647;function s(r){if(r>p)throw new RangeError('The value "'+r+'" is invalid for option "size"');const l=new Uint8Array(r);return Object.setPrototypeOf(l,e.prototype),l}function e(r,l,h){if("number"==typeof r){if("string"==typeof l)throw new TypeError('The "string" argument must be of type string. Received type number');return y(r)}return i(r,l,h)}function i(r,l,h){if("string"==typeof r)return function(m,V){if("string"==typeof V&&""!==V||(V="utf8"),!e.isEncoding(V))throw new TypeError("Unknown encoding: "+V);const S=0|A(m,V);let N=s(S);const j=N.write(m,V);return j!==S&&(N=N.slice(0,j)),N}(r,l);if(ArrayBuffer.isView(r))return function(m){if($(m,Uint8Array)){const V=new Uint8Array(m);return g(V.buffer,V.byteOffset,V.byteLength)}return b(m)}(r);if(null==r)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if($(r,ArrayBuffer)||r&&$(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($(r,SharedArrayBuffer)||r&&$(r.buffer,SharedArrayBuffer)))return g(r,l,h);if("number"==typeof r)throw new TypeError('The "value" argument must not be of type number. Received type number');const M=r.valueOf&&r.valueOf();if(null!=M&&M!==r)return e.from(M,l,h);const f=function(m){if(e.isBuffer(m)){const V=0|E(m.length),S=s(V);return 0===S.length||m.copy(S,0,0,V),S}return void 0!==m.length?"number"!=typeof m.length||z(m.length)?s(0):b(m):"Buffer"===m.type&&Array.isArray(m.data)?b(m.data):void 0}(r);if(f)return f;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof r[Symbol.toPrimitive])return e.from(r[Symbol.toPrimitive]("string"),l,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}function a(r){if("number"!=typeof r)throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function y(r){return a(r),s(r<0?0:0|E(r))}function b(r){const l=r.length<0?0:0|E(r.length),h=s(l);for(let M=0;M=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return 0|r}function A(r,l){if(e.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||$(r,ArrayBuffer))return r.byteLength;if("string"!=typeof r)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const h=r.length,M=arguments.length>2&&!0===arguments[2];if(!M&&0===h)return 0;let f=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return ce(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*h;case"hex":return h>>>1;case"base64":return ye(r).length;default:if(f)return M?-1:ce(r).length;l=(""+l).toLowerCase(),f=!0}}function v(r,l,h){let M=!1;if((void 0===l||l<0)&&(l=0),l>this.length||((void 0===h||h>this.length)&&(h=this.length),h<=0)||(h>>>=0)<=(l>>>=0))return"";for(r||(r="utf8");;)switch(r){case"hex":return we(this,l,h);case"utf8":case"utf-8":return T(this,l,h);case"ascii":return D(this,l,h);case"latin1":case"binary":return ge(this,l,h);case"base64":return B(this,l,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,l,h);default:if(M)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),M=!0}}function _(r,l,h){const M=r[l];r[l]=r[h],r[h]=M}function P(r,l,h,M,f){if(0===r.length)return-1;if("string"==typeof h?(M=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),z(h=+h)&&(h=f?0:r.length-1),h<0&&(h=r.length+h),h>=r.length){if(f)return-1;h=r.length-1}else if(h<0){if(!f)return-1;h=0}if("string"==typeof l&&(l=e.from(l,M)),e.isBuffer(l))return 0===l.length?-1:O(r,l,h,M,f);if("number"==typeof l)return l&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(r,l,h):Uint8Array.prototype.lastIndexOf.call(r,l,h):O(r,[l],h,M,f);throw new TypeError("val must be string, number or Buffer")}function O(r,l,h,M,f){let m,V=1,S=r.length,N=l.length;if(void 0!==M&&("ucs2"===(M=String(M).toLowerCase())||"ucs-2"===M||"utf16le"===M||"utf-16le"===M)){if(r.length<2||l.length<2)return-1;V=2,S/=2,N/=2,h/=2}function j(J,le){return 1===V?J[le]:J.readUInt16BE(le*V)}if(f){let J=-1;for(m=h;mS&&(h=S-N),m=h;m>=0;m--){let J=!0;for(let le=0;lef&&(M=f):M=f;const m=l.length;let V;for(M>m/2&&(M=m/2),V=0;V>8,N=V%256,j.push(N),j.push(S);return j}(l,r.length-h),r,h,M)}function B(r,l,h){return o.fromByteArray(0===l&&h===r.length?r:r.slice(l,h))}function T(r,l,h){h=Math.min(r.length,h);const M=[];let f=l;for(;f239?4:m>223?3:m>191?2:1;if(f+S<=h){let N,j,J,le;switch(S){case 1:m<128&&(V=m);break;case 2:N=r[f+1],128==(192&N)&&(le=(31&m)<<6|63&N,le>127&&(V=le));break;case 3:N=r[f+1],j=r[f+2],128==(192&N)&&128==(192&j)&&(le=(15&m)<<12|(63&N)<<6|63&j,le>2047&&(le<55296||le>57343)&&(V=le));break;case 4:N=r[f+1],j=r[f+2],J=r[f+3],128==(192&N)&&128==(192&j)&&128==(192&J)&&(le=(15&m)<<18|(63&N)<<12|(63&j)<<6|63&J,le>65535&&le<1114112&&(V=le))}}null===V?(V=65533,S=1):V>65535&&(V-=65536,M.push(V>>>10&1023|55296),V=56320|1023&V),M.push(V),f+=S}return function(m){const V=m.length;if(V<=Q)return String.fromCharCode.apply(String,m);let S="",N=0;for(;N"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(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}}),Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}}),e.poolSize=8192,e.from=function(r,l,h){return i(r,l,h)},Object.setPrototypeOf(e.prototype,Uint8Array.prototype),Object.setPrototypeOf(e,Uint8Array),e.alloc=function(r,l,h){return f=l,m=h,a(M=r),M<=0?s(M):void 0!==f?"string"==typeof m?s(M).fill(f,m):s(M).fill(f):s(M);var M,f,m},e.allocUnsafe=function(r){return y(r)},e.allocUnsafeSlow=function(r){return y(r)},e.isBuffer=function(r){return null!=r&&!0===r._isBuffer&&r!==e.prototype},e.compare=function(r,l){if($(r,Uint8Array)&&(r=e.from(r,r.offset,r.byteLength)),$(l,Uint8Array)&&(l=e.from(l,l.offset,l.byteLength)),!e.isBuffer(r)||!e.isBuffer(l))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===l)return 0;let h=r.length,M=l.length;for(let f=0,m=Math.min(h,M);fM.length?(e.isBuffer(m)||(m=e.from(m)),m.copy(M,f)):Uint8Array.prototype.set.call(M,m,f);else{if(!e.isBuffer(m))throw new TypeError('"list" argument must be an Array of Buffers');m.copy(M,f)}f+=m.length}return M},e.byteLength=A,e.prototype._isBuffer=!0,e.prototype.swap16=function(){const r=this.length;if(r%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let l=0;ll&&(r+=" ... "),""},d&&(e.prototype[d]=e.prototype.inspect),e.prototype.compare=function(r,l,h,M,f){if($(r,Uint8Array)&&(r=e.from(r,r.offset,r.byteLength)),!e.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(void 0===l&&(l=0),void 0===h&&(h=r?r.length:0),void 0===M&&(M=0),void 0===f&&(f=this.length),l<0||h>r.length||M<0||f>this.length)throw new RangeError("out of range index");if(M>=f&&l>=h)return 0;if(M>=f)return-1;if(l>=h)return 1;if(this===r)return 0;let m=(f>>>=0)-(M>>>=0),V=(h>>>=0)-(l>>>=0);const S=Math.min(m,V),N=this.slice(M,f),j=r.slice(l,h);for(let J=0;J>>=0,isFinite(h)?(h>>>=0,void 0===M&&(M="utf8")):(M=h,h=void 0)}const f=this.length-l;if((void 0===h||h>f)&&(h=f),r.length>0&&(h<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");let m=!1;for(;;)switch(M){case"hex":return L(this,r,l,h);case"utf8":case"utf-8":return I(this,r,l,h);case"ascii":case"latin1":case"binary":return k(this,r,l,h);case"base64":return F(this,r,l,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,r,l,h);default:if(m)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),m=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const Q=4096;function D(r,l,h){let M="";h=Math.min(r.length,h);for(let f=l;fM)&&(h=M);let f="";for(let m=l;mh)throw new RangeError("Trying to access beyond buffer length")}function ie(r,l,h,M,f,m){if(!e.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>f||lr.length)throw new RangeError("Index out of range")}function K(r,l,h,M,f){me(l,M,f,r,h,7);let m=Number(l&BigInt(4294967295));r[h++]=m,m>>=8,r[h++]=m,m>>=8,r[h++]=m,m>>=8,r[h++]=m;let V=Number(l>>BigInt(32)&BigInt(4294967295));return r[h++]=V,V>>=8,r[h++]=V,V>>=8,r[h++]=V,V>>=8,r[h++]=V,h}function X(r,l,h,M,f){me(l,M,f,r,h,7);let m=Number(l&BigInt(4294967295));r[h+7]=m,m>>=8,r[h+6]=m,m>>=8,r[h+5]=m,m>>=8,r[h+4]=m;let V=Number(l>>BigInt(32)&BigInt(4294967295));return r[h+3]=V,V>>=8,r[h+2]=V,V>>=8,r[h+1]=V,V>>=8,r[h]=V,h+8}function te(r,l,h,M,f,m){if(h+M>r.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function ee(r,l,h,M,f){return l=+l,h>>>=0,f||te(r,0,h,4),c.write(r,l,h,M,23,4),h+4}function Z(r,l,h,M,f){return l=+l,h>>>=0,f||te(r,0,h,8),c.write(r,l,h,M,52,8),h+8}e.prototype.slice=function(r,l){const h=this.length;(r=~~r)<0?(r+=h)<0&&(r=0):r>h&&(r=h),(l=void 0===l?h:~~l)<0?(l+=h)<0&&(l=0):l>h&&(l=h),l>>=0,l>>>=0,h||U(r,l,this.length);let M=this[r],f=1,m=0;for(;++m>>=0,l>>>=0,h||U(r,l,this.length);let M=this[r+--l],f=1;for(;l>0&&(f*=256);)M+=this[r+--l]*f;return M},e.prototype.readUint8=e.prototype.readUInt8=function(r,l){return r>>>=0,l||U(r,1,this.length),this[r]},e.prototype.readUint16LE=e.prototype.readUInt16LE=function(r,l){return r>>>=0,l||U(r,2,this.length),this[r]|this[r+1]<<8},e.prototype.readUint16BE=e.prototype.readUInt16BE=function(r,l){return r>>>=0,l||U(r,2,this.length),this[r]<<8|this[r+1]},e.prototype.readUint32LE=e.prototype.readUInt32LE=function(r,l){return r>>>=0,l||U(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+16777216*this[r+3]},e.prototype.readUint32BE=e.prototype.readUInt32BE=function(r,l){return r>>>=0,l||U(r,4,this.length),16777216*this[r]+(this[r+1]<<16|this[r+2]<<8|this[r+3])},e.prototype.readBigUInt64LE=fe(function(r){ve(r>>>=0,"offset");const l=this[r],h=this[r+7];void 0!==l&&void 0!==h||Se(r,this.length-8);const M=l+256*this[++r]+65536*this[++r]+this[++r]*2**24,f=this[++r]+256*this[++r]+65536*this[++r]+h*2**24;return BigInt(M)+(BigInt(f)<>>=0,"offset");const l=this[r],h=this[r+7];void 0!==l&&void 0!==h||Se(r,this.length-8);const M=l*2**24+65536*this[++r]+256*this[++r]+this[++r],f=this[++r]*2**24+65536*this[++r]+256*this[++r]+h;return(BigInt(M)<>>=0,l>>>=0,h||U(r,l,this.length);let M=this[r],f=1,m=0;for(;++m=f&&(M-=Math.pow(2,8*l)),M},e.prototype.readIntBE=function(r,l,h){r>>>=0,l>>>=0,h||U(r,l,this.length);let M=l,f=1,m=this[r+--M];for(;M>0&&(f*=256);)m+=this[r+--M]*f;return f*=128,m>=f&&(m-=Math.pow(2,8*l)),m},e.prototype.readInt8=function(r,l){return r>>>=0,l||U(r,1,this.length),128&this[r]?-1*(255-this[r]+1):this[r]},e.prototype.readInt16LE=function(r,l){r>>>=0,l||U(r,2,this.length);const h=this[r]|this[r+1]<<8;return 32768&h?4294901760|h:h},e.prototype.readInt16BE=function(r,l){r>>>=0,l||U(r,2,this.length);const h=this[r+1]|this[r]<<8;return 32768&h?4294901760|h:h},e.prototype.readInt32LE=function(r,l){return r>>>=0,l||U(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},e.prototype.readInt32BE=function(r,l){return r>>>=0,l||U(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},e.prototype.readBigInt64LE=fe(function(r){ve(r>>>=0,"offset");const l=this[r],h=this[r+7];return void 0!==l&&void 0!==h||Se(r,this.length-8),(BigInt(this[r+4]+256*this[r+5]+65536*this[r+6]+(h<<24))<>>=0,"offset");const l=this[r],h=this[r+7];void 0!==l&&void 0!==h||Se(r,this.length-8);const M=(l<<24)+65536*this[++r]+256*this[++r]+this[++r];return(BigInt(M)<>>=0,l||U(r,4,this.length),c.read(this,r,!0,23,4)},e.prototype.readFloatBE=function(r,l){return r>>>=0,l||U(r,4,this.length),c.read(this,r,!1,23,4)},e.prototype.readDoubleLE=function(r,l){return r>>>=0,l||U(r,8,this.length),c.read(this,r,!0,52,8)},e.prototype.readDoubleBE=function(r,l){return r>>>=0,l||U(r,8,this.length),c.read(this,r,!1,52,8)},e.prototype.writeUintLE=e.prototype.writeUIntLE=function(r,l,h,M){r=+r,l>>>=0,h>>>=0,M||ie(this,r,l,h,Math.pow(2,8*h)-1,0);let f=1,m=0;for(this[l]=255&r;++m>>=0,h>>>=0,M||ie(this,r,l,h,Math.pow(2,8*h)-1,0);let f=h-1,m=1;for(this[l+f]=255&r;--f>=0&&(m*=256);)this[l+f]=r/m&255;return l+h},e.prototype.writeUint8=e.prototype.writeUInt8=function(r,l,h){return r=+r,l>>>=0,h||ie(this,r,l,1,255,0),this[l]=255&r,l+1},e.prototype.writeUint16LE=e.prototype.writeUInt16LE=function(r,l,h){return r=+r,l>>>=0,h||ie(this,r,l,2,65535,0),this[l]=255&r,this[l+1]=r>>>8,l+2},e.prototype.writeUint16BE=e.prototype.writeUInt16BE=function(r,l,h){return r=+r,l>>>=0,h||ie(this,r,l,2,65535,0),this[l]=r>>>8,this[l+1]=255&r,l+2},e.prototype.writeUint32LE=e.prototype.writeUInt32LE=function(r,l,h){return r=+r,l>>>=0,h||ie(this,r,l,4,4294967295,0),this[l+3]=r>>>24,this[l+2]=r>>>16,this[l+1]=r>>>8,this[l]=255&r,l+4},e.prototype.writeUint32BE=e.prototype.writeUInt32BE=function(r,l,h){return r=+r,l>>>=0,h||ie(this,r,l,4,4294967295,0),this[l]=r>>>24,this[l+1]=r>>>16,this[l+2]=r>>>8,this[l+3]=255&r,l+4},e.prototype.writeBigUInt64LE=fe(function(r,l=0){return K(this,r,l,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeBigUInt64BE=fe(function(r,l=0){return X(this,r,l,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeIntLE=function(r,l,h,M){if(r=+r,l>>>=0,!M){const S=Math.pow(2,8*h-1);ie(this,r,l,h,S-1,-S)}let f=0,m=1,V=0;for(this[l]=255&r;++f>0)-V&255;return l+h},e.prototype.writeIntBE=function(r,l,h,M){if(r=+r,l>>>=0,!M){const S=Math.pow(2,8*h-1);ie(this,r,l,h,S-1,-S)}let f=h-1,m=1,V=0;for(this[l+f]=255&r;--f>=0&&(m*=256);)r<0&&0===V&&0!==this[l+f+1]&&(V=1),this[l+f]=(r/m>>0)-V&255;return l+h},e.prototype.writeInt8=function(r,l,h){return r=+r,l>>>=0,h||ie(this,r,l,1,127,-128),r<0&&(r=255+r+1),this[l]=255&r,l+1},e.prototype.writeInt16LE=function(r,l,h){return r=+r,l>>>=0,h||ie(this,r,l,2,32767,-32768),this[l]=255&r,this[l+1]=r>>>8,l+2},e.prototype.writeInt16BE=function(r,l,h){return r=+r,l>>>=0,h||ie(this,r,l,2,32767,-32768),this[l]=r>>>8,this[l+1]=255&r,l+2},e.prototype.writeInt32LE=function(r,l,h){return r=+r,l>>>=0,h||ie(this,r,l,4,2147483647,-2147483648),this[l]=255&r,this[l+1]=r>>>8,this[l+2]=r>>>16,this[l+3]=r>>>24,l+4},e.prototype.writeInt32BE=function(r,l,h){return r=+r,l>>>=0,h||ie(this,r,l,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[l]=r>>>24,this[l+1]=r>>>16,this[l+2]=r>>>8,this[l+3]=255&r,l+4},e.prototype.writeBigInt64LE=fe(function(r,l=0){return K(this,r,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),e.prototype.writeBigInt64BE=fe(function(r,l=0){return X(this,r,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),e.prototype.writeFloatLE=function(r,l,h){return ee(this,r,l,!0,h)},e.prototype.writeFloatBE=function(r,l,h){return ee(this,r,l,!1,h)},e.prototype.writeDoubleLE=function(r,l,h){return Z(this,r,l,!0,h)},e.prototype.writeDoubleBE=function(r,l,h){return Z(this,r,l,!1,h)},e.prototype.copy=function(r,l,h,M){if(!e.isBuffer(r))throw new TypeError("argument should be a Buffer");if(h||(h=0),M||0===M||(M=this.length),l>=r.length&&(l=r.length),l||(l=0),M>0&&M=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),r.length-l>>=0,h=void 0===h?this.length:h>>>0,r||(r=0),"number"==typeof r)for(f=l;f=M+4;h-=3)l=`_${r.slice(h-3,h)}${l}`;return`${r.slice(0,h)}${l}`}function me(r,l,h,M,f,m){if(r>h||r3?0===l||l===BigInt(0)?`>= 0${V} and < 2${V} ** ${8*(m+1)}${V}`:`>= -(2${V} ** ${8*(m+1)-1}${V}) and < 2 ** ${8*(m+1)-1}${V}`:`>= ${l}${V} and <= ${h}${V}`,new W.ERR_OUT_OF_RANGE("value",S,r)}var V,S,N;V=M,N=m,ve(S=f,"offset"),void 0!==V[S]&&void 0!==V[S+N]||Se(S,V.length-(N+1))}function ve(r,l){if("number"!=typeof r)throw new W.ERR_INVALID_ARG_TYPE(l,"number",r)}function Se(r,l,h){throw Math.floor(r)!==r?(ve(r,h),new W.ERR_OUT_OF_RANGE(h||"offset","an integer",r)):l<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE(h||"offset",`>= ${h?1:0} and <= ${l}`,r)}ue("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ue("ERR_INVALID_ARG_TYPE",function(r,l){return`The "${r}" argument must be of type number. Received type ${typeof l}`},TypeError),ue("ERR_OUT_OF_RANGE",function(r,l,h){let M=`The value of "${r}" is out of range.`,f=h;return Number.isInteger(h)&&Math.abs(h)>4294967296?f=se(String(h)):"bigint"==typeof h&&(f=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(f=se(f)),f+="n"),M+=` It must be ${l}. Received ${f}`,M},RangeError);const H=/[^+/0-9A-Za-z-_]/g;function ce(r,l){let h;l=l||1/0;const M=r.length;let f=null;const m=[];for(let V=0;V55295&&h<57344){if(!f){if(h>56319){(l-=3)>-1&&m.push(239,191,189);continue}if(V+1===M){(l-=3)>-1&&m.push(239,191,189);continue}f=h;continue}if(h<56320){(l-=3)>-1&&m.push(239,191,189),f=h;continue}h=65536+(f-55296<<10|h-56320)}else f&&(l-=3)>-1&&m.push(239,191,189);if(f=null,h<128){if((l-=1)<0)break;m.push(h)}else if(h<2048){if((l-=2)<0)break;m.push(h>>6|192,63&h|128)}else if(h<65536){if((l-=3)<0)break;m.push(h>>12|224,h>>6&63|128,63&h|128)}else{if(!(h<1114112))throw new Error("Invalid code point");if((l-=4)<0)break;m.push(h>>18|240,h>>12&63|128,h>>6&63|128,63&h|128)}}return m}function ye(r){return o.toByteArray(function(l){if((l=(l=l.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;l.length%4!=0;)l+="=";return l}(r))}function _e(r,l,h,M){let f;for(f=0;f=l.length||f>=r.length);++f)l[f+h]=r[f];return f}function $(r,l){return r instanceof l||null!=r&&null!=r.constructor&&null!=r.constructor.name&&r.constructor.name===l.name}function z(r){return r!=r}const ae=function(){const r="0123456789abcdef",l=new Array(256);for(let h=0;h<16;++h){const M=16*h;for(let f=0;f<16;++f)l[M+f]=r[h]+r[f]}return l}();function fe(r){return typeof BigInt>"u"?de:r}function de(){throw new Error("BigInt not supported")}},1227:(C,t,n)=>{var o=n(4155);t.formatArgs=function(d){if(d[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+d[0]+(this.useColors?"%c ":" ")+"+"+C.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;d.splice(1,0,p,"color: inherit");let s=0,e=0;d[0].replace(/%[a-zA-Z%]/g,i=>{"%%"!==i&&(s++,"%c"===i&&(e=s))}),d.splice(e,0,p)},t.save=function(d){try{d?t.storage.setItem("debug",d):t.storage.removeItem("debug")}catch{}},t.load=function(){let d;try{d=t.storage.getItem("debug")}catch{}return!d&&void 0!==o&&"env"in o&&(d=o.env.DEBUG),d},t.useColors=function(){return!(typeof window>"u"||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||(typeof navigator>"u"||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&(typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch{}}(),t.destroy=(()=>{let d=!1;return()=>{d||(d=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),C.exports=n(2447)(t);const{formatters:c}=C.exports;c.j=function(d){try{return JSON.stringify(d)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}},2447:(C,t,n)=>{C.exports=function(o){function c(s){let e,i,a,y=null;function b(...g){if(!b.enabled)return;const E=b,A=Number(new Date);E.diff=A-(e||A),E.prev=e,E.curr=A,e=A,g[0]=c.coerce(g[0]),"string"!=typeof g[0]&&g.unshift("%O");let _=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(P,O)=>{if("%%"===P)return"%";_++;const L=c.formatters[O];return"function"==typeof L&&(P=L.call(E,g[_]),g.splice(_,1),_--),P}),c.formatArgs.call(E,g),(E.log||c.log).apply(E,g)}return b.namespace=s,b.useColors=c.useColors(),b.color=c.selectColor(s),b.extend=d,b.destroy=c.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==y?y:(i!==c.namespaces&&(i=c.namespaces,a=c.enabled(s)),a),set:g=>{y=g}}),"function"==typeof c.init&&c.init(b),b}function d(s,e){const i=c(this.namespace+(void 0===e?":":e)+s);return i.log=this.log,i}function p(s){return s.toString().substring(2,s.toString().length-2).replace(/\.\*\?$/,"*")}return c.debug=c,c.default=c,c.coerce=function(s){return s instanceof Error?s.stack||s.message:s},c.disable=function(){const s=[...c.names.map(p),...c.skips.map(p).map(e=>"-"+e)].join(",");return c.enable(""),s},c.enable=function(s){let e;c.save(s),c.namespaces=s,c.names=[],c.skips=[];const i=("string"==typeof s?s:"").split(/[\s,]+/),a=i.length;for(e=0;e{c[s]=o[s]}),c.names=[],c.skips=[],c.formatters={},c.selectColor=function(s){let e=0;for(let i=0;i{var o=n(4155),c=n(778),d=function(){},p=function(s,e,i){if("function"==typeof e)return p(s,null,e);e||(e={}),i=c(i||d);var F,a=s._writableState,y=s._readableState,b=e.readable||!1!==e.readable&&s.readable,g=e.writable||!1!==e.writable&&s.writable,E=!1,A=function(){s.writable||v()},v=function(){g=!1,b||i.call(s)},_=function(){b=!1,g||i.call(s)},P=function(F){i.call(s,F?new Error("exited with error code: "+F):null)},O=function(F){i.call(s,F)},L=function(){o.nextTick(I)},I=function(){if(!E)return(!b||y&&y.ended&&!y.destroyed)&&(!g||a&&a.ended&&!a.destroyed)?void 0:i.call(s,new Error("premature close"))},k=function(){s.req.on("finish",v)};return(F=s).setHeader&&"function"==typeof F.abort?(s.on("complete",v),s.on("abort",L),s.req?k():s.on("request",k)):g&&!a&&(s.on("end",A),s.on("close",A)),function(F){return F.stdio&&Array.isArray(F.stdio)&&3===F.stdio.length}(s)&&s.on("exit",P),s.on("end",_),s.on("finish",v),!1!==e.error&&s.on("error",O),s.on("close",L),function(){E=!0,s.removeListener("complete",v),s.removeListener("abort",L),s.removeListener("request",k),s.req&&s.req.removeListener("finish",v),s.removeListener("end",A),s.removeListener("close",A),s.removeListener("finish",v),s.removeListener("exit",P),s.removeListener("end",_),s.removeListener("error",O),s.removeListener("close",L)}};C.exports=p},7187:C=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(v,_,P){return Function.prototype.apply.call(v,_,P)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(v){return Object.getOwnPropertyNames(v).concat(Object.getOwnPropertySymbols(v))}:function(v){return Object.getOwnPropertyNames(v)};var c=Number.isNaN||function(v){return v!=v};function d(){d.init.call(this)}C.exports=d,C.exports.once=function(v,_){return new Promise(function(P,O){function L(k){v.removeListener(_,I),O(k)}function I(){"function"==typeof v.removeListener&&v.removeListener("error",L),P([].slice.call(arguments))}var k;A(v,_,I,{once:!0}),"error"!==_&&("function"==typeof(k=v).on&&A(k,"error",L,{once:!0}))})},d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var p=10;function s(v){if("function"!=typeof v)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}function e(v){return void 0===v._maxListeners?d.defaultMaxListeners:v._maxListeners}function i(v,_,P,O){var L,I,k;if(s(P),void 0===(I=v._events)?(I=v._events=Object.create(null),v._eventsCount=0):(void 0!==I.newListener&&(v.emit("newListener",_,P.listener?P.listener:P),I=v._events),k=I[_]),void 0===k)k=I[_]=P,++v._eventsCount;else if("function"==typeof k?k=I[_]=O?[P,k]:[k,P]:O?k.unshift(P):k.push(P),(L=e(v))>0&&k.length>L&&!k.warned){k.warned=!0;var G=new Error("Possible EventEmitter memory leak detected. "+k.length+" "+String(_)+" listeners added. Use emitter.setMaxListeners() to increase limit");G.name="MaxListenersExceededWarning",G.emitter=v,G.type=_,G.count=k.length,console&&console.warn&&console.warn(G)}return v}function a(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function y(v,_,P){var O={fired:!1,wrapFn:void 0,target:v,type:_,listener:P},L=a.bind(O);return L.listener=P,O.wrapFn=L,L}function b(v,_,P){var O=v._events;if(void 0===O)return[];var L=O[_];return void 0===L?[]:"function"==typeof L?P?[L.listener||L]:[L]:P?function(I){for(var k=new Array(I.length),F=0;F0&&(I=_[0]),I instanceof Error)throw I;var k=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw k.context=I,k}var F=L[v];if(void 0===F)return!1;if("function"==typeof F)o(F,this,_);else{var G=F.length,B=E(F,G);for(P=0;P=0;I--)if(P[I]===_||P[I].listener===_){k=P[I].listener,L=I;break}if(L<0)return this;0===L?P.shift():function(F,G){for(;G+1=0;O--)this.removeListener(v,_[O]);return this},d.prototype.listeners=function(v){return b(this,v,!0)},d.prototype.rawListeners=function(v){return b(this,v,!1)},d.listenerCount=function(v,_){return"function"==typeof v.listenerCount?v.listenerCount(_):g.call(v,_)},d.prototype.listenerCount=g,d.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},4063:C=>{"use strict";C.exports=function t(n,o){if(n===o)return!0;if(n&&o&&"object"==typeof n&&"object"==typeof o){if(n.constructor!==o.constructor)return!1;var c,d,p;if(Array.isArray(n)){if((c=n.length)!=o.length)return!1;for(d=c;0!=d--;)if(!t(n[d],o[d]))return!1;return!0}if(n.constructor===RegExp)return n.source===o.source&&n.flags===o.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===o.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===o.toString();if((c=(p=Object.keys(n)).length)!==Object.keys(o).length)return!1;for(d=c;0!=d--;)if(!Object.prototype.hasOwnProperty.call(o,p[d]))return!1;for(d=c;0!=d--;){var s=p[d];if(!t(n[s],o[s]))return!1}return!0}return n!=n&&o!=o}},4445:C=>{C.exports=p,p.default=p,p.stable=a,p.stableStringify=a;var t="[...]",n="[Circular]",o=[],c=[];function d(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function p(g,E,A,v){var _;void 0===v&&(v=d()),e(g,"",0,[],void 0,0,v);try{_=0===c.length?JSON.stringify(g,E,A):JSON.stringify(g,b(E),A)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==o.length;){var P=o.pop();4===P.length?Object.defineProperty(P[0],P[1],P[3]):P[0][P[1]]=P[2]}}return _}function s(g,E,A,v){var _=Object.getOwnPropertyDescriptor(v,A);void 0!==_.get?_.configurable?(Object.defineProperty(v,A,{value:g}),o.push([v,A,E,_])):c.push([E,A,g]):(v[A]=g,o.push([v,A,E]))}function e(g,E,A,v,_,P,O){var L;if(P+=1,"object"==typeof g&&null!==g){for(L=0;LO.depthLimit||void 0!==O.edgesLimit&&A+1>O.edgesLimit)return void s(t,g,E,_);if(v.push(g),Array.isArray(g))for(L=0;LE?1:0}function a(g,E,A,v){void 0===v&&(v=d());var _,P=y(g,"",0,[],void 0,0,v)||g;try{_=0===c.length?JSON.stringify(P,E,A):JSON.stringify(P,b(E),A)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==o.length;){var O=o.pop();4===O.length?Object.defineProperty(O[0],O[1],O[3]):O[0][O[1]]=O[2]}}return _}function y(g,E,A,v,_,P,O){var L;if(P+=1,"object"==typeof g&&null!==g){for(L=0;LO.depthLimit||void 0!==O.edgesLimit&&A+1>O.edgesLimit)return void s(t,g,E,_);if(v.push(g),Array.isArray(g))for(L=0;L0)for(var v=0;v{t.read=function(n,o,c,d,p){var s,e,i=8*p-d-1,a=(1<>1,b=-7,g=c?p-1:0,E=c?-1:1,A=n[o+g];for(g+=E,s=A&(1<<-b)-1,A>>=-b,b+=i;b>0;s=256*s+n[o+g],g+=E,b-=8);for(e=s&(1<<-b)-1,s>>=-b,b+=d;b>0;e=256*e+n[o+g],g+=E,b-=8);if(0===s)s=1-y;else{if(s===a)return e?NaN:1/0*(A?-1:1);e+=Math.pow(2,d),s-=y}return(A?-1:1)*e*Math.pow(2,s-d)},t.write=function(n,o,c,d,p,s){var e,i,a,y=8*s-p-1,b=(1<>1,E=23===p?Math.pow(2,-24)-Math.pow(2,-77):0,A=d?0:s-1,v=d?1:-1,_=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(i=isNaN(o)?1:0,e=b):(e=Math.floor(Math.log(o)/Math.LN2),o*(a=Math.pow(2,-e))<1&&(e--,a*=2),(o+=e+g>=1?E/a:E*Math.pow(2,1-g))*a>=2&&(e++,a/=2),e+g>=b?(i=0,e=b):e+g>=1?(i=(o*a-1)*Math.pow(2,p),e+=g):(i=o*Math.pow(2,g-1)*Math.pow(2,p),e=0));p>=8;n[c+A]=255&i,A+=v,i/=256,p-=8);for(e=e<0;n[c+A]=255&e,A+=v,e/=256,y-=8);n[c+A-v]|=128*_}},4970:C=>{"use strict";const t=n=>null!==n&&"object"==typeof n&&"function"==typeof n.pipe;t.writable=n=>t(n)&&!1!==n.writable&&"function"==typeof n._write&&"object"==typeof n._writableState,t.readable=n=>t(n)&&!1!==n.readable&&"function"==typeof n._read&&"object"==typeof n._readableState,t.duplex=n=>t.writable(n)&&t.readable(n),t.transform=n=>t.duplex(n)&&"function"==typeof n._transform,C.exports=t},2378:(C,t,n)=>{C=n.nmd(C);var o="__lodash_hash_undefined__",c=9007199254740991,d="[object Arguments]",s="[object Function]",a="[object Object]",g=/^\[object .+?Constructor\]$/,E=/^(?:0|[1-9]\d*)$/,A={};A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A[d]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object Boolean]"]=A["[object DataView]"]=A["[object Date]"]=A["[object Error]"]=A[s]=A["[object Map]"]=A["[object Number]"]=A[a]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object WeakMap]"]=!1;var v,_,P,O="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,L="object"==typeof self&&self&&self.Object===Object&&self,I=O||L||Function("return this")(),k=t&&!t.nodeType&&t,F=k&&C&&!C.nodeType&&C,G=F&&F.exports===k,B=G&&O.process,T=function(){try{return F&&F.require&&F.require("util").types||B&&B.binding&&B.binding("util")}catch{}}(),Q=T&&T.isTypedArray,D=Array.prototype,we=Object.prototype,re=I["__core-js_shared__"],U=Function.prototype.toString,ie=we.hasOwnProperty,K=(v=/[^.]+$/.exec(re&&re.keys&&re.keys.IE_PROTO||""))?"Symbol(src)_1."+v:"",X=we.toString,te=U.call(Object),ee=RegExp("^"+U.call(ie).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Z=G?I.Buffer:void 0,W=I.Symbol,ue=I.Uint8Array,se=(_=Object.getPrototypeOf,P=Object,function(Y){return _(P(Y))}),me=Object.create,ve=we.propertyIsEnumerable,Se=D.splice,H=W?W.toStringTag:void 0,ce=function(){try{var Y=Re(Object,"defineProperty");return Y({},"",{}),Y}catch{}}(),ye=Z?Z.isBuffer:void 0,_e=Math.max,$=Date.now,z=Re(I,"Map"),ae=Re(Object,"create"),fe=function(){function Y(){}return function(R){if(!rt(R))return{};if(me)return me(R);Y.prototype=R;var u=new Y;return Y.prototype=void 0,u}}();function de(Y){var R=-1,u=null==Y?0:Y.length;for(this.clear();++R-1},r.prototype.set=function(Y,R){var u=this.__data__,w=m(u,Y);return w<0?(++this.size,u.push([Y,R])):u[w][1]=R,this},l.prototype.clear=function(){this.size=0,this.__data__={hash:new de,map:new(z||r),string:new de}},l.prototype.delete=function(Y){var R=le(this,Y).delete(Y);return this.size-=R?1:0,R},l.prototype.get=function(Y){return le(this,Y).get(Y)},l.prototype.has=function(Y){return le(this,Y).has(Y)},l.prototype.set=function(Y,R){var u=le(this,Y),w=u.size;return u.set(Y,R),this.size+=u.size==w?0:1,this},h.prototype.clear=function(){this.__data__=new r,this.size=0},h.prototype.delete=function(Y){var R=this.__data__,u=R.delete(Y);return this.size=R.size,u},h.prototype.get=function(Y){return this.__data__.get(Y)},h.prototype.has=function(Y){return this.__data__.has(Y)},h.prototype.set=function(Y,R){var u=this.__data__;if(u instanceof r){var w=u.__data__;if(!z||w.length<199)return w.push([Y,R]),this.size=++u.size,this;u=this.__data__=new l(w)}return u.set(Y,R),this.size=u.size,this};var J=ce?function(Y,R){return ce(Y,"toString",{configurable:!0,enumerable:!1,value:(u=R,function(){return u}),writable:!0});var u}:gt;function le(Y,R){var u,w,x=Y.__data__;return("string"==(w=typeof(u=R))||"number"==w||"symbol"==w||"boolean"==w?"__proto__"!==u:null===u)?x["string"==typeof R?"string":"hash"]:x.map}function Re(Y,R){var w,u=null==(w=Y)?void 0:w[R];return function(w){return!(!rt(w)||function(x){return!!K&&K in x}(w))&&(st(w)?ee:g).test(function(x){if(null!=x){try{return U.call(x)}catch{}try{return x+""}catch{}}return""}(w))}(u)?u:void 0}function Ce(Y,R){var u=typeof Y;return!!(R=R??c)&&("number"==u||"symbol"!=u&&E.test(Y))&&Y>-1&&Y%1==0&&Y0){if(++R>=800)return arguments[0]}else R=0;return Y.apply(void 0,arguments)});function We(Y,R){return Y===R||Y!=Y&&R!=R}var Ve=N(function(){return arguments}())?N:function(Y){return nt(Y)&&ie.call(Y,"callee")&&!ve.call(Y,"callee")},Je=Array.isArray;function He(Y){return null!=Y&&ft(Y.length)&&!st(Y)}var ct=ye||function(){return!1};function st(Y){if(!rt(Y))return!1;var R=S(Y);return R==s||"[object GeneratorFunction]"==R||"[object AsyncFunction]"==R||"[object Proxy]"==R}function ft(Y){return"number"==typeof Y&&Y>-1&&Y%1==0&&Y<=c}function rt(Y){var R=typeof Y;return null!=Y&&("object"==R||"function"==R)}function nt(Y){return null!=Y&&"object"==typeof Y}var ht=Q?function(Y){return function(R){return Y(R)}}(Q):function(Y){return nt(Y)&&ft(Y.length)&&!!A[S(Y)]};function pt(Y){return He(Y)?function(R,u){var w=Je(R),x=!w&&Ve(R),q=!w&&!x&&ct(R),ne=!w&&!x&&!q&&ht(R),oe=w||x||q||ne,he=oe?function(Ee,Ae){for(var Le=-1,Ne=Array(Ee);++Le1?R[w-1]:void 0,q=w>2?R[2]:void 0;for(x=at.length>3&&"function"==typeof x?(w--,x):void 0,q&&function(oe,he,pe){if(!rt(pe))return!1;var be=typeof he;return!!("number"==be?He(pe)&&Ce(he,pe.length):"string"==be&&he in pe)&&We(pe[he],oe)}(R[0],R[1],q)&&(x=w<3?void 0:x,w=1),Y=Object(Y);++u=0&&D<=G.levels.SILENT))throw"log.setLevel() called with invalid level: "+D;if(F=D,!1!==ge&&function(we){var re=(a[we]||"silent").toUpperCase();if(typeof window!==e&&B){try{return void(window.localStorage[B]=re)}catch{}try{window.document.cookie=encodeURIComponent(B)+"="+re+";"}catch{}}}(D),g.call(G,D,L),typeof console===e&&D{var t=1e3,n=60*t,o=60*n,c=24*o;function d(p,s,e,i){var a=s>=1.5*e;return Math.round(p/e)+" "+i+(a?"s":"")}C.exports=function(p,s){s=s||{};var e,i,y,b,a=typeof p;if("string"===a&&p.length>0)return function(y){if(!((y=String(y)).length>100)){var b=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(y);if(b){var g=parseFloat(b[1]);switch((b[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*g;case"weeks":case"week":case"w":return 6048e5*g;case"days":case"day":case"d":return g*c;case"hours":case"hour":case"hrs":case"hr":case"h":return g*o;case"minutes":case"minute":case"mins":case"min":case"m":return g*n;case"seconds":case"second":case"secs":case"sec":case"s":return g*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}(p);if("number"===a&&isFinite(p))return s.long?(e=p,(i=Math.abs(e))>=c?d(e,i,c,"day"):i>=o?d(e,i,o,"hour"):i>=n?d(e,i,n,"minute"):i>=t?d(e,i,t,"second"):e+" ms"):(y=p,(b=Math.abs(y))>=c?Math.round(y/c)+"d":b>=o?Math.round(y/o)+"h":b>=n?Math.round(y/n)+"m":b>=t?Math.round(y/t)+"s":y+"ms");throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))}},778:(C,t,n)=>{var o=n(2479);function c(p){var s=function(){return s.called?s.value:(s.called=!0,s.value=p.apply(this,arguments))};return s.called=!1,s}function d(p){var s=function(){if(s.called)throw new Error(s.onceError);return s.called=!0,s.value=p.apply(this,arguments)};return s.onceError=(p.name||"Function wrapped with `once`")+" shouldn't be called more than once",s.called=!1,s}C.exports=o(c),C.exports.strict=o(d),c.proto=c(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return c(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return d(this)},configurable:!0})})},4155:C=>{var t,n,o=C.exports={};function c(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}function p(A){if(t===setTimeout)return setTimeout(A,0);if((t===c||!t)&&setTimeout)return t=setTimeout,setTimeout(A,0);try{return t(A,0)}catch{try{return t.call(null,A,0)}catch{return t.call(this,A,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:c}catch{t=c}try{n="function"==typeof clearTimeout?clearTimeout:d}catch{n=d}}();var s,e=[],i=!1,a=-1;function y(){i&&s&&(i=!1,s.length?e=s.concat(e):a=-1,e.length&&b())}function b(){if(!i){var A=p(y);i=!0;for(var v=e.length;v;){for(s=e,e=[];++a1)for(var _=1;_{var o=n(4155),c=n(778),d=n(2840),p=n(1156),s=function(){},e=/^v?\.0/.test(o.version),i=function(b){return"function"==typeof b},a=function(b){b()},y=function(b,g){return b.pipe(g)};C.exports=function(){var b,g=Array.prototype.slice.call(arguments),E=i(g[g.length-1]||s)&&g.pop()||s;if(Array.isArray(g[0])&&(g=g[0]),g.length<2)throw new Error("pump requires two streams per minimum");var A=g.map(function(v,_){var P=_0,function(O){b||(b=O),O&&A.forEach(a),P||(A.forEach(a),E(b))})});return g.reduce(y)}},196:(C,t,n)=>{"use strict";const{AbortError:o,codes:c}=n(4381),{isNodeStream:d,isWebStream:p,kControllerErrorFunction:s}=n(5874),e=n(8610),{ERR_INVALID_ARG_TYPE:i}=c;C.exports.addAbortSignal=function(a,y){if(((b,g)=>{if("object"!=typeof b||!("aborted"in b))throw new i("signal","AbortSignal",b)})(a),!d(y)&&!p(y))throw new i("stream",["ReadableStream","WritableStream","Stream"],y);return C.exports.addAbortSignalNoValidate(a,y)},C.exports.addAbortSignalNoValidate=function(a,y){if("object"!=typeof a||!("aborted"in a))return y;const b=d(y)?()=>{y.destroy(new o(void 0,{cause:a.reason}))}:()=>{y[s](new o(void 0,{cause:a.reason}))};return a.aborted?b():(a.addEventListener("abort",b),e(y,()=>a.removeEventListener("abort",b))),y}},7327:(C,t,n)=>{"use strict";const{StringPrototypeSlice:o,SymbolIterator:c,TypedArrayPrototypeSet:d,Uint8Array:p}=n(9061),{Buffer:s}=n(8764),{inspect:e}=n(6087);C.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(i){const a={data:i,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length}unshift(i){const a={data:i,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length}shift(){if(0===this.length)return;const i=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,i}clear(){this.head=this.tail=null,this.length=0}join(i){if(0===this.length)return"";let a=this.head,y=""+a.data;for(;null!==(a=a.next);)y+=i+a.data;return y}concat(i){if(0===this.length)return s.alloc(0);const a=s.allocUnsafe(i>>>0);let y=this.head,b=0;for(;y;)d(a,y.data,b),b+=y.data.length,y=y.next;return a}consume(i,a){const y=this.head.data;if(ig.length)){i===g.length?(a+=g,++b,this.head=y.next?y.next:this.tail=null):(a+=o(g,0,i),this.head=y,y.data=o(g,i));break}a+=g,i-=g.length,++b}while(null!==(y=y.next));return this.length-=b,a}_getBuffer(i){const a=s.allocUnsafe(i),y=i;let b=this.head,g=0;do{const E=b.data;if(!(i>E.length)){i===E.length?(d(a,E,y-i),++g,this.head=b.next?b.next:this.tail=null):(d(a,new p(E.buffer,E.byteOffset,i),y-i),this.head=b,b.data=E.slice(i));break}d(a,E,y-i),i-=E.length,++g}while(null!==(b=b.next));return this.length-=g,a}[Symbol.for("nodejs.util.inspect.custom")](i,a){return e(this,{...a,depth:0,customInspect:!1})}}},299:(C,t,n)=>{"use strict";const{pipeline:o}=n(9946),c=n(8672),{destroyer:d}=n(1195),{isNodeStream:p,isReadable:s,isWritable:e,isWebStream:i,isTransformStream:a,isWritableStream:y,isReadableStream:b}=n(5874),{AbortError:g,codes:{ERR_INVALID_ARG_VALUE:E,ERR_MISSING_ARGS:A}}=n(4381),v=n(8610);C.exports=function(..._){if(0===_.length)throw new A("streams");if(1===_.length)return c.from(_[0]);const P=[..._];if("function"==typeof _[0]&&(_[0]=c.from(_[0])),"function"==typeof _[_.length-1]){const D=_.length-1;_[D]=c.from(_[D])}for(let D=0;D<_.length;++D)if(p(_[D])||i(_[D])){if(D<_.length-1&&!(s(_[D])||b(_[D])||a(_[D])))throw new E(`streams[${D}]`,P[D],"must be readable");if(D>0&&!(e(_[D])||y(_[D])||a(_[D])))throw new E(`streams[${D}]`,P[D],"must be writable")}let O,L,I,k,F;const G=_[0],B=o(_,function(D){const ge=k;k=null,ge?ge(D):D?F.destroy(D):Q||T||F.destroy()}),T=!!(e(G)||y(G)||a(G)),Q=!!(s(B)||b(B)||a(B));if(F=new c({writableObjectMode:!(null==G||!G.writableObjectMode),readableObjectMode:!(null==B||!B.writableObjectMode),writable:T,readable:Q}),T){if(p(G))F._write=function(ge,we,re){G.write(ge,we)?re():O=re},F._final=function(ge){G.end(),L=ge},G.on("drain",function(){if(O){const ge=O;O=null,ge()}});else if(i(G)){const ge=(a(G)?G.writable:G).getWriter();F._write=function(){var we=Ie(function*(re,U,ie){try{yield ge.ready,ge.write(re).catch(()=>{}),ie()}catch(K){ie(K)}});return function(re,U,ie){return we.apply(this,arguments)}}(),F._final=function(){var we=Ie(function*(re){try{yield ge.ready,ge.close().catch(()=>{}),L=re}catch(U){re(U)}});return function(re){return we.apply(this,arguments)}}()}const D=a(B)?B.readable:B;v(D,()=>{if(L){const ge=L;L=null,ge()}})}if(Q)if(p(B))B.on("readable",function(){if(I){const D=I;I=null,D()}}),B.on("end",function(){F.push(null)}),F._read=function(){for(;;){const D=B.read();if(null===D)return void(I=F._read);if(!F.push(D))return}};else if(i(B)){const D=(a(B)?B.readable:B).getReader();F._read=Ie(function*(){for(;;)try{const{value:ge,done:we}=yield D.read();if(!F.push(ge))return;if(we)return void F.push(null)}catch{return}})}return F._destroy=function(D,ge){D||null===k||(D=new g),I=null,O=null,L=null,null===k?ge(D):(k=ge,p(B)&&d(B,D))},F}},1195:(C,t,n)=>{"use strict";const o=n(4155),{aggregateTwoErrors:c,codes:{ERR_MULTIPLE_CALLBACK:d},AbortError:p}=n(4381),{Symbol:s}=n(9061),{kDestroyed:e,isDestroyed:i,isFinished:a,isServerRequest:y}=n(5874),b=s("kDestroy"),g=s("kConstruct");function E(B,T,Q){B&&(T&&!T.errored&&(T.errored=B),Q&&!Q.errored&&(Q.errored=B))}function A(B,T,Q){let D=!1;function ge(we){if(D)return;D=!0;const re=B._readableState,U=B._writableState;E(we,U,re),U&&(U.closed=!0),re&&(re.closed=!0),"function"==typeof Q&&Q(we),we?o.nextTick(v,B,we):o.nextTick(_,B)}try{B._destroy(T||null,ge)}catch(we){ge(we)}}function v(B,T){P(B,T),_(B)}function _(B){const T=B._readableState,Q=B._writableState;Q&&(Q.closeEmitted=!0),T&&(T.closeEmitted=!0),(null!=Q&&Q.emitClose||null!=T&&T.emitClose)&&B.emit("close")}function P(B,T){const Q=B._readableState,D=B._writableState;null!=D&&D.errorEmitted||null!=Q&&Q.errorEmitted||(D&&(D.errorEmitted=!0),Q&&(Q.errorEmitted=!0),B.emit("error",T))}function O(B,T,Q){const D=B._readableState,ge=B._writableState;if(null!=ge&&ge.destroyed||null!=D&&D.destroyed)return this;null!=D&&D.autoDestroy||null!=ge&&ge.autoDestroy?B.destroy(T):T&&(ge&&!ge.errored&&(ge.errored=T),D&&!D.errored&&(D.errored=T),Q?o.nextTick(P,B,T):P(B,T))}function L(B){let T=!1;function Q(D){if(T)return void O(B,D??new d);T=!0;const ge=B._readableState,we=B._writableState,re=we||ge;ge&&(ge.constructed=!0),we&&(we.constructed=!0),re.destroyed?B.emit(b,D):D?O(B,D,!0):o.nextTick(I,B)}try{B._construct(D=>{o.nextTick(Q,D)})}catch(D){o.nextTick(Q,D)}}function I(B){B.emit(g)}function k(B){return(null==B?void 0:B.setHeader)&&"function"==typeof B.abort}function F(B){B.emit("close")}function G(B,T){B.emit("error",T),o.nextTick(F,B)}C.exports={construct:function(B,T){if("function"!=typeof B._construct)return;const Q=B._readableState,D=B._writableState;Q&&(Q.constructed=!1),D&&(D.constructed=!1),B.once(g,T),B.listenerCount(g)>1||o.nextTick(L,B)},destroyer:function(B,T){B&&!i(B)&&(T||a(B)||(T=new p),y(B)?(B.socket=null,B.destroy(T)):k(B)?B.abort():k(B.req)?B.req.abort():"function"==typeof B.destroy?B.destroy(T):"function"==typeof B.close?B.close():T?o.nextTick(G,B,T):o.nextTick(F,B),B.destroyed||(B[e]=!0))},destroy:function(B,T){const Q=this._readableState,D=this._writableState,ge=D||Q;return null!=D&&D.destroyed||null!=Q&&Q.destroyed?("function"==typeof T&&T(),this):(E(B,D,Q),D&&(D.destroyed=!0),Q&&(Q.destroyed=!0),ge.constructed?A(this,B,T):this.once(b,function(we){A(this,c(we,B),T)}),this)},undestroy:function(){const B=this._readableState,T=this._writableState;B&&(B.constructed=!0,B.closed=!1,B.closeEmitted=!1,B.destroyed=!1,B.errored=null,B.errorEmitted=!1,B.reading=!1,B.ended=!1===B.readable,B.endEmitted=!1===B.readable),T&&(T.constructed=!0,T.destroyed=!1,T.closed=!1,T.closeEmitted=!1,T.errored=null,T.errorEmitted=!1,T.finalCalled=!1,T.prefinished=!1,T.ended=!1===T.writable,T.ending=!1===T.writable,T.finished=!1===T.writable)},errorOrDestroy:O}},8672:(C,t,n)=>{"use strict";const{ObjectDefineProperties:o,ObjectGetOwnPropertyDescriptor:c,ObjectKeys:d,ObjectSetPrototypeOf:p}=n(9061);C.exports=i;const s=n(911),e=n(6304);p(i.prototype,s.prototype),p(i,s);{const g=d(e.prototype);for(let E=0;E{const o=n(4155),c=n(8764),{isReadable:d,isWritable:p,isIterable:s,isNodeStream:e,isReadableNodeStream:i,isWritableNodeStream:a,isDuplexNodeStream:y}=n(5874),b=n(8610),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:E,ERR_INVALID_RETURN_VALUE:A}}=n(4381),{destroyer:v}=n(1195),_=n(8672),P=n(911),{createDeferredPromise:O}=n(6087),L=n(6307),I=globalThis.Blob||c.Blob,k=void 0!==I?function(Q){return Q instanceof I}:function(Q){return!1},F=globalThis.AbortController||n(8599).AbortController,{FunctionPrototypeCall:G}=n(9061);class B extends _{constructor(D){super(D),!1===(null==D?void 0:D.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==D?void 0:D.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function T(Q){const D=Q.readable&&"function"!=typeof Q.readable.read?P.wrap(Q.readable):Q.readable,ge=Q.writable;let we,re,U,ie,K,X=!!d(D),te=!!p(ge);function ee(Z){const W=ie;ie=null,W?W(Z):Z&&K.destroy(Z)}return K=new B({readableObjectMode:!(null==D||!D.readableObjectMode),writableObjectMode:!(null==ge||!ge.writableObjectMode),readable:X,writable:te}),te&&(b(ge,Z=>{te=!1,Z&&v(D,Z),ee(Z)}),K._write=function(Z,W,ue){ge.write(Z,W)?ue():we=ue},K._final=function(Z){ge.end(),re=Z},ge.on("drain",function(){if(we){const Z=we;we=null,Z()}}),ge.on("finish",function(){if(re){const Z=re;re=null,Z()}})),X&&(b(D,Z=>{X=!1,Z&&v(D,Z),ee(Z)}),D.on("readable",function(){if(U){const Z=U;U=null,Z()}}),D.on("end",function(){K.push(null)}),K._read=function(){for(;;){const Z=D.read();if(null===Z)return void(U=K._read);if(!K.push(Z))return}}),K._destroy=function(Z,W){Z||null===ie||(Z=new g),U=null,we=null,re=null,null===ie?W(Z):(ie=W,v(ge,Z),v(D,Z))},K}C.exports=function Q(D,ge){if(y(D))return D;if(i(D))return T({readable:D});if(a(D))return T({writable:D});if(e(D))return T({writable:!1,readable:!1});if("function"==typeof D){const{value:re,write:U,final:ie,destroy:K}=function(te){let{promise:ee,resolve:Z}=O();const W=new F,ue=W.signal;return{value:te(Me(function*(){for(;;){const se=ee;ee=null;const{chunk:me,done:ve,cb:Se}=yield xe(se);if(o.nextTick(Se),ve)return;if(ue.aborted)throw new g(void 0,{cause:ue.reason});({promise:ee,resolve:Z}=O()),yield me}})(),{signal:ue}),write(se,me,ve){const Se=Z;Z=null,Se({chunk:se,done:!1,cb:ve})},final(se){const me=Z;Z=null,me({done:!0,cb:se})},destroy(se,me){W.abort(),me(se)}}}(D);if(s(re))return L(B,re,{objectMode:!0,write:U,final:ie,destroy:K});const X=null==re?void 0:re.then;if("function"==typeof X){let te;const ee=G(X,re,Z=>{if(null!=Z)throw new A("nully","body",Z)},Z=>{v(te,Z)});return te=new B({objectMode:!0,readable:!1,write:U,final(Z){ie(Ie(function*(){try{yield ee,o.nextTick(Z,null)}catch(W){o.nextTick(Z,W)}}))},destroy:K})}throw new A("Iterable, AsyncIterable or AsyncFunction",ge,re)}if(k(D))return Q(D.arrayBuffer());if(s(D))return L(B,D,{objectMode:!0,writable:!1});if("object"==typeof(null==D?void 0:D.writable)||"object"==typeof(null==D?void 0:D.readable))return T({readable:null!=D&&D.readable?i(null==D?void 0:D.readable)?null==D?void 0:D.readable:Q(D.readable):void 0,writable:null!=D&&D.writable?a(null==D?void 0:D.writable)?null==D?void 0:D.writable:Q(D.writable):void 0});const we=null==D?void 0:D.then;if("function"==typeof we){let re;return G(we,D,U=>{null!=U&&re.push(U),re.push(null)},U=>{v(re,U)}),re=new B({objectMode:!0,writable:!1,read(){}})}throw new E(ge,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],D)}},8610:(C,t,n)=>{const o=n(4155),{AbortError:c,codes:d}=n(4381),{ERR_INVALID_ARG_TYPE:p,ERR_STREAM_PREMATURE_CLOSE:s}=d,{kEmptyObject:e,once:i}=n(6087),{validateAbortSignal:a,validateFunction:y,validateObject:b,validateBoolean:g}=n(6547),{Promise:E,PromisePrototypeThen:A}=n(9061),{isClosed:v,isReadable:_,isReadableNodeStream:P,isReadableStream:O,isReadableFinished:L,isReadableErrored:I,isWritable:k,isWritableNodeStream:F,isWritableStream:G,isWritableFinished:B,isWritableErrored:T,isNodeStream:Q,willEmitClose:D,kIsClosedPromise:ge}=n(5874),we=()=>{};function re(U,ie,K){var X,te;if(2===arguments.length?(K=ie,ie=e):null==ie?ie=e:b(ie,"options"),y(K,"callback"),a(ie.signal,"options.signal"),K=i(K),O(U)||G(U))return function(de,r,l){let h=!1,M=we;if(r.signal)if(M=()=>{h=!0,l.call(de,new c(void 0,{cause:r.signal.reason}))},r.signal.aborted)o.nextTick(M);else{const m=l;l=i((...V)=>{r.signal.removeEventListener("abort",M),m.apply(de,V)}),r.signal.addEventListener("abort",M)}const f=(...m)=>{h||o.nextTick(()=>l.apply(de,m))};return A(de[ge].promise,f,f),we}(U,ie,K);if(!Q(U))throw new p("stream",["ReadableStream","WritableStream","Stream"],U);const ee=null!==(X=ie.readable)&&void 0!==X?X:P(U),Z=null!==(te=ie.writable)&&void 0!==te?te:F(U),W=U._writableState,ue=U._readableState,se=()=>{U.writable||Se()};let me=D(U)&&P(U)===ee&&F(U)===Z,ve=B(U,!1);const Se=()=>{ve=!0,U.destroyed&&(me=!1),(!me||U.readable&&!ee)&&(ee&&!H||K.call(U))};let H=L(U,!1);const ce=()=>{H=!0,U.destroyed&&(me=!1),(!me||U.writable&&!Z)&&(Z&&!ve||K.call(U))},ye=de=>{K.call(U,de)};let _e=v(U);const $=()=>{_e=!0;const de=T(U)||I(U);return de&&"boolean"!=typeof de?K.call(U,de):ee&&!H&&P(U,!0)&&!L(U,!1)?K.call(U,new s):!Z||ve||B(U,!1)?void K.call(U):K.call(U,new s)},z=()=>{_e=!0;const de=T(U)||I(U);if(de&&"boolean"!=typeof de)return K.call(U,de);K.call(U)},ae=()=>{U.req.on("finish",Se)};var de;(de=U).setHeader&&"function"==typeof de.abort?(U.on("complete",Se),me||U.on("abort",$),U.req?ae():U.on("request",ae)):Z&&!W&&(U.on("end",se),U.on("close",se)),me||"boolean"!=typeof U.aborted||U.on("aborted",$),U.on("end",ce),U.on("finish",Se),!1!==ie.error&&U.on("error",ye),U.on("close",$),_e?o.nextTick($):null!=W&&W.errorEmitted||null!=ue&&ue.errorEmitted?me||o.nextTick(z):(ee||me&&!_(U)||!ve&&!1!==k(U))&&(Z||me&&!k(U)||!H&&!1!==_(U))?ue&&U.req&&U.aborted&&o.nextTick(z):o.nextTick(z);const fe=()=>{K=we,U.removeListener("aborted",$),U.removeListener("complete",Se),U.removeListener("abort",$),U.removeListener("request",ae),U.req&&U.req.removeListener("finish",Se),U.removeListener("end",se),U.removeListener("close",se),U.removeListener("finish",Se),U.removeListener("end",ce),U.removeListener("error",ye),U.removeListener("close",$)};if(ie.signal&&!_e){const de=()=>{const r=K;fe(),r.call(U,new c(void 0,{cause:ie.signal.reason}))};if(ie.signal.aborted)o.nextTick(de);else{const r=K;K=i((...l)=>{ie.signal.removeEventListener("abort",de),r.apply(U,l)}),ie.signal.addEventListener("abort",de)}}return fe}C.exports=re,C.exports.finished=function(U,ie){var K;let X=!1;return null===ie&&(ie=e),null!==(K=ie)&&void 0!==K&&K.cleanup&&(g(ie.cleanup,"cleanup"),X=ie.cleanup),new E((te,ee)=>{const Z=re(U,ie,W=>{X&&Z(),W?ee(W):te()})})}},6307:(C,t,n)=>{"use strict";const o=n(4155),{PromisePrototypeThen:c,SymbolAsyncIterator:d,SymbolIterator:p}=n(9061),{Buffer:s}=n(8764),{ERR_INVALID_ARG_TYPE:e,ERR_STREAM_NULL_VALUES:i}=n(4381).codes;C.exports=function(a,y,b){let g,E;if("string"==typeof y||y instanceof s)return new a({objectMode:!0,...b,read(){this.push(y),this.push(null)}});if(y&&y[d])E=!0,g=y[d]();else{if(!y||!y[p])throw new e("iterable",["Iterable"],y);E=!1,g=y[p]()}const A=new a({objectMode:!0,highWaterMark:1,...b});let v=!1;return A._read=function(){v||(v=!0,Ie(function*(){for(;;){try{const{value:_,done:P}=E?yield g.next():g.next();if(P)A.push(null);else{const O=_&&"function"==typeof _.then?yield _:_;if(null===O)throw v=!1,new i;if(A.push(O))continue;v=!1}}catch(_){A.destroy(_)}break}})())},A._destroy=function(_,P){var O;c((O=Ie(function*(L){if(null!=L&&"function"==typeof g.throw){const{value:F,done:G}=yield g.throw(L);if(yield F,G)return}if("function"==typeof g.return){const{value:F}=yield g.return();yield F}}),function(L){return O.apply(this,arguments)})(_),()=>o.nextTick(P,_),O=>o.nextTick(P,O||_))},A}},4870:(C,t,n)=>{"use strict";const{ArrayIsArray:o,ObjectSetPrototypeOf:c}=n(9061),{EventEmitter:d}=n(7187);function p(e){d.call(this,e)}function s(e,i,a){if("function"==typeof e.prependListener)return e.prependListener(i,a);e._events&&e._events[i]?o(e._events[i])?e._events[i].unshift(a):e._events[i]=[a,e._events[i]]:e.on(i,a)}c(p.prototype,d.prototype),c(p,d),p.prototype.pipe=function(e,i){const a=this;function y(P){e.writable&&!1===e.write(P)&&a.pause&&a.pause()}function b(){a.readable&&a.resume&&a.resume()}a.on("data",y),e.on("drain",b),e._isStdio||i&&!1===i.end||(a.on("end",E),a.on("close",A));let g=!1;function E(){g||(g=!0,e.end())}function A(){g||(g=!0,"function"==typeof e.destroy&&e.destroy())}function v(P){_(),0===d.listenerCount(this,"error")&&this.emit("error",P)}function _(){a.removeListener("data",y),e.removeListener("drain",b),a.removeListener("end",E),a.removeListener("close",A),a.removeListener("error",v),e.removeListener("error",v),a.removeListener("end",_),a.removeListener("close",_),e.removeListener("close",_)}return s(a,"error",v),s(e,"error",v),a.on("end",_),a.on("close",_),e.on("close",_),e.emit("pipe",a),e},C.exports={Stream:p,prependListener:s}},4382:(C,t,n)=>{"use strict";const o=globalThis.AbortController||n(8599).AbortController,{codes:{ERR_INVALID_ARG_VALUE:c,ERR_INVALID_ARG_TYPE:d,ERR_MISSING_ARGS:p,ERR_OUT_OF_RANGE:s},AbortError:e}=n(4381),{validateAbortSignal:i,validateInteger:a,validateObject:y}=n(6547),b=n(9061).Symbol("kWeak"),{finished:g}=n(8610),E=n(299),{addAbortSignalNoValidate:A}=n(196),{isWritable:v,isNodeStream:_}=n(5874),{ArrayPrototypePush:P,MathFloor:O,Number:L,NumberIsNaN:I,Promise:k,PromiseReject:F,PromisePrototypeThen:G,Symbol:B}=n(9061),T=B("kEmpty"),Q=B("kEof");function D(K,X){if("function"!=typeof K)throw new d("fn",["Function","AsyncFunction"],K);null!=X&&y(X,"options"),null!=(null==X?void 0:X.signal)&&i(X.signal,"options.signal");let te=1;return null!=(null==X?void 0:X.concurrency)&&(te=O(X.concurrency)),a(te,"concurrency",1),Me(function*(){var ee,Z;const W=new o,ue=this,se=[],me=W.signal,ve={signal:me},Se=()=>W.abort();let H,ce;null!=X&&null!==(ee=X.signal)&&void 0!==ee&&ee.aborted&&Se(),null==X||null===(Z=X.signal)||void 0===Z||Z.addEventListener("abort",Se);let ye=!1;function _e(){ye=!0}Ie(function*(){try{var ae,$=!1,z=!1;try{for(var de,fe=Oe(ue);$=!(de=yield fe.next()).done;$=!1){let h=de.value;var r;if(ye)return;if(me.aborted)throw new e;try{h=K(h,ve)}catch(M){h=F(M)}h!==T&&("function"==typeof(null===(r=h)||void 0===r?void 0:r.catch)&&h.catch(_e),se.push(h),H&&(H(),H=null),!ye&&se.length&&se.length>=te&&(yield new k(M=>{ce=M})))}}catch(h){z=!0,ae=h}finally{try{$&&null!=fe.return&&(yield fe.return())}finally{if(z)throw ae}}se.push(Q)}catch(h){const M=F(h);G(M,void 0,_e),se.push(M)}finally{var l;ye=!0,H&&(H(),H=null),null==X||null===(l=X.signal)||void 0===l||l.removeEventListener("abort",Se)}})();try{for(;;){for(;se.length>0;){const $=yield xe(se[0]);if($===Q)return;if(me.aborted)throw new e;$!==T&&(yield $),se.shift(),ce&&(ce(),ce=null)}yield xe(new k($=>{H=$}))}}finally{W.abort(),ye=!0,ce&&(ce(),ce=null)}}).call(this)}function ge(K){return we.apply(this,arguments)}function we(){return(we=Ie(function*(K,X){var Z,te=!1,ee=!1;try{for(var W=Oe(re.call(this,K,X));te=!(yield W.next()).done;te=!1)return!0}catch(se){ee=!0,Z=se}finally{try{te&&null!=W.return&&(yield W.return())}finally{if(ee)throw Z}}return!1})).apply(this,arguments)}function re(K,X){if("function"!=typeof K)throw new d("fn",["Function","AsyncFunction"],K);return D.call(this,function(){var te=Ie(function*(ee,Z){return(yield K(ee,Z))?ee:T});return function(ee,Z){return te.apply(this,arguments)}}(),X)}class U extends p{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function ie(K){if(K=L(K),I(K))return 0;if(K<0)throw new s("number",">= 0",K);return K}var K;C.exports.streamReturningOperators={asIndexedPairs:function(K){return null!=K&&y(K,"options"),null!=(null==K?void 0:K.signal)&&i(K.signal,"options.signal"),Me(function*(){let X=0;var Z,te=!1,ee=!1;try{for(var ue,W=Oe(this);te=!(ue=yield xe(W.next())).done;te=!1){const me=ue.value;var se;if(null!=K&&null!==(se=K.signal)&&void 0!==se&&se.aborted)throw new e({cause:K.signal.reason});yield[X++,me]}}catch(me){ee=!0,Z=me}finally{try{te&&null!=W.return&&(yield xe(W.return()))}finally{if(ee)throw Z}}}).call(this)},drop:function(K,X){return null!=X&&y(X,"options"),null!=(null==X?void 0:X.signal)&&i(X.signal,"options.signal"),K=ie(K),Me(function*(){var te;if(null!=X&&null!==(te=X.signal)&&void 0!==te&&te.aborted)throw new e;var W,ee=!1,Z=!1;try{for(var se,ue=Oe(this);ee=!(se=yield xe(ue.next())).done;ee=!1){const ve=se.value;var me;if(null!=X&&null!==(me=X.signal)&&void 0!==me&&me.aborted)throw new e;K--<=0&&(yield ve)}}catch(ve){Z=!0,W=ve}finally{try{ee&&null!=ue.return&&(yield xe(ue.return()))}finally{if(Z)throw W}}}).call(this)},filter:re,flatMap:function(K,X){const te=D.call(this,K,X);return Me(function*(){var W,ee=!1,Z=!1;try{for(var se,ue=Oe(te);ee=!(se=yield xe(ue.next())).done;ee=!1){const me=se.value;yield*$e(Oe(me),xe)}}catch(me){Z=!0,W=me}finally{try{ee&&null!=ue.return&&(yield xe(ue.return()))}finally{if(Z)throw W}}}).call(this)},map:D,take:function(K,X){return null!=X&&y(X,"options"),null!=(null==X?void 0:X.signal)&&i(X.signal,"options.signal"),K=ie(K),Me(function*(){var te;if(null!=X&&null!==(te=X.signal)&&void 0!==te&&te.aborted)throw new e;var W,ee=!1,Z=!1;try{for(var se,ue=Oe(this);ee=!(se=yield xe(ue.next())).done;ee=!1){const ve=se.value;var me;if(null!=X&&null!==(me=X.signal)&&void 0!==me&&me.aborted)throw new e;if(!(K-- >0))return;yield ve}}catch(ve){Z=!0,W=ve}finally{try{ee&&null!=ue.return&&(yield xe(ue.return()))}finally{if(Z)throw W}}}).call(this)},compose:function(K,X){if(null!=X&&y(X,"options"),null!=(null==X?void 0:X.signal)&&i(X.signal,"options.signal"),_(K)&&!v(K))throw new c("stream",K,"must be writable");const te=E(this,K);return null!=X&&X.signal&&A(X.signal,te),te}},C.exports.promiseReturningOperators={every:(K=Ie(function*(X,te){if("function"!=typeof X)throw new d("fn",["Function","AsyncFunction"],X);return!(yield ge.call(this,Ie(function*(...ee){return!(yield X(...ee))}),te))}),function(te){return K.apply(this,arguments)}),forEach:function(){var K=Ie(function*(X,te){if("function"!=typeof X)throw new d("fn",["Function","AsyncFunction"],X);var W,ee=!1,Z=!1;try{for(var ue=Oe(D.call(this,function(){var me=Ie(function*(ve,Se){return yield X(ve,Se),T});return function(ve,Se){return me.apply(this,arguments)}}(),te));ee=!(yield ue.next()).done;ee=!1);}catch(me){Z=!0,W=me}finally{try{ee&&null!=ue.return&&(yield ue.return())}finally{if(Z)throw W}}});return function(te,ee){return K.apply(this,arguments)}}(),reduce:function(){var K=Ie(function*(X,te,ee){var Z;if("function"!=typeof X)throw new d("reducer",["Function","AsyncFunction"],X);null!=ee&&y(ee,"options"),null!=(null==ee?void 0:ee.signal)&&i(ee.signal,"options.signal");let W=arguments.length>1;if(null!=ee&&null!==(Z=ee.signal)&&void 0!==Z&&Z.aborted){const $=new e(void 0,{cause:ee.signal.reason});throw this.once("error",()=>{}),yield g(this.destroy($)),$}const ue=new o,se=ue.signal;null!=ee&&ee.signal&&ee.signal.addEventListener("abort",()=>ue.abort(),{once:!0,[b]:this});let me=!1;try{var H,ve=!1,Se=!1;try{for(var ye,ce=Oe(this);ve=!(ye=yield ce.next()).done;ve=!1){const $=ye.value;var _e;if(me=!0,null!=ee&&null!==(_e=ee.signal)&&void 0!==_e&&_e.aborted)throw new e;W?te=yield X(te,$,{signal:se}):(te=$,W=!0)}}catch($){Se=!0,H=$}finally{try{ve&&null!=ce.return&&(yield ce.return())}finally{if(Se)throw H}}if(!me&&!W)throw new U}finally{ue.abort()}return te});return function(te,ee,Z){return K.apply(this,arguments)}}(),toArray:function(){var K=Ie(function*(X){null!=X&&y(X,"options"),null!=(null==X?void 0:X.signal)&&i(X.signal,"options.signal");const te=[];var W,ee=!1,Z=!1;try{for(var se,ue=Oe(this);ee=!(se=yield ue.next()).done;ee=!1){const ve=se.value;var me;if(null!=X&&null!==(me=X.signal)&&void 0!==me&&me.aborted)throw new e(void 0,{cause:X.signal.reason});P(te,ve)}}catch(ve){Z=!0,W=ve}finally{try{ee&&null!=ue.return&&(yield ue.return())}finally{if(Z)throw W}}return te});return function(te){return K.apply(this,arguments)}}(),some:ge,find:function(){var K=Ie(function*(X,te){var W,ee=!1,Z=!1;try{for(var se,ue=Oe(re.call(this,X,te));ee=!(se=yield ue.next()).done;ee=!1)return se.value}catch(me){Z=!0,W=me}finally{try{ee&&null!=ue.return&&(yield ue.return())}finally{if(Z)throw W}}});return function(te,ee){return K.apply(this,arguments)}}()}},917:(C,t,n)=>{"use strict";const{ObjectSetPrototypeOf:o}=n(9061);C.exports=d;const c=n(1161);function d(p){if(!(this instanceof d))return new d(p);c.call(this,p)}o(d.prototype,c.prototype),o(d,c),d.prototype._transform=function(p,s,e){e(null,p)}},9946:(C,t,n)=>{const o=n(4155),{ArrayIsArray:c,Promise:d,SymbolAsyncIterator:p}=n(9061),s=n(8610),{once:e}=n(6087),i=n(1195),a=n(8672),{aggregateTwoErrors:y,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:E,ERR_STREAM_DESTROYED:A,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:_}=n(4381),{validateFunction:P,validateAbortSignal:O}=n(6547),{isIterable:L,isReadable:I,isReadableNodeStream:k,isNodeStream:F,isTransformStream:G,isWebStream:B,isReadableStream:T,isReadableEnded:Q}=n(5874),D=globalThis.AbortController||n(8599).AbortController;let ge,we;function re(W,ue,se){let me=!1;return W.on("close",()=>{me=!0}),{destroy:ve=>{me||(me=!0,i.destroyer(W,ve||new A("pipe")))},cleanup:s(W,{readable:ue,writable:se},ve=>{me=!ve})}}function U(W){if(L(W))return W;if(k(W))return(ue=Me(function*(se){we||(we=n(911)),yield*$e(Oe(we.prototype[p].call(se)),xe)}),function(se){return ue.apply(this,arguments)})(W);var ue;throw new b("val",["Readable","Iterable","AsyncIterable"],W)}function ie(W,ue,se,me){return K.apply(this,arguments)}function K(){return(K=Ie(function*(W,ue,se,{end:me}){let ve,Se=null;const H=de=>{if(de&&(ve=de),Se){const r=Se;Se=null,r()}},ce=()=>new d((de,r)=>{ve?r(ve):Se=()=>{ve?r(ve):de()}});ue.on("drain",H);const ye=s(ue,{readable:!1},H);try{ue.writableNeedDrain&&(yield ce());var z,_e=!1,$=!1;try{for(var fe,ae=Oe(W);_e=!(fe=yield ae.next()).done;_e=!1)ue.write(fe.value)||(yield ce())}catch(de){$=!0,z=de}finally{try{_e&&null!=ae.return&&(yield ae.return())}finally{if($)throw z}}me&&ue.end(),yield ce(),se()}catch(de){se(ve!==de?y(ve,de):de)}finally{ye(),ue.off("drain",H)}})).apply(this,arguments)}function X(W,ue,se,me){return te.apply(this,arguments)}function te(){return(te=Ie(function*(W,ue,se,{end:me}){G(ue)&&(ue=ue.writable);const ve=ue.getWriter();try{var ce,Se=!1,H=!1;try{for(var _e,ye=Oe(W);Se=!(_e=yield ye.next()).done;Se=!1){const $=_e.value;yield ve.ready,ve.write($).catch(()=>{})}}catch($){H=!0,ce=$}finally{try{Se&&null!=ye.return&&(yield ye.return())}finally{if(H)throw ce}}yield ve.ready,me&&(yield ve.close()),se()}catch($){try{yield ve.abort($),se($)}catch(z){se(z)}}})).apply(this,arguments)}function ee(W,ue,se){if(1===W.length&&c(W[0])&&(W=W[0]),W.length<2)throw new E("streams");const me=new D,ve=me.signal,Se=null==se?void 0:se.signal,H=[];function ce(){de(new _)}let ye,_e;O(Se,"options.signal"),null==Se||Se.addEventListener("abort",ce);const $=[];let z,ae=0;function fe(M){de(M,0==--ae)}function de(M,f){if(!M||ye&&"ERR_STREAM_PREMATURE_CLOSE"!==ye.code||(ye=M),ye||f){for(;$.length;)$.shift()(ye);null==Se||Se.removeEventListener("abort",ce),me.abort(),f&&(ye||H.forEach(m=>m()),o.nextTick(ue,ye,_e))}}for(let M=0;M0,S=m||!1!==(null==se?void 0:se.end),N=M===W.length-1;if(F(f)){let j=function(J){J&&"AbortError"!==J.name&&"ERR_STREAM_PREMATURE_CLOSE"!==J.code&&fe(J)};if(S){const{destroy:J,cleanup:le}=re(f,m,V);$.push(J),I(f)&&N&&H.push(le)}f.on("error",j),I(f)&&N&&H.push(()=>{f.removeListener("error",j)})}if(0===M)if("function"==typeof f){if(z=f({signal:ve}),!L(z))throw new g("Iterable, AsyncIterable or Stream","source",z)}else z=L(f)||k(f)||G(f)?f:a.from(f);else if("function"==typeof f){var r;if(z=G(z)?U(null===(r=z)||void 0===r?void 0:r.readable):U(z),z=f(z,{signal:ve}),m){if(!L(z,!0))throw new g("AsyncIterable",`transform[${M-1}]`,z)}else{var l;ge||(ge=n(917));const j=new ge({objectMode:!0}),J=null===(l=z)||void 0===l?void 0:l.then;if("function"==typeof J)ae++,J.call(z,Ce=>{_e=Ce,null!=Ce&&j.write(Ce),S&&j.end(),o.nextTick(fe)},Ce=>{j.destroy(Ce),o.nextTick(fe,Ce)});else if(L(z,!0))ae++,ie(z,j,fe,{end:S});else{if(!T(z)&&!G(z))throw new g("AsyncIterable or Promise","destination",z);ae++,ie(z.readable||z,j,fe,{end:S})}z=j;const{destroy:le,cleanup:Re}=re(z,!1,!0);$.push(le),N&&H.push(Re)}}else if(F(f)){if(k(z)){ae+=2;const j=Z(z,f,fe,{end:S});I(f)&&N&&H.push(j)}else if(G(z)||T(z))ae++,ie(z.readable||z,f,fe,{end:S});else{if(!L(z))throw new b("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],z);ae++,ie(z,f,fe,{end:S})}z=f}else if(B(f)){if(k(z))ae++,X(U(z),f,fe,{end:S});else if(T(z)||L(z))ae++,X(z,f,fe,{end:S});else{if(!G(z))throw new b("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],z);ae++,X(z.readable,f,fe,{end:S})}z=f}else z=a.from(f)}return(null!=ve&&ve.aborted||null!=Se&&Se.aborted)&&o.nextTick(ce),z}function Z(W,ue,se,{end:me}){let ve=!1;if(ue.on("close",()=>{ve||se(new v)}),W.pipe(ue,{end:!1}),me){let H=function(){ve=!0,ue.end()};Q(W)?o.nextTick(H):W.once("end",H)}else se();return s(W,{readable:!0,writable:!1},H=>{const ce=W._readableState;H&&"ERR_STREAM_PREMATURE_CLOSE"===H.code&&ce&&ce.ended&&!ce.errored&&!ce.errorEmitted?W.once("end",se).once("error",se):se(H)}),s(ue,{readable:!1,writable:!0},se)}C.exports={pipelineImpl:ee,pipeline:function(...W){return ee(W,e((P((ue=W)[ue.length-1],"streams[stream.length - 1]"),ue.pop())));var ue}}},911:(C,t,n)=>{const o=n(4155),{ArrayPrototypeIndexOf:c,NumberIsInteger:d,NumberIsNaN:p,NumberParseInt:s,ObjectDefineProperties:e,ObjectKeys:i,ObjectSetPrototypeOf:a,Promise:y,SafeSet:b,SymbolAsyncIterator:g,Symbol:E}=n(9061);C.exports=W,W.ReadableState=Z;const{EventEmitter:A}=n(7187),{Stream:v,prependListener:_}=n(4870),{Buffer:P}=n(8764),{addAbortSignal:O}=n(196),L=n(8610);let I=n(6087).debuglog("stream",f=>{I=f});const k=n(7327),F=n(1195),{getHighWaterMark:G,getDefaultHighWaterMark:B}=n(2457),{aggregateTwoErrors:T,codes:{ERR_INVALID_ARG_TYPE:Q,ERR_METHOD_NOT_IMPLEMENTED:D,ERR_OUT_OF_RANGE:ge,ERR_STREAM_PUSH_AFTER_EOF:we,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:re}}=n(4381),{validateObject:U}=n(6547),ie=E("kPaused"),{StringDecoder:K}=n(2553),X=n(6307);a(W.prototype,v.prototype),a(W,v);const te=()=>{},{errorOrDestroy:ee}=F;function Z(f,m,V){"boolean"!=typeof V&&(V=m instanceof n(8672)),this.objectMode=!(!f||!f.objectMode),V&&(this.objectMode=this.objectMode||!(!f||!f.readableObjectMode)),this.highWaterMark=f?G(this,f,"readableHighWaterMark",V):B(!1),this.buffer=new k,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[ie]=null,this.errorEmitted=!1,this.emitClose=!f||!1!==f.emitClose,this.autoDestroy=!f||!1!==f.autoDestroy,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=f&&f.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,f&&f.encoding&&(this.decoder=new K(f.encoding),this.encoding=f.encoding)}function W(f){if(!(this instanceof W))return new W(f);const m=this instanceof n(8672);this._readableState=new Z(f,this,m),f&&("function"==typeof f.read&&(this._read=f.read),"function"==typeof f.destroy&&(this._destroy=f.destroy),"function"==typeof f.construct&&(this._construct=f.construct),f.signal&&!m&&O(f.signal,this)),v.call(this,f),F.construct(this,()=>{this._readableState.needReadable&&H(this,this._readableState)})}function ue(f,m,V,S){I("readableAddChunk",m);const N=f._readableState;let j;if(N.objectMode||("string"==typeof m?N.encoding!==(V=V||N.defaultEncoding)&&(S&&N.encoding?m=P.from(m,V).toString(N.encoding):(m=P.from(m,V),V="")):m instanceof P?V="":v._isUint8Array(m)?(m=v._uint8ArrayToBuffer(m),V=""):null!=m&&(j=new Q("chunk",["string","Buffer","Uint8Array"],m))),j)ee(f,j);else if(null===m)N.reading=!1,function(J,le){if(I("onEofChunk"),!le.ended){if(le.decoder){const Re=le.decoder.end();Re&&Re.length&&(le.buffer.push(Re),le.length+=le.objectMode?1:Re.length)}le.ended=!0,le.sync?ve(J):(le.needReadable=!1,le.emittedReadable=!0,Se(J))}}(f,N);else if(N.objectMode||m&&m.length>0)if(S)if(N.endEmitted)ee(f,new re);else{if(N.destroyed||N.errored)return!1;se(f,N,m,!0)}else if(N.ended)ee(f,new we);else{if(N.destroyed||N.errored)return!1;N.reading=!1,N.decoder&&!V?(m=N.decoder.write(m),N.objectMode||0!==m.length?se(f,N,m,!1):H(f,N)):se(f,N,m,!1)}else S||(N.reading=!1,H(f,N));return!N.ended&&(N.length0?(m.multiAwaitDrain?m.awaitDrainWriters.clear():m.awaitDrainWriters=null,m.dataEmitted=!0,f.emit("data",V)):(m.length+=m.objectMode?1:V.length,S?m.buffer.unshift(V):m.buffer.push(V),m.needReadable&&ve(f)),H(f,m)}function me(f,m){return f<=0||0===m.length&&m.ended?0:m.objectMode?1:p(f)?m.flowing&&m.length?m.buffer.first().length:m.length:f<=m.length?f:m.ended?m.length:0}function ve(f){const m=f._readableState;I("emitReadable",m.needReadable,m.emittedReadable),m.needReadable=!1,m.emittedReadable||(I("emitReadable",m.flowing),m.emittedReadable=!0,o.nextTick(Se,f))}function Se(f){const m=f._readableState;I("emitReadable_",m.destroyed,m.length,m.ended),m.destroyed||m.errored||!m.length&&!m.ended||(f.emit("readable"),m.emittedReadable=!1),m.needReadable=!m.flowing&&!m.ended&&m.length<=m.highWaterMark,z(f)}function H(f,m){!m.readingMore&&m.constructed&&(m.readingMore=!0,o.nextTick(ce,f,m))}function ce(f,m){for(;!m.reading&&!m.ended&&(m.length0,m.resumeScheduled&&!1===m[ie]?m.flowing=!0:f.listenerCount("data")>0?f.resume():m.readableListening||(m.flowing=null)}function _e(f){I("readable nexttick read 0"),f.read(0)}function $(f,m){I("resume",m.reading),m.reading||f.read(0),m.resumeScheduled=!1,f.emit("resume"),z(f),m.flowing&&!m.reading&&f.read(0)}function z(f){const m=f._readableState;for(I("flow",m.flowing);m.flowing&&null!==f.read(););}function ae(f,m){"function"!=typeof f.read&&(f=W.wrap(f,{objectMode:!0}));const V=(S=Me(function*(N,j){let J,le=te;function Re(Pe){this===N?(le(),le=te):le=Pe}N.on("readable",Re);const Ce=L(N,{writable:!1},Pe=>{J=Pe?T(J,Pe):null,le(),le=te});try{for(;;){const Pe=N.destroyed?null:N.read();if(null!==Pe)yield Pe;else{if(J)throw J;if(null===J)return;yield xe(new y(Re))}}}catch(Pe){throw J=T(J,Pe),J}finally{!J&&!1===(null==j?void 0:j.destroyOnReturn)||void 0!==J&&!N._readableState.autoDestroy?(N.off("readable",Re),Ce()):F.destroyer(N,null)}}),function(N,j){return S.apply(this,arguments)})(f,m);var S;return V.stream=f,V}function fe(f,m){if(0===m.length)return null;let V;return m.objectMode?V=m.buffer.shift():!f||f>=m.length?(V=m.decoder?m.buffer.join(""):1===m.buffer.length?m.buffer.first():m.buffer.concat(m.length),m.buffer.clear()):V=m.buffer.consume(f,m.decoder),V}function de(f){const m=f._readableState;I("endReadable",m.endEmitted),m.endEmitted||(m.ended=!0,o.nextTick(r,m,f))}function r(f,m){if(I("endReadableNT",f.endEmitted,f.length),!f.errored&&!f.closeEmitted&&!f.endEmitted&&0===f.length)if(f.endEmitted=!0,m.emit("end"),m.writable&&!1===m.allowHalfOpen)o.nextTick(l,m);else if(f.autoDestroy){const V=m._writableState;(!V||V.autoDestroy&&(V.finished||!1===V.writable))&&m.destroy()}}function l(f){f.writable&&!f.writableEnded&&!f.destroyed&&f.end()}let h;function M(){return void 0===h&&(h={}),h}W.prototype.destroy=F.destroy,W.prototype._undestroy=F.undestroy,W.prototype._destroy=function(f,m){m(f)},W.prototype[A.captureRejectionSymbol]=function(f){this.destroy(f)},W.prototype.push=function(f,m){return ue(this,f,m,!1)},W.prototype.unshift=function(f,m){return ue(this,f,m,!0)},W.prototype.isPaused=function(){const f=this._readableState;return!0===f[ie]||!1===f.flowing},W.prototype.setEncoding=function(f){const m=new K(f);this._readableState.decoder=m,this._readableState.encoding=this._readableState.decoder.encoding;const V=this._readableState.buffer;let S="";for(const N of V)S+=m.write(N);return V.clear(),""!==S&&V.push(S),this._readableState.length=S.length,this},W.prototype.read=function(f){I("read",f),void 0===f?f=NaN:d(f)||(f=s(f,10));const m=this._readableState,V=f;if(f>m.highWaterMark&&(m.highWaterMark=function(j){if(j>1073741824)throw new ge("size","<= 1GiB",j);return j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,++j}(f)),0!==f&&(m.emittedReadable=!1),0===f&&m.needReadable&&((0!==m.highWaterMark?m.length>=m.highWaterMark:m.length>0)||m.ended))return I("read: emitReadable",m.length,m.ended),0===m.length&&m.ended?de(this):ve(this),null;if(0===(f=me(f,m))&&m.ended)return 0===m.length&&de(this),null;let S,N=m.needReadable;if(I("need readable",N),(0===m.length||m.length-f0?fe(f,m):null,null===S?(m.needReadable=m.length<=m.highWaterMark,f=0):(m.length-=f,m.multiAwaitDrain?m.awaitDrainWriters.clear():m.awaitDrainWriters=null),0===m.length&&(m.ended||(m.needReadable=!0),V!==f&&m.ended&&de(this)),null===S||m.errorEmitted||m.closeEmitted||(m.dataEmitted=!0,this.emit("data",S)),S},W.prototype._read=function(f){throw new D("_read()")},W.prototype.pipe=function(f,m){const V=this,S=this._readableState;1===S.pipes.length&&(S.multiAwaitDrain||(S.multiAwaitDrain=!0,S.awaitDrainWriters=new b(S.awaitDrainWriters?[S.awaitDrainWriters]:[]))),S.pipes.push(f),I("pipe count=%d opts=%j",S.pipes.length,m);const N=m&&!1===m.end||f===o.stdout||f===o.stderr?We:j;function j(){I("onend"),f.end()}let J;S.endEmitted?o.nextTick(N):V.once("end",N),f.on("unpipe",function Ve(Je,He){I("onunpipe"),Je===V&&He&&!1===He.hasUnpiped&&(He.hasUnpiped=!0,I("cleanup"),f.removeListener("close",ke),f.removeListener("finish",De),J&&f.removeListener("drain",J),f.removeListener("error",Pe),f.removeListener("unpipe",Ve),V.removeListener("end",j),V.removeListener("end",We),V.removeListener("data",Ce),le=!0,J&&S.awaitDrainWriters&&(!f._writableState||f._writableState.needDrain)&&J())});let le=!1;function Re(){var Ve,Je;le||(1===S.pipes.length&&S.pipes[0]===f?(I("false write response, pause",0),S.awaitDrainWriters=f,S.multiAwaitDrain=!1):S.pipes.length>1&&S.pipes.includes(f)&&(I("false write response, pause",S.awaitDrainWriters.size),S.awaitDrainWriters.add(f)),V.pause()),J||(Ve=V,Je=f,J=function(){const He=Ve._readableState;He.awaitDrainWriters===Je?(I("pipeOnDrain",1),He.awaitDrainWriters=null):He.multiAwaitDrain&&(I("pipeOnDrain",He.awaitDrainWriters.size),He.awaitDrainWriters.delete(Je)),He.awaitDrainWriters&&0!==He.awaitDrainWriters.size||!Ve.listenerCount("data")||Ve.resume()},f.on("drain",J))}function Ce(Ve){I("ondata");const Je=f.write(Ve);I("dest.write",Je),!1===Je&&Re()}function Pe(Ve){if(I("onerror",Ve),We(),f.removeListener("error",Pe),0===f.listenerCount("error")){const Je=f._writableState||f._readableState;Je&&!Je.errorEmitted?ee(f,Ve):f.emit("error",Ve)}}function ke(){f.removeListener("finish",De),We()}function De(){I("onfinish"),f.removeListener("close",ke),We()}function We(){I("unpipe"),V.unpipe(f)}return V.on("data",Ce),_(f,"error",Pe),f.once("close",ke),f.once("finish",De),f.emit("pipe",V),!0===f.writableNeedDrain?S.flowing&&Re():S.flowing||(I("pipe resume"),V.resume()),f},W.prototype.unpipe=function(f){const m=this._readableState;if(0===m.pipes.length)return this;if(!f){const S=m.pipes;m.pipes=[],this.pause();for(let N=0;N0,!1!==S.flowing&&this.resume()):"readable"===f&&(S.endEmitted||S.readableListening||(S.readableListening=S.needReadable=!0,S.flowing=!1,S.emittedReadable=!1,I("on readable",S.length,S.reading),S.length?ve(this):S.reading||o.nextTick(_e,this))),V},W.prototype.off=W.prototype.removeListener=function(f,m){const V=v.prototype.removeListener.call(this,f,m);return"readable"===f&&o.nextTick(ye,this),V},W.prototype.removeAllListeners=function(f){const m=v.prototype.removeAllListeners.apply(this,arguments);return"readable"!==f&&void 0!==f||o.nextTick(ye,this),m},W.prototype.resume=function(){const f=this._readableState;return f.flowing||(I("resume"),f.flowing=!f.readableListening,this,(V=f).resumeScheduled||(V.resumeScheduled=!0,o.nextTick($,this,V))),f[ie]=!1,this;var V},W.prototype.pause=function(){return I("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(I("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ie]=!0,this},W.prototype.wrap=function(f){let m=!1;f.on("data",S=>{!this.push(S)&&f.pause&&(m=!0,f.pause())}),f.on("end",()=>{this.push(null)}),f.on("error",S=>{ee(this,S)}),f.on("close",()=>{this.destroy()}),f.on("destroy",()=>{this.destroy()}),this._read=()=>{m&&f.resume&&(m=!1,f.resume())};const V=i(f);for(let S=1;S{"use strict";const{MathFloor:o,NumberIsInteger:c}=n(9061),{ERR_INVALID_ARG_VALUE:d}=n(4381).codes;function p(s){return s?16:16384}C.exports={getHighWaterMark:function(s,e,i,a){const y=null!=(b=e).highWaterMark?b.highWaterMark:a?b[i]:null;var b;if(null!=y){if(!c(y)||y<0)throw new d(a?`options.${i}`:"options.highWaterMark",y);return o(y)}return p(s.objectMode)},getDefaultHighWaterMark:p}},1161:(C,t,n)=>{"use strict";const{ObjectSetPrototypeOf:o,Symbol:c}=n(9061);C.exports=i;const{ERR_METHOD_NOT_IMPLEMENTED:d}=n(4381).codes,p=n(8672),{getHighWaterMark:s}=n(2457);o(i.prototype,p.prototype),o(i,p);const e=c("kCallback");function i(b){if(!(this instanceof i))return new i(b);const g=b?s(this,b,"readableHighWaterMark",!0):null;0===g&&(b={...b,highWaterMark:null,readableHighWaterMark:g,writableHighWaterMark:b.writableHighWaterMark||0}),p.call(this,b),this._readableState.sync=!1,this[e]=null,b&&("function"==typeof b.transform&&(this._transform=b.transform),"function"==typeof b.flush&&(this._flush=b.flush)),this.on("prefinish",y)}function a(b){"function"!=typeof this._flush||this.destroyed?(this.push(null),b&&b()):this._flush((g,E)=>{g?b?b(g):this.destroy(g):(null!=E&&this.push(E),this.push(null),b&&b())})}function y(){this._final!==a&&a.call(this)}i.prototype._final=a,i.prototype._transform=function(b,g,E){throw new d("_transform()")},i.prototype._write=function(b,g,E){const A=this._readableState,v=this._writableState,_=A.length;this._transform(b,g,(P,O)=>{P?E(P):(null!=O&&this.push(O),v.ended||_===A.length||A.length{"use strict";const{Symbol:o,SymbolAsyncIterator:c,SymbolIterator:d,SymbolFor:p}=n(9061),s=o("kDestroyed"),e=o("kIsErrored"),i=o("kIsReadable"),a=o("kIsDisturbed"),y=p("nodejs.webstream.isClosedPromise"),b=p("nodejs.webstream.controllerErrorFunction");function g(T,Q=!1){var D;return!(!T||"function"!=typeof T.pipe||"function"!=typeof T.on||Q&&("function"!=typeof T.pause||"function"!=typeof T.resume)||T._writableState&&!1===(null===(D=T._readableState)||void 0===D?void 0:D.readable)||T._writableState&&!T._readableState)}function E(T){var Q;return!(!T||"function"!=typeof T.write||"function"!=typeof T.on||T._readableState&&!1===(null===(Q=T._writableState)||void 0===Q?void 0:Q.writable))}function A(T){return T&&(T._readableState||T._writableState||"function"==typeof T.write&&"function"==typeof T.on||"function"==typeof T.pipe&&"function"==typeof T.on)}function v(T){return!(!T||A(T)||"function"!=typeof T.pipeThrough||"function"!=typeof T.getReader||"function"!=typeof T.cancel)}function _(T){return!(!T||A(T)||"function"!=typeof T.getWriter||"function"!=typeof T.abort)}function P(T){return!(!T||A(T)||"object"!=typeof T.readable||"object"!=typeof T.writable)}function O(T){if(!A(T))return null;const ge=T._writableState||T._readableState;return!!(T.destroyed||T[s]||null!=ge&&ge.destroyed)}function L(T){if(!E(T))return null;if(!0===T.writableEnded)return!0;const Q=T._writableState;return(null==Q||!Q.errored)&&("boolean"!=typeof(null==Q?void 0:Q.ended)?null:Q.ended)}function I(T,Q){if(!g(T))return null;const D=T._readableState;return(null==D||!D.errored)&&("boolean"!=typeof(null==D?void 0:D.endEmitted)?null:!!(D.endEmitted||!1===Q&&!0===D.ended&&0===D.length))}function k(T){return T&&null!=T[i]?T[i]:"boolean"!=typeof(null==T?void 0:T.readable)?null:!O(T)&&g(T)&&T.readable&&!I(T)}function F(T){return"boolean"!=typeof(null==T?void 0:T.writable)?null:!O(T)&&E(T)&&T.writable&&!L(T)}function G(T){return"boolean"==typeof T._closed&&"boolean"==typeof T._defaultKeepAlive&&"boolean"==typeof T._removedConnection&&"boolean"==typeof T._removedContLen}function B(T){return"boolean"==typeof T._sent100&&G(T)}C.exports={kDestroyed:s,isDisturbed:function(T){var Q;return!(!T||!(null!==(Q=T[a])&&void 0!==Q?Q:T.readableDidRead||T.readableAborted))},kIsDisturbed:a,isErrored:function(T){var Q,D,ge,we,re,U,ie,K,X,te;return!(!T||!(null!==(Q=null!==(D=null!==(ge=null!==(we=null!==(re=null!==(U=T[e])&&void 0!==U?U:T.readableErrored)&&void 0!==re?re:T.writableErrored)&&void 0!==we?we:null===(ie=T._readableState)||void 0===ie?void 0:ie.errorEmitted)&&void 0!==ge?ge:null===(K=T._writableState)||void 0===K?void 0:K.errorEmitted)&&void 0!==D?D:null===(X=T._readableState)||void 0===X?void 0:X.errored)&&void 0!==Q?Q:null===(te=T._writableState)||void 0===te?void 0:te.errored))},kIsErrored:e,isReadable:k,kIsReadable:i,kIsClosedPromise:y,kControllerErrorFunction:b,isClosed:function(T){if(!A(T))return null;if("boolean"==typeof T.closed)return T.closed;const Q=T._writableState,D=T._readableState;return"boolean"==typeof(null==Q?void 0:Q.closed)||"boolean"==typeof(null==D?void 0:D.closed)?(null==Q?void 0:Q.closed)||(null==D?void 0:D.closed):"boolean"==typeof T._closed&&G(T)?T._closed:null},isDestroyed:O,isDuplexNodeStream:function(T){return!(!T||"function"!=typeof T.pipe||!T._readableState||"function"!=typeof T.on||"function"!=typeof T.write)},isFinished:function(T,Q){return A(T)?!(!O(T)&&(!1!==(null==Q?void 0:Q.readable)&&k(T)||!1!==(null==Q?void 0:Q.writable)&&F(T))):null},isIterable:function(T,Q){return null!=T&&(!0===Q?"function"==typeof T[c]:!1===Q?"function"==typeof T[d]:"function"==typeof T[c]||"function"==typeof T[d])},isReadableNodeStream:g,isReadableStream:v,isReadableEnded:function(T){if(!g(T))return null;if(!0===T.readableEnded)return!0;const Q=T._readableState;return!(!Q||Q.errored)&&("boolean"!=typeof(null==Q?void 0:Q.ended)?null:Q.ended)},isReadableFinished:I,isReadableErrored:function(T){var Q,D;return A(T)?T.readableErrored?T.readableErrored:null!==(Q=null===(D=T._readableState)||void 0===D?void 0:D.errored)&&void 0!==Q?Q:null:null},isNodeStream:A,isWebStream:function(T){return v(T)||_(T)||P(T)},isWritable:F,isWritableNodeStream:E,isWritableStream:_,isWritableEnded:L,isWritableFinished:function(T,Q){if(!E(T))return null;if(!0===T.writableFinished)return!0;const D=T._writableState;return(null==D||!D.errored)&&("boolean"!=typeof(null==D?void 0:D.finished)?null:!!(D.finished||!1===Q&&!0===D.ended&&0===D.length))},isWritableErrored:function(T){var Q,D;return A(T)?T.writableErrored?T.writableErrored:null!==(Q=null===(D=T._writableState)||void 0===D?void 0:D.errored)&&void 0!==Q?Q:null:null},isServerRequest:function(T){var Q;return"boolean"==typeof T._consuming&&"boolean"==typeof T._dumped&&void 0===(null===(Q=T.req)||void 0===Q?void 0:Q.upgradeOrConnect)},isServerResponse:B,willEmitClose:function(T){if(!A(T))return null;const ge=T._writableState||T._readableState;return!ge&&B(T)||!!(ge&&ge.autoDestroy&&ge.emitClose&&!1===ge.closed)},isTransformStream:P}},6304:(C,t,n)=>{const o=n(4155),{ArrayPrototypeSlice:c,Error:d,FunctionPrototypeSymbolHasInstance:p,ObjectDefineProperty:s,ObjectDefineProperties:e,ObjectSetPrototypeOf:i,StringPrototypeToLowerCase:a,Symbol:y,SymbolHasInstance:b}=n(9061);C.exports=K,K.WritableState=U;const{EventEmitter:g}=n(7187),E=n(4870).Stream,{Buffer:A}=n(8764),v=n(1195),{addAbortSignal:_}=n(196),{getHighWaterMark:P,getDefaultHighWaterMark:O}=n(2457),{ERR_INVALID_ARG_TYPE:L,ERR_METHOD_NOT_IMPLEMENTED:I,ERR_MULTIPLE_CALLBACK:k,ERR_STREAM_CANNOT_PIPE:F,ERR_STREAM_DESTROYED:G,ERR_STREAM_ALREADY_FINISHED:B,ERR_STREAM_NULL_VALUES:T,ERR_STREAM_WRITE_AFTER_END:Q,ERR_UNKNOWN_ENCODING:D}=n(4381).codes,{errorOrDestroy:ge}=v;function we(){}i(K.prototype,E.prototype),i(K,E);const re=y("kOnFinished");function U($,z,ae){"boolean"!=typeof ae&&(ae=z instanceof n(8672)),this.objectMode=!(!$||!$.objectMode),ae&&(this.objectMode=this.objectMode||!(!$||!$.writableObjectMode)),this.highWaterMark=$?P(this,$,"writableHighWaterMark",ae):O(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!($&&!1===$.decodeStrings),this.defaultEncoding=$&&$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Z.bind(void 0,z),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ie(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!$||!1!==$.emitClose,this.autoDestroy=!$||!1!==$.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[re]=[]}function ie($){$.buffered=[],$.bufferedIndex=0,$.allBuffers=!0,$.allNoop=!0}function K($){const z=this instanceof n(8672);if(!z&&!p(K,this))return new K($);this._writableState=new U($,this,z),$&&("function"==typeof $.write&&(this._write=$.write),"function"==typeof $.writev&&(this._writev=$.writev),"function"==typeof $.destroy&&(this._destroy=$.destroy),"function"==typeof $.final&&(this._final=$.final),"function"==typeof $.construct&&(this._construct=$.construct),$.signal&&_($.signal,this)),E.call(this,$),v.construct(this,()=>{const ae=this._writableState;ae.writing||me(this,ae),Se(this,ae)})}function X($,z,ae,fe){const de=$._writableState;if("function"==typeof ae)fe=ae,ae=de.defaultEncoding;else{if(ae){if("buffer"!==ae&&!A.isEncoding(ae))throw new D(ae)}else ae=de.defaultEncoding;"function"!=typeof fe&&(fe=we)}if(null===z)throw new T;if(!de.objectMode)if("string"==typeof z)!1!==de.decodeStrings&&(z=A.from(z,ae),ae="buffer");else if(z instanceof A)ae="buffer";else{if(!E._isUint8Array(z))throw new L("chunk",["string","Buffer","Uint8Array"],z);z=E._uint8ArrayToBuffer(z),ae="buffer"}let r;return de.ending?r=new Q:de.destroyed&&(r=new G("write")),r?(o.nextTick(fe,r),ge($,r,!0),r):(de.pendingcb++,function(l,h,M,f,m){const V=h.objectMode?1:M.length;h.length+=V;const S=h.lengthae.bufferedIndex&&me($,ae),fe?null!==ae.afterWriteTickInfo&&ae.afterWriteTickInfo.cb===de?ae.afterWriteTickInfo.count++:(ae.afterWriteTickInfo={count:1,cb:de,stream:$,state:ae},o.nextTick(W,ae.afterWriteTickInfo)):ue($,ae,1,de))):ge($,new k)}function W({stream:$,state:z,count:ae,cb:fe}){return z.afterWriteTickInfo=null,ue($,z,ae,fe)}function ue($,z,ae,fe){for(!z.ending&&!$.destroyed&&0===z.length&&z.needDrain&&(z.needDrain=!1,$.emit("drain"));ae-- >0;)z.pendingcb--,fe();z.destroyed&&se(z),Se($,z)}function se($){if($.writing)return;for(let de=$.bufferedIndex;de<$.buffered.length;++de){var z;const{chunk:r,callback:l}=$.buffered[de];$.length-=$.objectMode?1:r.length,l(null!==(z=$.errored)&&void 0!==z?z:new G("write"))}const ae=$[re].splice(0);for(let de=0;de1&&$._writev){z.pendingcb-=r-1;const h=z.allNoop?we:f=>{for(let m=l;m256?(ae.splice(0,l),z.bufferedIndex=0):z.bufferedIndex=l}z.bufferProcessing=!1}function ve($){return $.ending&&!$.destroyed&&$.constructed&&0===$.length&&!$.errored&&0===$.buffered.length&&!$.finished&&!$.writing&&!$.errorEmitted&&!$.closeEmitted}function Se($,z,ae){var fe,de;ve(z)&&(fe=$,(de=z).prefinished||de.finalCalled||("function"!=typeof fe._final||de.destroyed?(de.prefinished=!0,fe.emit("prefinish")):(de.finalCalled=!0,function(r,l){let h=!1;function M(f){if(h)ge(r,f??k());else if(h=!0,l.pendingcb--,f){const m=l[re].splice(0);for(let V=0;V{ve(de)?H(fe,de):de.pendingcb--},$,z)):ve(z)&&(z.pendingcb++,H($,z))))}function H($,z){z.pendingcb--,z.finished=!0;const ae=z[re].splice(0);for(let fe=0;fe{"use strict";const{ArrayIsArray:o,ArrayPrototypeIncludes:c,ArrayPrototypeJoin:d,ArrayPrototypeMap:p,NumberIsInteger:s,NumberIsNaN:e,NumberMAX_SAFE_INTEGER:i,NumberMIN_SAFE_INTEGER:a,NumberParseInt:y,ObjectPrototypeHasOwnProperty:b,RegExpPrototypeExec:g,String:E,StringPrototypeToUpperCase:A,StringPrototypeTrim:v}=n(9061),{hideStackFrames:_,codes:{ERR_SOCKET_BAD_PORT:P,ERR_INVALID_ARG_TYPE:O,ERR_INVALID_ARG_VALUE:L,ERR_OUT_OF_RANGE:I,ERR_UNKNOWN_SIGNAL:k}}=n(4381),{normalizeEncoding:F}=n(6087),{isAsyncFunction:G,isArrayBufferView:B}=n(6087).types,T={},Q=/^[0-7]+$/,D=_((H,ce,ye=a,_e=i)=>{if("number"!=typeof H)throw new O(ce,"number",H);if(!s(H))throw new I(ce,"an integer",H);if(H_e)throw new I(ce,`>= ${ye} && <= ${_e}`,H)}),ge=_((H,ce,ye=-2147483648,_e=2147483647)=>{if("number"!=typeof H)throw new O(ce,"number",H);if(!s(H))throw new I(ce,"an integer",H);if(H_e)throw new I(ce,`>= ${ye} && <= ${_e}`,H)}),we=_((H,ce,ye=!1)=>{if("number"!=typeof H)throw new O(ce,"number",H);if(!s(H))throw new I(ce,"an integer",H);const _e=ye?1:0,$=4294967295;if(H<_e||H>$)throw new I(ce,`>= ${_e} && <= ${$}`,H)});function re(H,ce){if("string"!=typeof H)throw new O(ce,"string",H)}const U=_((H,ce,ye)=>{if(!c(ye,H)){const _e=d(p(ye,$=>"string"==typeof $?`'${$}'`:E($)),", ");throw new L(ce,H,"must be one of: "+_e)}});function ie(H,ce){if("boolean"!=typeof H)throw new O(ce,"boolean",H)}function K(H,ce,ye){return null!=H&&b(H,ce)?H[ce]:ye}const X=_((H,ce,ye=null)=>{const _e=K(ye,"allowArray",!1),$=K(ye,"allowFunction",!1);if(!K(ye,"nullable",!1)&&null===H||!_e&&o(H)||"object"!=typeof H&&(!$||"function"!=typeof H))throw new O(ce,"Object",H)}),te=_((H,ce)=>{if(null!=H&&"object"!=typeof H&&"function"!=typeof H)throw new O(ce,"a dictionary",H)}),ee=_((H,ce,ye=0)=>{if(!o(H))throw new O(ce,"Array",H);if(H.length{if(!B(H))throw new O(ce,["Buffer","TypedArray","DataView"],H)}),W=_((H,ce)=>{if(void 0!==H&&(null===H||"object"!=typeof H||!("aborted"in H)))throw new O(ce,"AbortSignal",H)}),ue=_((H,ce)=>{if("function"!=typeof H)throw new O(ce,"Function",H)}),se=_((H,ce)=>{if("function"!=typeof H||G(H))throw new O(ce,"Function",H)}),me=_((H,ce)=>{if(void 0!==H)throw new O(ce,"undefined",H)}),ve=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Se(H,ce){if(void 0===H||!g(ve,H))throw new L(ce,H,'must be an array or string of format "; rel=preload; as=style"')}C.exports={isInt32:function(H){return H===(0|H)},isUint32:function(H){return H===H>>>0},parseFileMode:function(H,ce,ye){if(void 0===H&&(H=ye),"string"==typeof H){if(null===g(Q,H))throw new L(ce,H,"must be a 32-bit unsigned integer or an octal string");H=y(H,8)}return we(H,ce),H},validateArray:ee,validateStringArray:function(H,ce){ee(H,ce);for(let ye=0;ye_e||(null!=ye||null!=_e)&&e(H))throw new I(ce,`${null!=ye?`>= ${ye}`:""}${null!=ye&&null!=_e?" && ":""}${null!=_e?`<= ${_e}`:""}`,H)},validateObject:X,validateOneOf:U,validatePlainFunction:se,validatePort:function(H,ce="Port",ye=!0){if("number"!=typeof H&&"string"!=typeof H||"string"==typeof H&&0===v(H).length||+H!=+H>>>0||H>65535||0===H&&!ye)throw new P(ce,H,ye);return 0|H},validateSignalName:function(H,ce="signal"){if(re(H,ce),void 0===T[H])throw void 0!==T[A(H)]?new k(H+" (signals must use all capital letters)"):new k(H)},validateString:re,validateUint32:we,validateUndefined:me,validateUnion:function(H,ce,ye){if(!c(ye,H))throw new O(ce,`('${d(ye,"|")}')`,H)},validateAbortSignal:W,validateLinkHeaderValue:function(H){if("string"==typeof H)return Se(H,"hints"),H;if(o(H)){const ce=H.length;let ye="";if(0===ce)return ye;for(let _e=0;_e; rel=preload; as=style"')}}},9827:(C,t,n)=>{"use strict";const o=n(5099),c=n(7854),d=o.Readable.destroy;C.exports=o.Readable,C.exports._uint8ArrayToBuffer=o._uint8ArrayToBuffer,C.exports._isUint8Array=o._isUint8Array,C.exports.isDisturbed=o.isDisturbed,C.exports.isErrored=o.isErrored,C.exports.isReadable=o.isReadable,C.exports.Readable=o.Readable,C.exports.Writable=o.Writable,C.exports.Duplex=o.Duplex,C.exports.Transform=o.Transform,C.exports.PassThrough=o.PassThrough,C.exports.addAbortSignal=o.addAbortSignal,C.exports.finished=o.finished,C.exports.destroy=o.destroy,C.exports.destroy=d,C.exports.pipeline=o.pipeline,C.exports.compose=o.compose,Object.defineProperty(o,"promises",{configurable:!0,enumerable:!0,get:()=>c}),C.exports.Stream=o.Stream,C.exports.default=C.exports},4381:(C,t,n)=>{"use strict";const{format:o,inspect:c,AggregateError:d}=n(6087),p=globalThis.AggregateError||d,s=Symbol("kIsNodeError"),e=["string","function","number","object","Function","Object","boolean","bigint","symbol"],i=/^([A-Z][a-z0-9]*)+$/,a={};function y(v,_){if(!v)throw new a.ERR_INTERNAL_ASSERTION(_)}function b(v){let _="",P=v.length;const O="-"===v[0]?1:0;for(;P>=O+4;P-=3)_=`_${v.slice(P-3,P)}${_}`;return`${v.slice(0,P)}${_}`}function g(v,_,P){P||(P=Error);class O extends P{constructor(...I){super(function(k,F,G){if("function"==typeof F)return y(F.length<=G.length,`Code: ${k}; The provided arguments length (${G.length}) does not match the required ones (${F.length}).`),F(...G);const B=(F.match(/%[dfijoOs]/g)||[]).length;return y(B===G.length,`Code: ${k}; The provided arguments length (${G.length}) does not match the required ones (${B}).`),0===G.length?F:o(F,...G)}(v,_,I))}toString(){return`${this.name} [${v}]: ${this.message}`}}Object.defineProperties(O.prototype,{name:{value:P.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${v}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),O.prototype.code=v,O.prototype[s]=!0,a[v]=O}function E(v){return Object.defineProperty(v,"name",{value:"__node_internal_"+v.name}),v}class A extends Error{constructor(_="The operation was aborted",P){if(void 0!==P&&"object"!=typeof P)throw new a.ERR_INVALID_ARG_TYPE("options","Object",P);super(_,P),this.code="ABORT_ERR",this.name="AbortError"}}g("ERR_ASSERTION","%s",Error),g("ERR_INVALID_ARG_TYPE",(v,_,P)=>{y("string"==typeof v,"'name' must be a string"),Array.isArray(_)||(_=[_]);let O="The ";v.endsWith(" argument")?O+=`${v} `:O+=`"${v}" ${v.includes(".")?"property":"argument"} `,O+="must be ";const L=[],I=[],k=[];for(const G of _)y("string"==typeof G,"All expected entries have to be of type string"),e.includes(G)?L.push(G.toLowerCase()):i.test(G)?I.push(G):(y("object"!==G,'The value "object" should be written as "Object"'),k.push(G));if(I.length>0){const G=L.indexOf("object");-1!==G&&(L.splice(L,G,1),I.push("Object"))}if(L.length>0){switch(L.length){case 1:O+=`of type ${L[0]}`;break;case 2:O+=`one of type ${L[0]} or ${L[1]}`;break;default:{const G=L.pop();O+=`one of type ${L.join(", ")}, or ${G}`}}(I.length>0||k.length>0)&&(O+=" or ")}if(I.length>0){switch(I.length){case 1:O+=`an instance of ${I[0]}`;break;case 2:O+=`an instance of ${I[0]} or ${I[1]}`;break;default:{const G=I.pop();O+=`an instance of ${I.join(", ")}, or ${G}`}}k.length>0&&(O+=" or ")}switch(k.length){case 0:break;case 1:k[0].toLowerCase()!==k[0]&&(O+="an "),O+=`${k[0]}`;break;case 2:O+=`one of ${k[0]} or ${k[1]}`;break;default:{const G=k.pop();O+=`one of ${k.join(", ")}, or ${G}`}}if(null==P)O+=`. Received ${P}`;else if("function"==typeof P&&P.name)O+=`. Received function ${P.name}`;else if("object"==typeof P){var F;null!==(F=P.constructor)&&void 0!==F&&F.name?O+=`. Received an instance of ${P.constructor.name}`:O+=`. Received ${c(P,{depth:-1})}`}else{let G=c(P,{colors:!1});G.length>25&&(G=`${G.slice(0,25)}...`),O+=`. Received type ${typeof P} (${G})`}return O},TypeError),g("ERR_INVALID_ARG_VALUE",(v,_,P="is invalid")=>{let O=c(_);return O.length>128&&(O=O.slice(0,128)+"..."),`The ${v.includes(".")?"property":"argument"} '${v}' ${P}. Received ${O}`},TypeError),g("ERR_INVALID_RETURN_VALUE",(v,_,P)=>{var O;return`Expected ${v} to be returned from the "${_}" function but got ${null!=P&&null!==(O=P.constructor)&&void 0!==O&&O.name?`instance of ${P.constructor.name}`:"type "+typeof P}.`},TypeError),g("ERR_MISSING_ARGS",(...v)=>{let _;y(v.length>0,"At least one arg needs to be specified");const P=v.length;switch(v=(Array.isArray(v)?v:[v]).map(O=>`"${O}"`).join(" or "),P){case 1:_+=`The ${v[0]} argument`;break;case 2:_+=`The ${v[0]} and ${v[1]} arguments`;break;default:{const O=v.pop();_+=`The ${v.join(", ")}, and ${O} arguments`}}return`${_} must be specified`},TypeError),g("ERR_OUT_OF_RANGE",(v,_,P)=>{let O;return y(_,'Missing "range" argument'),Number.isInteger(P)&&Math.abs(P)>4294967296?O=b(String(P)):"bigint"==typeof P?(O=String(P),(P>2n**32n||P<-(2n**32n))&&(O=b(O)),O+="n"):O=c(P),`The value of "${v}" is out of range. It must be ${_}. Received ${O}`},RangeError),g("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),g("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),g("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),g("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),g("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),g("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),g("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),g("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),g("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),g("ERR_STREAM_WRITE_AFTER_END","write after end",Error),g("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),C.exports={AbortError:A,aggregateTwoErrors:E(function(v,_){if(v&&_&&v!==_){if(Array.isArray(_.errors))return _.errors.push(v),_;const P=new p([_,v],_.message);return P.code=_.code,P}return v||_}),hideStackFrames:E,codes:a}},9061:C=>{"use strict";C.exports={ArrayIsArray:t=>Array.isArray(t),ArrayPrototypeIncludes:(t,n)=>t.includes(n),ArrayPrototypeIndexOf:(t,n)=>t.indexOf(n),ArrayPrototypeJoin:(t,n)=>t.join(n),ArrayPrototypeMap:(t,n)=>t.map(n),ArrayPrototypePop:(t,n)=>t.pop(n),ArrayPrototypePush:(t,n)=>t.push(n),ArrayPrototypeSlice:(t,n,o)=>t.slice(n,o),Error,FunctionPrototypeCall:(t,n,...o)=>t.call(n,...o),FunctionPrototypeSymbolHasInstance:(t,n)=>Function.prototype[Symbol.hasInstance].call(t,n),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(t,n)=>Object.defineProperties(t,n),ObjectDefineProperty:(t,n,o)=>Object.defineProperty(t,n,o),ObjectGetOwnPropertyDescriptor:(t,n)=>Object.getOwnPropertyDescriptor(t,n),ObjectKeys:t=>Object.keys(t),ObjectSetPrototypeOf:(t,n)=>Object.setPrototypeOf(t,n),Promise,PromisePrototypeCatch:(t,n)=>t.catch(n),PromisePrototypeThen:(t,n,o)=>t.then(n,o),PromiseReject:t=>Promise.reject(t),ReflectApply:Reflect.apply,RegExpPrototypeTest:(t,n)=>t.test(n),SafeSet:Set,String,StringPrototypeSlice:(t,n,o)=>t.slice(n,o),StringPrototypeToLowerCase:t=>t.toLowerCase(),StringPrototypeToUpperCase:t=>t.toUpperCase(),StringPrototypeTrim:t=>t.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet:(t,n,o)=>t.set(n,o),Uint8Array}},6087:(C,t,n)=>{"use strict";const o=n(8764),c=Object.getPrototypeOf(Ie(function*(){})).constructor,d=globalThis.Blob||o.Blob,p=void 0!==d?function(e){return e instanceof d}:function(e){return!1};class s extends Error{constructor(i){if(!Array.isArray(i))throw new TypeError("Expected input to be an Array, got "+typeof i);let a="";for(let y=0;y{e=a,i=y}),resolve:e,reject:i}},promisify:e=>new Promise((i,a)=>{e((y,...b)=>y?a(y):i(...b))}),debuglog:()=>function(){},format:(e,...i)=>e.replace(/%([sdifj])/g,function(...[a,y]){const b=i.shift();return"f"===y?b.toFixed(6):"j"===y?JSON.stringify(b):"s"===y&&"object"==typeof b?`${b.constructor!==Object?b.constructor.name:""} {}`.trim():b.toString()}),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction:e=>e instanceof c,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:p},C.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},5099:(C,t,n)=>{const{Buffer:o}=n(8764),{ObjectDefineProperty:c,ObjectKeys:d,ReflectApply:p}=n(9061),{promisify:{custom:s}}=n(6087),{streamReturningOperators:e,promiseReturningOperators:i}=n(4382),{codes:{ERR_ILLEGAL_CONSTRUCTOR:a}}=n(4381),y=n(299),{pipeline:b}=n(9946),{destroyer:g}=n(1195),E=n(8610),A=n(7854),v=n(5874),_=C.exports=n(4870).Stream;_.isDisturbed=v.isDisturbed,_.isErrored=v.isErrored,_.isReadable=v.isReadable,_.Readable=n(911);for(const L of d(e)){let k=function(...F){if(new.target)throw a();return _.Readable.from(p(I,this,F))};const I=e[L];c(k,"name",{__proto__:null,value:I.name}),c(k,"length",{__proto__:null,value:I.length}),c(_.Readable.prototype,L,{__proto__:null,value:k,enumerable:!1,configurable:!0,writable:!0})}for(const L of d(i)){let k=function(...G){if(new.target)throw a();return p(I,this,G)};const I=i[L];c(k,"name",{__proto__:null,value:I.name}),c(k,"length",{__proto__:null,value:I.length}),c(_.Readable.prototype,L,{__proto__:null,value:k,enumerable:!1,configurable:!0,writable:!0})}_.Writable=n(6304),_.Duplex=n(8672),_.Transform=n(1161),_.PassThrough=n(917),_.pipeline=b;const{addAbortSignal:P}=n(196);_.addAbortSignal=P,_.finished=E,_.destroy=g,_.compose=y,c(_,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>A}),c(b,s,{__proto__:null,enumerable:!0,get:()=>A.pipeline}),c(E,s,{__proto__:null,enumerable:!0,get:()=>A.finished}),_.Stream=_,_._isUint8Array=function(L){return L instanceof Uint8Array},_._uint8ArrayToBuffer=function(L){return o.from(L.buffer,L.byteOffset,L.byteLength)}},7854:(C,t,n)=>{"use strict";const{ArrayPrototypePop:o,Promise:c}=n(9061),{isIterable:d,isNodeStream:p,isWebStream:s}=n(5874),{pipelineImpl:e}=n(9946),{finished:i}=n(8610);n(5099),C.exports={finished:i,pipeline:function(...a){return new c((y,b)=>{let g,E;const A=a[a.length-1];if(A&&"object"==typeof A&&!p(A)&&!d(A)&&!s(A)){const v=o(a);g=v.signal,E=v.end}e(a,(v,_)=>{v?b(v):y(_)},{signal:g,end:E})})}}},9509:(C,t,n)=>{var o=n(8764),c=o.Buffer;function d(s,e){for(var i in s)e[i]=s[i]}function p(s,e,i){return c(s,e,i)}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?C.exports=o:(d(o,t),t.Buffer=p),p.prototype=Object.create(c.prototype),d(c,p),p.from=function(s,e,i){if("number"==typeof s)throw new TypeError("Argument must not be a number");return c(s,e,i)},p.alloc=function(s,e,i){if("number"!=typeof s)throw new TypeError("Argument must be a number");var a=c(s);return void 0!==e?"string"==typeof i?a.fill(e,i):a.fill(e):a.fill(0),a},p.allocUnsafe=function(s){if("number"!=typeof s)throw new TypeError("Argument must be a number");return c(s)},p.allocUnsafeSlow=function(s){if("number"!=typeof s)throw new TypeError("Argument must be a number");return o.SlowBuffer(s)}},2553:(C,t,n)=>{"use strict";var o=n(9509).Buffer,c=o.isEncoding||function(E){switch((E=""+E)&&E.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function d(E){var A;switch(this.encoding=function(v){var _=function(P){if(!P)return"utf8";for(var O;;)switch(P){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return P;default:if(O)return;P=(""+P).toLowerCase(),O=!0}}(v);if("string"!=typeof _&&(o.isEncoding===c||!c(v)))throw new Error("Unknown encoding: "+v);return _||v}(E),this.encoding){case"utf16le":this.text=e,this.end=i,A=4;break;case"utf8":this.fillLast=s,A=4;break;case"base64":this.text=a,this.end=y,A=3;break;default:return this.write=b,void(this.end=g)}this.lastNeed=0,this.lastTotal=0,this.lastChar=o.allocUnsafe(A)}function p(E){return E<=127?0:E>>5==6?2:E>>4==14?3:E>>3==30?4:E>>6==2?-1:-2}function s(E){var A=this.lastTotal-this.lastNeed,v=function(_,P,O){if(128!=(192&P[0]))return _.lastNeed=0,"\ufffd";if(_.lastNeed>1&&P.length>1){if(128!=(192&P[1]))return _.lastNeed=1,"\ufffd";if(_.lastNeed>2&&P.length>2&&128!=(192&P[2]))return _.lastNeed=2,"\ufffd"}}(this,E);return void 0!==v?v:this.lastNeed<=E.length?(E.copy(this.lastChar,A,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(E.copy(this.lastChar,A,0,E.length),void(this.lastNeed-=E.length))}function e(E,A){if((E.length-A)%2==0){var v=E.toString("utf16le",A);if(v){var _=v.charCodeAt(v.length-1);if(_>=55296&&_<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=E[E.length-1],E.toString("utf16le",A,E.length-1)}function i(E){var A=E&&E.length?this.write(E):"";return this.lastNeed?A+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):A}function a(E,A){var v=(E.length-A)%3;return 0===v?E.toString("base64",A):(this.lastNeed=3-v,this.lastTotal=3,1===v?this.lastChar[0]=E[E.length-1]:(this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1]),E.toString("base64",A,E.length-v))}function y(E){var A=E&&E.length?this.write(E):"";return this.lastNeed?A+this.lastChar.toString("base64",0,3-this.lastNeed):A}function b(E){return E.toString(this.encoding)}function g(E){return E&&E.length?this.write(E):""}t.StringDecoder=d,d.prototype.write=function(E){if(0===E.length)return"";var A,v;if(this.lastNeed){if(void 0===(A=this.fillLast(E)))return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v=0?(k>0&&(P.lastNeed=k-1),k):--I=0?(k>0&&(P.lastNeed=k-2),k):--I=0?(k>0&&(2===k?k=0:P.lastNeed=k-3),k):0}(this,E,A);if(!this.lastNeed)return E.toString("utf8",A);this.lastTotal=v;var _=E.length-(v-this.lastNeed);return E.copy(this.lastChar,0,_),E.toString("utf8",A,_)},d.prototype.fillLast=function(E){if(this.lastNeed<=E.length)return E.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);E.copy(this.lastChar,this.lastTotal-this.lastNeed,0,E.length),this.lastNeed-=E.length}},2479:C=>{C.exports=function t(n,o){if(n&&o)return t(n)(o);if("function"!=typeof n)throw new TypeError("need wrapper function");return Object.keys(n).forEach(function(d){c[d]=n[d]}),c;function c(){for(var d=new Array(arguments.length),p=0;p{},7884:(C,t,n)=>{"use strict";n.r(t),n.d(t,{Struct:()=>a,StructError:()=>o,any:()=>B,array:()=>T,assert:()=>y,assign:()=>v,bigint:()=>Q,boolean:()=>D,coerce:()=>z,create:()=>b,date:()=>ge,defaulted:()=>ae,define:()=>_,deprecated:()=>P,dynamic:()=>O,empty:()=>de,enums:()=>we,func:()=>re,instance:()=>U,integer:()=>ie,intersection:()=>K,is:()=>E,lazy:()=>L,literal:()=>X,map:()=>te,mask:()=>g,max:()=>l,min:()=>h,never:()=>ee,nonempty:()=>M,nullable:()=>Z,number:()=>W,object:()=>ue,omit:()=>I,optional:()=>se,partial:()=>k,pattern:()=>f,pick:()=>F,record:()=>me,refine:()=>V,regexp:()=>ve,set:()=>Se,size:()=>m,string:()=>H,struct:()=>G,trimmed:()=>fe,tuple:()=>ce,type:()=>ye,union:()=>_e,unknown:()=>$,validate:()=>A});class o extends TypeError{constructor(N,j){let J;const{message:le,explanation:Re,...Ce}=N,{path:Pe}=N,ke=0===Pe.length?le:`At path: ${Pe.join(".")} -- ${le}`;super(Re??ke),null!=Re&&(this.cause=ke),Object.assign(this,Ce),this.name=this.constructor.name,this.failures=()=>J??(J=[N,...j()])}}function c(S){return"object"==typeof S&&null!=S}function d(S){if("[object Object]"!==Object.prototype.toString.call(S))return!1;const N=Object.getPrototypeOf(S);return null===N||N===Object.prototype}function p(S){return"symbol"==typeof S?S.toString():"string"==typeof S?JSON.stringify(S):`${S}`}function s(S,N,j,J){if(!0===S)return;!1===S?S={}:"string"==typeof S&&(S={message:S});const{path:le,branch:Re}=N,{type:Ce}=j,{refinement:Pe,message:ke=`Expected a value of type \`${Ce}\`${Pe?` with refinement \`${Pe}\``:""}, but received: \`${p(J)}\``}=S;return{value:J,type:Ce,refinement:Pe,key:le[le.length-1],path:le,branch:Re,...S,message:ke}}function*e(S,N,j,J){var le;c(le=S)&&"function"==typeof le[Symbol.iterator]||(S=[S]);for(const Re of S){const Ce=s(Re,N,j,J);Ce&&(yield Ce)}}function*i(S,N,j={}){const{path:J=[],branch:le=[S],coerce:Re=!1,mask:Ce=!1}=j,Pe={path:J,branch:le};if(Re&&(S=N.coercer(S,Pe),Ce&&"type"!==N.type&&c(N.schema)&&c(S)&&!Array.isArray(S)))for(const De in S)void 0===N.schema[De]&&delete S[De];let ke="valid";for(const De of N.validator(S,Pe))De.explanation=j.message,ke="not_valid",yield[De,void 0];for(let[De,We,Ve]of N.entries(S,Pe)){const Je=i(We,Ve,{path:void 0===De?J:[...J,De],branch:void 0===De?le:[...le,We],coerce:Re,mask:Ce,message:j.message});for(const He of Je)He[0]?(ke=null!=He[0].refinement?"not_refined":"not_valid",yield[He[0],void 0]):Re&&(We=He[1],void 0===De?S=We:S instanceof Map?S.set(De,We):S instanceof Set?S.add(We):c(S)&&(void 0!==We||De in S)&&(S[De]=We))}if("not_valid"!==ke)for(const De of N.refiner(S,Pe))De.explanation=j.message,ke="not_refined",yield[De,void 0];"valid"===ke&&(yield[void 0,S])}class a{constructor(N){const{type:j,schema:J,validator:le,refiner:Re,coercer:Ce=(ke=>ke),entries:Pe=function*(){}}=N;this.type=j,this.schema=J,this.entries=Pe,this.coercer=Ce,this.validator=le?(ke,De)=>e(le(ke,De),De,this,ke):()=>[],this.refiner=Re?(ke,De)=>e(Re(ke,De),De,this,ke):()=>[]}assert(N,j){return y(N,this,j)}create(N,j){return b(N,this,j)}is(N){return E(N,this)}mask(N,j){return g(N,this,j)}validate(N,j={}){return A(N,this,j)}}function y(S,N,j){const J=A(S,N,{message:j});if(J[0])throw J[0]}function b(S,N,j){const J=A(S,N,{coerce:!0,message:j});if(J[0])throw J[0];return J[1]}function g(S,N,j){const J=A(S,N,{coerce:!0,mask:!0,message:j});if(J[0])throw J[0];return J[1]}function E(S,N){return!A(S,N)[0]}function A(S,N,j={}){const J=i(S,N,j),le=function(Re){const{done:Ce,value:Pe}=Re.next();return Ce?void 0:Pe}(J);return le[0]?[new o(le[0],function*(){for(const Re of J)Re[0]&&(yield Re[0])}),void 0]:[void 0,le[1]]}function v(...S){const N="type"===S[0].type,j=S.map(le=>le.schema),J=Object.assign({},...j);return N?ye(J):ue(J)}function _(S,N){return new a({type:S,schema:null,validator:N})}function P(S,N){return new a({...S,refiner:(j,J)=>void 0===j||S.refiner(j,J),validator:(j,J)=>void 0===j||(N(j,J),S.validator(j,J))})}function O(S){return new a({type:"dynamic",schema:null,*entries(N,j){yield*S(N,j).entries(N,j)},validator:(N,j)=>S(N,j).validator(N,j),coercer:(N,j)=>S(N,j).coercer(N,j),refiner:(N,j)=>S(N,j).refiner(N,j)})}function L(S){let N;return new a({type:"lazy",schema:null,*entries(j,J){N??(N=S()),yield*N.entries(j,J)},validator:(j,J)=>(N??(N=S()),N.validator(j,J)),coercer:(j,J)=>(N??(N=S()),N.coercer(j,J)),refiner:(j,J)=>(N??(N=S()),N.refiner(j,J))})}function I(S,N){const{schema:j}=S,J={...j};for(const le of N)delete J[le];return"type"===S.type?ye(J):ue(J)}function k(S){const N=S instanceof a?{...S.schema}:{...S};for(const j in N)N[j]=se(N[j]);return ue(N)}function F(S,N){const{schema:j}=S,J={};for(const le of N)J[le]=j[le];return ue(J)}function G(S,N){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),_(S,N)}function B(){return _("any",()=>!0)}function T(S){return new a({type:"array",schema:S,*entries(N){if(S&&Array.isArray(N))for(const[j,J]of N.entries())yield[j,J,S]},coercer:N=>Array.isArray(N)?N.slice():N,validator:N=>Array.isArray(N)||`Expected an array value, but received: ${p(N)}`})}function Q(){return _("bigint",S=>"bigint"==typeof S)}function D(){return _("boolean",S=>"boolean"==typeof S)}function ge(){return _("date",S=>S instanceof Date&&!isNaN(S.getTime())||`Expected a valid \`Date\` object, but received: ${p(S)}`)}function we(S){const N={},j=S.map(J=>p(J)).join();for(const J of S)N[J]=J;return new a({type:"enums",schema:N,validator:J=>S.includes(J)||`Expected one of \`${j}\`, but received: ${p(J)}`})}function re(){return _("func",S=>"function"==typeof S||`Expected a function, but received: ${p(S)}`)}function U(S){return _("instance",N=>N instanceof S||`Expected a \`${S.name}\` instance, but received: ${p(N)}`)}function ie(){return _("integer",S=>"number"==typeof S&&!isNaN(S)&&Number.isInteger(S)||`Expected an integer, but received: ${p(S)}`)}function K(S){return new a({type:"intersection",schema:null,*entries(N,j){for(const J of S)yield*J.entries(N,j)},*validator(N,j){for(const J of S)yield*J.validator(N,j)},*refiner(N,j){for(const J of S)yield*J.refiner(N,j)}})}function X(S){const N=p(S),j=typeof S;return new a({type:"literal",schema:"string"===j||"number"===j||"boolean"===j?S:null,validator:J=>J===S||`Expected the literal \`${N}\`, but received: ${p(J)}`})}function te(S,N){return new a({type:"map",schema:null,*entries(j){if(S&&N&&j instanceof Map)for(const[J,le]of j.entries())yield[J,J,S],yield[J,le,N]},coercer:j=>j instanceof Map?new Map(j):j,validator:j=>j instanceof Map||`Expected a \`Map\` object, but received: ${p(j)}`})}function ee(){return _("never",()=>!1)}function Z(S){return new a({...S,validator:(N,j)=>null===N||S.validator(N,j),refiner:(N,j)=>null===N||S.refiner(N,j)})}function W(){return _("number",S=>"number"==typeof S&&!isNaN(S)||`Expected a number, but received: ${p(S)}`)}function ue(S){const N=S?Object.keys(S):[],j=ee();return new a({type:"object",schema:S||null,*entries(J){if(S&&c(J)){const le=new Set(Object.keys(J));for(const Re of N)le.delete(Re),yield[Re,J[Re],S[Re]];for(const Re of le)yield[Re,J[Re],j]}},validator:J=>c(J)||`Expected an object, but received: ${p(J)}`,coercer:J=>c(J)?{...J}:J})}function se(S){return new a({...S,validator:(N,j)=>void 0===N||S.validator(N,j),refiner:(N,j)=>void 0===N||S.refiner(N,j)})}function me(S,N){return new a({type:"record",schema:null,*entries(j){if(c(j))for(const J in j){const le=j[J];yield[J,J,S],yield[J,le,N]}},validator:j=>c(j)||`Expected an object, but received: ${p(j)}`})}function ve(){return _("regexp",S=>S instanceof RegExp)}function Se(S){return new a({type:"set",schema:null,*entries(N){if(S&&N instanceof Set)for(const j of N)yield[j,j,S]},coercer:N=>N instanceof Set?new Set(N):N,validator:N=>N instanceof Set||`Expected a \`Set\` object, but received: ${p(N)}`})}function H(){return _("string",S=>"string"==typeof S||`Expected a string, but received: ${p(S)}`)}function ce(S){const N=ee();return new a({type:"tuple",schema:null,*entries(j){if(Array.isArray(j)){const J=Math.max(S.length,j.length);for(let le=0;leArray.isArray(j)||`Expected an array, but received: ${p(j)}`})}function ye(S){const N=Object.keys(S);return new a({type:"type",schema:S,*entries(j){if(c(j))for(const J of N)yield[J,j[J],S[J]]},validator:j=>c(j)||`Expected an object, but received: ${p(j)}`,coercer:j=>c(j)?{...j}:j})}function _e(S){const N=S.map(j=>j.type).join(" | ");return new a({type:"union",schema:null,coercer(j){for(const J of S){const[le,Re]=J.validate(j,{coerce:!0});if(!le)return Re}return j},validator(j,J){const le=[];for(const Re of S){const[...Ce]=i(j,Re,J),[Pe]=Ce;if(!Pe[0])return[];for(const[ke]of Ce)ke&&le.push(ke)}return[`Expected the value to satisfy a union of \`${N}\`, but received: ${p(j)}`,...le]}})}function $(){return _("unknown",()=>!0)}function z(S,N,j){return new a({...S,coercer:(J,le)=>E(J,N)?S.coercer(j(J,le),le):S.coercer(J,le)})}function ae(S,N,j={}){return z(S,$(),J=>{const le="function"==typeof N?N():N;if(void 0===J)return le;if(!j.strict&&d(J)&&d(le)){const Re={...J};let Ce=!1;for(const Pe in le)void 0===Re[Pe]&&(Re[Pe]=le[Pe],Ce=!0);if(Ce)return Re}return J})}function fe(S){return z(S,H(),N=>N.trim())}function de(S){return V(S,"empty",N=>{const j=r(N);return 0===j||`Expected an empty ${S.type} but received one with a size of \`${j}\``})}function r(S){return S instanceof Map||S instanceof Set?S.size:S.length}function l(S,N,j={}){const{exclusive:J}=j;return V(S,"max",le=>J?leJ?le>N:le>=N||`Expected a ${S.type} greater than ${J?"":"or equal to "}${N} but received \`${le}\``)}function M(S){return V(S,"nonempty",N=>r(N)>0||`Expected a nonempty ${S.type} but received an empty one`)}function f(S,N){return V(S,"pattern",j=>N.test(j)||`Expected a ${S.type} matching \`/${N.source}/\` but received "${j}"`)}function m(S,N,j=N){const J=`Expected a ${S.type}`,le=N===j?`of \`${N}\``:`between \`${N}\` and \`${j}\``;return V(S,"size",Re=>{if("number"==typeof Re||Re instanceof Date)return N<=Re&&Re<=j||`${J} ${le} but received \`${Re}\``;if(Re instanceof Map||Re instanceof Set){const{size:Ce}=Re;return N<=Ce&&Ce<=j||`${J} with a size ${le} but received one with a size of \`${Ce}\``}{const{length:Ce}=Re;return N<=Ce&&Ce<=j||`${J} with a length ${le} but received one with a length of \`${Ce}\``}})}function V(S,N,j){return new a({...S,*refiner(J,le){yield*S.refiner(J,le);const Re=e(j(J,le),le,S,J);for(const Ce of Re)yield{...Ce,refinement:N}}})}}},ze={};function Te(C){var t=ze[C];if(void 0!==t)return t.exports;var n=ze[C]={id:C,loaded:!1,exports:{}};return Ye[C].call(n.exports,n,n.exports,Te),n.loaded=!0,n.exports}Te.n=C=>{var t=C&&C.__esModule?()=>C.default:()=>C;return Te.d(t,{a:t}),t},Te.d=(C,t)=>{for(var n in t)Te.o(t,n)&&!Te.o(C,n)&&Object.defineProperty(C,n,{enumerable:!0,get:t[n]})},Te.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch{if("object"==typeof window)return window}}(),Te.o=(C,t)=>Object.prototype.hasOwnProperty.call(C,t),Te.r=C=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})},Te.nmd=C=>(C.paths=[],C.children||(C.children=[]),C);var Ge={};return(()=>{"use strict";function C(R){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(R)}function t(R,u,w){return q=function(ne,oe){if("object"!==C(ne)||null===ne)return ne;var he=ne[Symbol.toPrimitive];if(void 0!==he){var pe=he.call(ne,"string");if("object"!==C(pe))return pe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ne)}(u),(u="symbol"===C(q)?q:String(q))in R?Object.defineProperty(R,u,{value:w,enumerable:!0,configurable:!0,writable:!0}):R[u]=w,R;var q}Te.r(Ge),Te.d(Ge,{BUTTON_POSITION:()=>se,PAYMENT_PROVIDER:()=>Z,SUPPORTED_PAYMENT_NETWORK:()=>W,TORUS_BUILD_ENV:()=>ue,TorusInpageProvider:()=>Je,WALLET_OPENLOGIN_VERIFIER_MAP:()=>ee,WALLET_VERIFIERS:()=>te,default:()=>Y});var n=Te(2378),o=Te.n(n),c=Te(2043),d=Te.n(c);function p(R,u){var w=Object.keys(R);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(R);u&&(x=x.filter(function(q){return Object.getOwnPropertyDescriptor(R,q).enumerable})),w.push.apply(w,x)}return w}function s(R){for(var u=1;u1&&void 0!==arguments[1]?arguments[1]:{};const x={mode:"cors",headers:{}};(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).useAPIKey&&(x.headers=s(s({},x.headers),function(){const oe={};return i&&(oe["x-api-key"]=i),oe}()));const q=o()(x,w,{method:"GET"}),ne=yield(oe=Ie(function*(he,pe){let be=null;try{be=new URL(he)}catch{}return fetch(he,pe)}),function(he,pe){return oe.apply(this,arguments)})(u,q);var oe;if(ne.ok)return ne.json();throw function(oe){e.info(`Response: ${oe.status} ${oe.statusText}`),e.info(`Url: ${oe.url}`)}(ne),ne});return function(w){return R.apply(this,arguments)}}();var b=Te(9827),g=Te(7187),E=Te(4445),A=Te.n(E),v=Te(9428),_=Te(2840),P=Te.n(_),O=Te(778),L=Te.n(O),I=Te(4286),k=Te.n(I);function F(){}const G="ACK";class B extends b.Duplex{constructor(u){let{name:w,target:x,targetWindow:q=window,targetOrigin:ne="*"}=u;if(super({objectMode:!0}),t(this,"_init",void 0),t(this,"_haveSyn",void 0),t(this,"_name",void 0),t(this,"_target",void 0),t(this,"_targetWindow",void 0),t(this,"_targetOrigin",void 0),t(this,"_onMessage",void 0),t(this,"_synIntervalId",void 0),!w||!x)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=w,this._target=x,this._targetWindow=q,this._targetOrigin=ne,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write("BRK",null,F),this._haveSyn=!1,this._init=!1}_handShake(){this._write("SYN",null,F),this.cork()}_onData(u){if(this._init)if("BRK"===u)this._break();else try{this.push(u)}catch(w){this.emit("error",w)}else"SYN"===u?(this._haveSyn=!0,this._write(G,null,F)):u===G&&(this._init=!0,this._haveSyn||this._write(G,null,F),this.uncork())}_postMessage(u){this._targetWindow.postMessage({target:this._target,data:u},this._targetOrigin)}onMessage(u){const w=u.data;"*"!==this._targetOrigin&&u.origin!==this._targetOrigin||u.source!==this._targetWindow||"object"!=typeof w||w.target!==this._name||!w.data||this._onData(w.data)}_read(){}_write(u,w,x){this._postMessage(u),x()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}function T(R,u,w){try{Reflect.apply(R,u,w)}catch(x){setTimeout(()=>{throw x})}}class Q extends g.EventEmitter{emit(u){let w="error"===u;const x=this._events;if(void 0!==x)w=w&&void 0===x.error;else if(!w)return!1;for(var q=arguments.length,ne=new Array(q>1?q-1:0),oe=1;oe0&&([pe]=ne),pe instanceof Error)throw pe;const be=new Error("Unhandled error."+(pe?` (${pe.message})`:""));throw be.context=pe,be}const he=x[u];if(void 0===he)return!1;if("function"==typeof he)T(he,this,ne);else{const pe=he.length,be=function(Ee){const Ae=Ee.length,Le=new Array(Ae);for(let Ne=0;Ne{const oe=pe=>{const be=pe||w.error;be&&(w.error=(0,v.Xy)(be)),ne([be,!0])},he=pe=>{w.error?oe(w.error):(pe&&("function"!=typeof pe&&oe(new D({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),q.push(pe)),ne([null,!1]))};try{x(u,w,he,oe)}catch(pe){oe(pe)}})}static _runReturnHandlers(u){return Ie(function*(){for(const w of u)yield new Promise((x,q)=>{w(ne=>ne?q(ne):x())})})()}static _checkForCompletion(u,w,x){if(!("result"in w)&&!("error"in w))throw new D({code:-32603,message:"Response has no error or result for request"});if(!x)throw new D({code:-32603,message:"Nothing ended request"})}push(u){this._middleware.push(u)}handle(u,w){if(w&&"function"!=typeof w)throw new Error('"callback" must be a function if provided.');return Array.isArray(u)?w?this._handleBatch(u,w):this._handleBatch(u):w?this._handle(u,w):this._promiseHandle(u)}asMiddleware(){var u=this;return function(){var w=Ie(function*(x,q,ne,oe){try{const[he,pe,be]=yield we._runAllMiddleware(x,q,u._middleware);return pe?(yield we._runReturnHandlers(be),oe(he)):ne(function(){var Ee=Ie(function*(Ae){try{yield we._runReturnHandlers(be)}catch(Le){return Ae(Le)}return Ae()});return function(Ae){return Ee.apply(this,arguments)}}())}catch(he){return oe(he)}});return function(x,q,ne,oe){return w.apply(this,arguments)}}()}_handleBatch(u,w){var x=this;return Ie(function*(){try{const q=yield Promise.all(u.map(x._promiseHandle.bind(x)));return w?w(null,q):q}catch(q){if(w)return w(q);throw q}})()}_promiseHandle(u){return new Promise(w=>{this._handle(u,(x,q)=>{w(q)})})}_handle(u,w){var x=this;return Ie(function*(){if(!u||Array.isArray(u)||"object"!=typeof u){const he=new D({code:-32603,message:"request must be plain object"});return w(he,{id:void 0,jsonrpc:"2.0",error:he})}if("string"!=typeof u.method){const he=new D({code:-32603,message:"method must be string"});return w(he,{id:u.id,jsonrpc:"2.0",error:he})}const q=function(he){for(var pe=1;pe0&&void 0!==arguments[0]?arguments[0]:{}),{},{objectMode:!0})),t(this,"_substreams",void 0),t(this,"getStream",void 0),this._substreams={}}createStream(u){if(!u)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[u])throw new Error(`ObjectMultiplex - Substream for name "${u}" already exists`);const w=new re({parent:this,name:u});return this._substreams[u]=w,function(x,q){const ne=L()(oe=>w.destroy(oe||void 0));P()(x,{readable:!1},ne),P()(x,{writable:!1},ne)}(this),w}ignoreStream(u){if(!u)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[u])throw new Error(`ObjectMultiplex - Substream for name "${u}" already exists`);this._substreams[u]=K}_read(){}_write(u,w,x){const{name:q,data:ne}=u;if(!q)return window.console.warn(`ObjectMultiplex - malformed chunk without name "${u}"`),x();const oe=this._substreams[q];return oe?(oe!==K&&oe.push(ne),x()):(window.console.warn(`ObjectMultiplex - orphaned data for stream "${q}"`),x())}}const te={GOOGLE:"google",FACEBOOK:"facebook",TWITCH:"twitch",REDDIT:"reddit",DISCORD:"discord",EMAIL_PASSWORDLESS:"torus-auth0-email-passwordless"},ee={[te.GOOGLE]:"tkey-google",[te.FACEBOOK]:"tkey-facebook",[te.TWITCH]:"tkey-twitch",[te.REDDIT]:"tkey-reddit",[te.DISCORD]:"tkey-discord",[te.EMAIL_PASSWORDLESS]:"tkey-auth0-email-passwordless"},Z={MOONPAY:"moonpay",WYRE:"wyre",RAMPNETWORK:"rampnetwork",XANPOOL:"xanpool",MERCURYO:"mercuryo",TRANSAK:"transak",BANXA:"banxa"},W={MAINNET:"mainnet",MATIC:"matic",BSC_MAINNET:"bsc_mainnet",AVALANCHE_MAINNET:"avalanche_mainnet",XDAI:"xdai",ARBITRUM_MAINNET:"arbitrum_mainnet",OPTIMISM_MAINNET:"optimism_mainnet"},ue={PRODUCTION:"production",DEVELOPMENT:"development",BINANCE:"binance",TESTING:"testing",LRC:"lrc",BETA:"beta",BNB:"bnb",POLYGON:"polygon",ALPHA:"alpha"},se={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},me={[Z.MOONPAY]:["AUD","BGN","BRL","CAD","CHF","CNY","COP","CZK","DKK","DOP","EGP","EUR","GBP","HKD","HRK","IDR","ILS","JPY","JOD","KES","KRW","KWD","LKR","MAD","MXN","MYR","NGN","NOK","NZD","OMR","PEN","PKR","PLN","RON","RUB","SEK","SGD","THB","TRY","TWD","USD","VND","ZAR"],[Z.WYRE]:["USD","EUR","GBP","AUD","CAD","NZD","CNY","ARS","BRL","CHF","CLP","COP","CZK","DKK","HKD","ILS","INR","ISK","JPY","KRW","MXN","MYR","NOK","PHP","PLN","SEK","SGD","THB","VND","ZAR"],[Z.RAMPNETWORK]:["USD","EUR","GBP","BMD","BAM","BWP","BRL","BGN","COP","CRC","CZK","DKK","DOP","GEL","GTQ","HNL","HUF","ISK","INR","ILS","KZT","KES","KWD","LAK","MKD","MYR","MXN","MDL","MZN","NZD","NGN","PYG","PEN","PLN","RON","RSD","SGD","ZAR","LKR","SEK","CHF","TJS","THB","UYU"],[Z.XANPOOL]:["SGD","HKD","THB","PHP","INR","IDR","MYR","AUD","NZD","KRW"],[Z.MERCURYO]:["EUR","USD","GBP","TRY","JPY","BRL","NGN","VND","MXN","KRW","PLN","SEK","CHF","CAD","CZK","DKK","BGN","HKD","AUD","INR"],[Z.TRANSAK]:["ARS","AUD","BBD","BGN","BMD","BRL","CAD","CHF","CLP","CRC","CZK","DKK","DOP","EUR","FJD","FKP","GBP","GIP","HRK","HUF","IDR","ILS","ISK","JMD","JPY","KES","KRW","MDL","MXN","MYR","NOK","NZD","PEN","PHP","PLN","PYG","RON","SEK","SGD","THB","TRY","TZS","USD","ZAR"],[Z.BANXA]:["AUD","CAD","CZK","DKK","EUR","GBP","HKD","JPY","NOK","NZD","NZD","PLN","RUB","SEK","SGD","TRY","USD"]},ve=new Set(["ETH","USDT","USDC","TUSD","EOSDT","USD","DAI","GUSD","DKKT","PAX","ILS","RUB","BYN","EUR","GBP","JPY","KRW","PLN","MXN","AUD","BRL","CAD","CHF","KPW","LAK","LBP","LKR","XOF","CNHT","DOGE","UAH","TRY","HKD","XJP","SGD","USC","NZD","NGN","RUR","COP","GHS","EGP","IDR","BHD","CRC","PEN","AED","DOP","PKR","HUF","VND","XAR","LTC","RON","OMR","MYR","DKK","UGX","ZMW","SAR","SEK","GEL","RWF","IRR","TZS","CNY","VEF","BDT","HRK","CLP","THB","XAF","ARS","UYU","SZL","KZT","NOK","KES","PAB","INR","CZK","MAD","TWD","PHP","ZAR","BOB","CDF","DASH","VES","ISK","MWK","BAM","TTD","XRP","JOD","RSD","HNL","BGN","GTQ","BWP","XMR","MMK","QAR","AOA","KWD","MUR","WUSD","WEUR","WAVES","WTRY","LRD","LSL","LYD","AWG","MDL","BTO","EURS","CHFT","MKD","MNT","MOP","MRO","MVR","VOLLAR","CKUSD","KHR","VUV","BITCNY","QC","BBD","NAD","NPR","PGK","PYG","BIF","BMD","BND","XLM","BNB","SCR","BAT","CRO","HT","KCS","LEO","LINK","MKR","NPXS","OMG","REP","ZB","ZIL","ZRX","BCH","BZD","CUP","CVE","DJF","DZD","ERN","ETB","FJD","FKP","BUSD","ANCT","ALL","AMD","ANG","CNYX","IQD","UZS","TND","GGP","XAU","KGS","GIP","JMD","ZEC","USDP","BSV","EMC2","SNT","GTO","POWR","EUSD","EURT","BCY","BTS","ATM","BLOCKPAY","ARDR","AMP","B2X","BITGOLD","BITEUR","ATB","BITUSD","AGRS","DFXT","HIKEN","BIX","KNC","EOS","COB","COSS","BMH","NANO","BDG","BNT","XVG","LKK1Y","LKK","USDK","EURN","NZDT","JSE","GMD","GNF","GYD","YER","XPF","HTG","SLL","SOS","WST","SVC","SYP","NEO","KMF","JUMP","AYA","BLAST","WGR","BCN","BTG","URALS","INN","USDQ","CNH","HUSD","BKRW","NZDX","EURX","CADX","USDEX","JPYX","AUDX","VNDC","EON","GBPX","CHFX","USDJ","IDRT","USDS","USDN","BIDR","IDK","BSD","BTN","KYD","NIO","SBD","SDG","SHP","TOP","XCD","XCHF","CNYT","GYEN","ZUSD","GOLD","TRX","TRYB","PLATC","STRAX","UST","GLM","VAI","BRZ","DDRST","XAUT","MIM"]);function Se(R){return me[R].filter(u=>ve.has(u))}const H={[Z.MOONPAY]:{line1:"Credit/ Debit Card/ Apple Pay",line2:"4.5% or 5 USD",line3:"2,000\u20ac/day, 10,000\u20ac/mo",supportPage:"https://help.moonpay.io/en/",minOrderValue:24.99,maxOrderValue:5e4,validCurrencies:Se(Z.MOONPAY),validCryptoCurrenciesByChain:{[W.MAINNET]:[{value:"aave",display:"AAVE"},{value:"bat",display:"BAT"},{value:"dai",display:"DAI"},{value:"eth",display:"ETH"},{value:"mkr",display:"MKR"},{value:"matic",display:"MATIC"},{value:"usdt",display:"USDT"},{value:"uni",display:"UNI"},{value:"usdc",display:"USDC"},{value:"weth",display:"WETH"}],[W.MATIC]:[{value:"eth_polygon",display:"ETH"},{value:"matic_polygon",display:"MATIC"},{value:"usdc_polygon",display:"USDC"},{value:"usdt_polygon",display:"USDT"}],[W.BSC_MAINNET]:[{value:"bnb_bsc",display:"BNB"},{value:"busd_bsc",display:"BUSD"}],[W.AVALANCHE_MAINNET]:[{value:"avax_cchain",display:"AVAX"},{value:"usdc_cchain",display:"USDC"}],[W.ARBITRUM_MAINNET]:[{value:"eth_arbitrum",display:"ETH"},{value:"usdc_arbitrum",display:"USDC"}],[W.OPTIMISM_MAINNET]:[{value:"eth_optimism",display:"ETH"},{value:"usdc_optimism",display:"USDC"}]},includeFees:!0,api:!0,enforceMax:!1},[Z.WYRE]:{line1:"Apple Pay/ Debit/ Credit Card",line2:"4.9% + 30\xa2 or 5 USD",line3:"$250/day",supportPage:"https://support.sendwyre.com/en/",minOrderValue:5,maxOrderValue:500,validCurrencies:Se(Z.WYRE),validCryptoCurrenciesByChain:{[W.MAINNET]:[{value:"AAVE",display:"AAVE"},{value:"COMP",display:"COMP"},{value:"BAT",display:"BAT"},{value:"BUSD",display:"BUSD"},{value:"DAI",display:"DAI"},{value:"ETH",display:"ETH"},{value:"WBTC",display:"WBTC"},{value:"MKR",display:"MKR"},{value:"UNI",display:"UNI"},{value:"WETH",display:"WETH"},{value:"USDC",display:"USDC"},{value:"USDT",display:"USDT"}],[W.MATIC]:[{value:"mUSDC",display:"USDC"},{value:"MATIC",display:"MATIC"},{value:"MWETH",display:"WETH"}],[W.AVALANCHE_MAINNET]:[{value:"AVAXC",display:"AVAX"},{value:"AVAXCUSDC",display:"USDC"}],[W.BSC_MAINNET]:[{value:"BNB",display:"BNB"},{value:"BBUSD",display:"BUSD"}]},includeFees:!1,api:!0,enforceMax:!1},[Z.RAMPNETWORK]:{line1:"Debit Card/
Apple Pay/ Bank transfer",line2:"0.49% - 2.9%",line3:"5,000\u20ac/purchase, 20,000\u20ac/mo",supportPage:"https://instant.ramp.network/",minOrderValue:50,maxOrderValue:2e4,validCurrencies:Se(Z.RAMPNETWORK),validCryptoCurrenciesByChain:{[W.MAINNET]:[{value:"ETH",display:"ETH"},{value:"DAI",display:"DAI"},{value:"BAT",display:"BAT"},{value:"USDC",display:"USDC"},{value:"USDT",display:"USDT"}],[W.MATIC]:[{value:"MATIC_BAT",display:"BAT"},{value:"MATIC_DAI",display:"DAI"},{value:"MATIC_MATIC",display:"MATIC"},{value:"MATIC_USDC",display:"USDC"},{value:"MATIC_USDT",display:"USDT"}],[W.AVALANCHE_MAINNET]:[{value:"AVAX_AVAX",display:"AVAX"},{value:"AVAX_USDC",display:"USDC"},{value:"AVAX_USDT",display:"USDT"}],[W.ARBITRUM_MAINNET]:[{value:"ARBITRUM_ETH",display:"ETH"},{value:"ARBITRUM_USDC.e\t",display:"USDC"},{value:"ARBITRUM_USDT",display:"USDT"}],[W.OPTIMISM_MAINNET]:[{value:"OPTIMISM_DAI",display:"DAI"},{value:"OPTIMISM_OPTIMISM",display:"OPTIMISM"},{value:"OPTIMISM_USDC",display:"USDC"},{value:"OPTIMISM_USDT",display:"USDT"}],[W.BSC_MAINNET]:[{value:"BSC_BNB",display:"BNB"},{value:"BSC_BUSD",display:"BUSD"}]},includeFees:!0,api:!0,receiveHint:"walletTopUp.receiveHintRamp",enforceMax:!1},[Z.XANPOOL]:{line1:"PayNow/ InstaPay/ FPS/ GoJekPay/ UPI/ PromptPay/
ViettelPay/ DuitNow",line2:"2.5% buying, 3% selling",line3:"$2,500 / day",supportPage:"mailto:support@xanpool.com",minOrderValue:100,maxOrderValue:2500,validCurrencies:Se(Z.XANPOOL),validCryptoCurrenciesByChain:{[W.MAINNET]:[{value:"ETH",display:"ETH"},{value:"USDT",display:"USDT"},{value:"USDC",display:"USDC"}]},includeFees:!0,api:!0,sell:!0,enforceMax:!1},[Z.MERCURYO]:{line1:"Credit/ Debit Card/ Apple Pay",line2:"3.95% or 4 USD",line3:"10,000\u20ac/day, 25,000\u20ac/mo",supportPage:"mailto:support@mercuryo.io",minOrderValue:30,maxOrderValue:5e3,validCurrencies:Se(Z.MERCURYO),validCryptoCurrenciesByChain:{[W.MAINNET]:[{value:"ETH",display:"ETH"},{value:"BAT",display:"BAT"},{value:"USDT",display:"USDT"},{value:"DAI",display:"DAI"}],[W.BSC_MAINNET]:[{value:"BNB",display:"BNB"},{value:"BUSD",display:"BUSD"},{value:"1INCH",display:"1INCH"}],[W.AVALANCHE_MAINNET]:[{value:"AVAX",display:"AVAX"}],[W.MATIC]:[{value:"MATIC",display:"MATIC"}]},includeFees:!0,api:!0,enforceMax:!1},[Z.TRANSAK]:{line1:"Apple & Google Pay / Credit/Debit Card
Bangkok Bank Mobile & iPay
Bank Transfer (sepa/gbp) / SCB Mobile & Easy",line2:"0.99% - 5.5% or 5 USD",line3:"$5,000/day, $28,000/mo",supportPage:"https://support.transak.com/hc/en-US",minOrderValue:30,maxOrderValue:500,validCurrencies:Se(Z.TRANSAK),validCryptoCurrenciesByChain:{[W.MAINNET]:[{value:"1INCH",display:"1INCH"},{value:"BAT",display:"BAT"},{value:"AAVE",display:"AAVE"},{value:"DAI",display:"DAI"},{value:"ETH",display:"ETH"},{value:"USDC",display:"USDC"},{value:"USDT",display:"USDT"}],[W.MATIC]:[{value:"BAT",display:"BAT"},{value:"AAVE",display:"AAVE"},{value:"DAI",display:"DAI"},{value:"MATIC",display:"MATIC"},{value:"USDC",display:"USDC"},{value:"USDT",display:"USDT"},{value:"WETH",display:"WETH"}],[W.BSC_MAINNET]:[{value:"BAT",display:"BAT"},{value:"BNB",display:"BNB"},{value:"BUSD",display:"BUSD"}],[W.AVALANCHE_MAINNET]:[{value:"AVAX",display:"AVAX"}],[W.OPTIMISM_MAINNET]:[{value:"ETH",display:"ETH"},{value:"USDC",display:"USDC"}],[W.ARBITRUM_MAINNET]:[{value:"USDC",display:"USDC"},{value:"ETH",display:"ETH"}]},includeFees:!0,enforceMax:!0},[Z.BANXA]:{line1:"Debit Card/
Apple Pay/ Bank transfer",line2:"0.49% - 2.9%",line3:"5,000\u20ac/purchase, 20,000\u20ac/mo",supportPage:"https://support.banxa.com",minOrderValue:20,maxOrderValue:15e3,validCurrencies:Se(Z.BANXA),validCryptoCurrenciesByChain:{[W.MAINNET]:[{value:"ETH",display:"ETH"},{value:"DAI",display:"DAI"},{value:"MKR",display:"MKR"},{value:"USDT",display:"USDT"},{value:"BUSD",display:"BUSD"},{value:"USDC",display:"USDC"},{value:"BAT",display:"BAT"},{value:"AAVE",display:"AAVE"},{value:"COMP",display:"COMP"},{value:"UNI",display:"UNI"}],[W.MATIC]:[{value:"MATIC",display:"MATIC"}]},includeFees:!0,enforceMax:!0}},ce={supportedVerifierList:Object.values(te),paymentProviders:H,api:"https://api.tor.us",translations:{en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies ben\xf6tigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"\u7d99\u7d9a\u3059\u308b",actionRequired:"\u8a8d\u8a3c\u304c\u5fc5\u8981\u3067\u3059",pendingAction:"\u7d9a\u884c\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u7d9a\u884c\u3057\u307e\u3059",cookiesRequired:"\u5fc5\u8981\u306a\u30af\u30c3\u30ad\u30fc",enableCookies:"Torus\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f\u3001\u30d6\u30e9\u30a6\u30b6\u306e\u8a2d\u5b9a\u3067Cookie\u3092\u6709\u52b9\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",clickHere:"\u8a73\u3057\u304f\u306f"}},ko:{embed:{continue:"\uacc4\uc18d\ud558\ub2e4",actionRequired:"\uc2b9\uc778 \ud544\uc694",pendingAction:"\ud31d\uc5c5\uc5d0\uc11c \uc694\uccad\uc744 \uc9c4\ud589\ud558\ub824\uba74 \uacc4\uc18d\uc744 \ud074\ub9ad\ud558\uc2ed\uc2dc\uc624.",cookiesRequired:"\ucfe0\ud0a4 \ud544\uc694",enableCookies:"\ube0c\ub77c\uc6b0\uc800 \ud658\uacbd \uc124\uc815\uc5d0\uc11c \ucfe0\ud0a4\ub97c \ud65c\uc131\ud654\ud558\uc5ec Torus\uc5d0 \uc561\uc138\uc2a4\ud558\uc2ed\uc2dc\uc624.",clickHere:"\ub354 \ub9ce\uc740 \uc815\ubcf4"}},zh:{embed:{continue:"\u7ee7\u7eed",actionRequired:"\u9700\u8981\u6388\u6743",pendingAction:"\u5355\u51fb\u7ee7\u7eed\u4ee5\u5728\u5f39\u51fa\u7a97\u53e3\u4e2d\u7ee7\u7eed\u60a8\u7684\u8bf7\u6c42",cookiesRequired:"\u5fc5\u586bCookie",enableCookies:"\u8bf7\u5728\u60a8\u7684\u6d4f\u89c8\u5668\u9996\u9009\u9879\u4e2d\u542f\u7528cookie\u4ee5\u8bbf\u95eeTorus\u3002",clickHere:"\u66f4\u591a\u4fe1\u606f"}}},prodTorusUrl:"",localStorageKeyPrefix:"torus-"},ye=R=>{const u=window.document.createElement("template"),w=R.trim();return u.innerHTML=w,u.content.firstChild},_e=(R,u,w)=>{const x=q=>{w(q),R.removeListener(u,x)};R.on(u,x)};var $=Te(4063),z=Te.n($),ae=Te(4970);const fe=d().getLogger("torus-embed"),de={errors:{disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",sendSiteMetadata:()=>"Torus: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:R=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${R} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:(R,u)=>`Invalid options. Received: { maxEventListeners: ${R}, shouldSendMetadata: ${u} }`,invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:R=>`'args.logger' must include required method '${R}'.`},info:{connected:R=>`Torus: Connected to chain with ID "${R}".`},warnings:{enableDeprecation:'Torus: ""ethereum.enable()" is deprecated and may be removed in the future. Please use "ethereum.send("eth_requestAccounts")" instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1102',sendDeprecation:'Torus: "ethereum.send(...)" is deprecated and may be removed in the future. Please use "ethereum.sendAsync(...)" or "ethereum.request(...)" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193',events:{close:'Torus: The event "close" is deprecated and may be removed in the future. Please use "disconnect" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193',data:'Torus: The event "data" is deprecated and will be removed in the future.Use "message" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message',networkChanged:'Torus: The event "networkChanged" is deprecated and may be removed in the future. Please use "chainChanged" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193',notification:'Torus: The event "notification" is deprecated and may be removed in the future. Please use "message" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193'},publicConfigStore:'Torus: The property "publicConfigStore" is deprecated and WILL be removed in the future.'}};function r(R,u){var w=Object.keys(R);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(R);u&&(x=x.filter(function(q){return Object.getOwnPropertyDescriptor(R,q).enumerable})),w.push.apply(w,x)}return w}function l(R){for(var u=1;uthis.push(w),this.obsStore=u,this.obsStore.subscribe(this.handler)}pipe(u,w){const x=super.pipe(u,w);return u.write(this.obsStore.getState()),x}_write(u,w,x){this.obsStore.putState(u),x()}_read(u){}_destroy(u,w){this.obsStore.unsubscribe(this.handler),super._destroy(u,w)}}function f(R,u){var w=Object.keys(R);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(R);u&&(x=x.filter(function(q){return Object.getOwnPropertyDescriptor(R,q).enumerable})),w.push.apply(w,x)}return w}function m(R){for(var u=1;u0&&w.emit("error",x)}const N=()=>Math.random().toString(36).slice(2),j=function(){var R=Ie(function*(u,w){let x,q,oe=w.version||"2.2.7";try{if(("binance"===u||"production"===u)&&!w.version){let he;he=ce.prodTorusUrl?{data:ce.prodTorusUrl}:yield y(`${ce.api}/latestversion?name=@toruslabs/torus-embed&version=2.2.7`,{},{useAPIKey:!0}),oe=he.data,ce.prodTorusUrl=he.data}}catch(he){fe.error(he,"unable to fetch latest version")}switch(fe.info("version used: ",oe),u){case"binance":x=`https://binance.tor.us/v${oe}`,q="info";break;case"testing":x="https://testing.tor.us",q="debug";break;case"bnb":x="https://bnb.tor.us",q="error";break;case"polygon":x="https://polygon.tor.us",q="error";break;case"lrc":x="https://lrc.tor.us",q="debug";break;case"beta":x="https://beta.tor.us",q="debug";break;case"development":x="http://localhost:4050",q="debug";break;case"alpha":x="https://alpha.tor.us",q="debug";break;default:x=`https://app.tor.us/v${oe}`,q="error"}return{torusUrl:x,logLevel:q}});return function(w,x){return R.apply(this,arguments)}}(),J=()=>{let R=window.navigator.language||"en-US";const u=R.split("-");return R=Object.prototype.hasOwnProperty.call(ce.translations,u[0])?u[0]:"en",R},le=["eth_subscription"],Re=()=>{},Ce="directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=660,width=375",Pe="directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=700,width=450";function ke(R,u){var w=Object.keys(R);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(R);u&&(x=x.filter(function(q){return Object.getOwnPropertyDescriptor(R,q).enumerable})),w.push.apply(w,x)}return w}function De(R){for(var u=1;u2&&void 0!==arguments[2])||arguments[2];return(x,q)=>x||q.error?u(x||q.error):!w||Array.isArray(q)?R(q):R(q.result)};class Ve extends Q{constructor(u){let{maxEventListeners:w=100,shouldSendMetadata:x=!0,jsonRpcStreamName:q="provider"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),t(this,"chainId",void 0),t(this,"selectedAddress",void 0),t(this,"_rpcEngine",void 0),t(this,"networkVersion",void 0),t(this,"shouldSendMetadata",void 0),t(this,"isTorus",void 0),t(this,"_publicConfigStore",void 0),t(this,"tryPreopenHandle",void 0),t(this,"enable",void 0),t(this,"_state",void 0),t(this,"_jsonRpcConnection",void 0),t(this,"_sentWarnings",{enable:!1,experimentalMethods:!1,send:!1,publicConfigStore:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}}),!(0,ae.duplex)(u))throw new Error(de.errors.invalidDuplexStream());this.isTorus=!0,this.setMaxListeners(w),this._state=De({},Ve._defaultState),this.selectedAddress=null,this.networkVersion=null,this.chainId=null,this.shouldSendMetadata=x,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._sendSync=this._sendSync.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._initializeState=this._initializeState.bind(this),this.request=this.request.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this);const ne=new X;k()(u,ne,u,this._handleStreamDisconnect.bind(this,"MetaMask")),this._publicConfigStore=new h({storageKey:"Metamask-Config"}),k()(ne.createStream("publicConfig"),new M(this._publicConfigStore),S.bind(this,"MetaMask PublicConfigStore")),ne.ignoreStream("phishing"),this.on("connect",()=>{this._state.isConnected=!0});const he=function(){const be={},Ee=new Q,Ae=new b.Duplex({objectMode:!0,read:function(){return!1},write:function(Le,Ne,Ue){let Be;try{Le.id?function(Ke){const tt=be[Ke.id];if(!tt)throw new Error(`StreamMiddleware - Unknown response id "${Ke.id}"`);delete be[Ke.id],Object.assign(tt.res,Ke),setTimeout(tt.end)}(Le):Ee.emit("notification",Ke=Le)}catch(Ke){Be=Ke}var Ke;Ue(Be)}});return{events:Ee,middleware:(Le,Ne,Ue,Be)=>{Ae.push(Le),be[Le.id]={req:Le,res:Ne,next:Ue,end:Be}},stream:Ae}}();k()(he.stream,ne.createStream(q),he.stream,this._handleStreamDisconnect.bind(this,"MetaMask RpcProvider"));const pe=new we;pe.push((be,Ee,Ae,Le)=>{const Ne=be.id,Ue=Math.random().toString(36).slice(2);be.id=Ue,Ee.id=Ue,Ae(Be=>{be.id=Ne,Ee.id=Ne,Be()})}),pe.push((be,Ee,Ae)=>{"string"==typeof be.method&&be.method||(Ee.error=v.PY.invalidRequest({message:"The request 'method' must be a non-empty string.",data:m(m({},be||{}),{},{cause:"The request 'method' must be a non-empty string."})})),Ae(Le=>{const{error:Ne}=Ee;return Ne&&fe.error(`MetaMask - RPC Error: ${Ne.message}`,Ne),Le()})}),pe.push(he.middleware),this._rpcEngine=pe,he.events.on("notification",be=>{const{method:Ee,params:Ae}=be;"wallet_accountsChanged"===Ee?this._handleAccountsChanged(Ae):"wallet_unlockStateChanged"===Ee?this._handleUnlockStateChanged(Ae):"wallet_chainChanged"===Ee?this._handleChainChanged(Ae):le.includes(be.method)&&(this.emit("data",be),this.emit("notification",Ae.result),this.emit("message",{type:Ee,data:Ae}))})}get publicConfigStore(){return this._sentWarnings.publicConfigStore||(fe.warn(de.warnings.publicConfigStore),this._sentWarnings.publicConfigStore=!0),this._publicConfigStore}isConnected(){return this._state.isConnected}request(u){var w=this;return Ie(function*(){if(!u||"object"!=typeof u||Array.isArray(u))throw v.PY.invalidRequest({message:de.errors.invalidRequestArgs(),data:De(De({},u||{}),{},{cause:de.errors.invalidRequestArgs()})});const{method:x,params:q}=u;if("string"!=typeof x||0===x.length)throw v.PY.invalidRequest({message:de.errors.invalidRequestMethod(),data:De(De({},u||{}),{},{cause:de.errors.invalidRequestArgs()})});if(void 0!==q&&!Array.isArray(q)&&("object"!=typeof q||null===q))throw v.PY.invalidRequest({message:de.errors.invalidRequestParams(),data:De(De({},u||{}),{},{cause:de.errors.invalidRequestArgs()})});return new Promise((ne,oe)=>{w._rpcRequest({method:x,params:q},We(ne,oe))})})()}sendAsync(u,w){this._rpcRequest(u,w)}addListener(u,w){return this._warnOfDeprecation(u),super.addListener(u,w)}on(u,w){return this._warnOfDeprecation(u),super.on(u,w)}once(u,w){return this._warnOfDeprecation(u),super.once(u,w)}prependListener(u,w){return this._warnOfDeprecation(u),super.prependListener(u,w)}prependOnceListener(u,w){return this._warnOfDeprecation(u),super.prependOnceListener(u,w)}_initializeState(){var u=this;return Ie(function*(){try{const{accounts:w,chainId:x,isUnlocked:q,networkVersion:ne}=yield u.request({method:"wallet_getProviderState"});u.emit("connect",{chainId:x}),u._handleChainChanged({chainId:x,networkVersion:ne}),u._handleUnlockStateChanged({accounts:w,isUnlocked:q}),u._handleAccountsChanged(w)}catch(w){fe.error("MetaMask: Failed to get initial state. Please report this bug.",w)}finally{fe.info("initialized state"),u._state.initialized=!0,u.emit("_initialized")}})()}_rpcRequest(u,w){let x=arguments.length>2&&void 0!==arguments[2]&&arguments[2],q=w;const ne=u;if(!Array.isArray(ne))if(ne.jsonrpc||(ne.jsonrpc="2.0"),"eth_accounts"===ne.method||"eth_requestAccounts"===ne.method)q=(oe,he)=>{this._handleAccountsChanged(he.result||[],"eth_accounts"===ne.method,x),w(oe,he)};else if("wallet_getProviderState"===ne.method)return void this._rpcEngine.handle(u,q);this.tryPreopenHandle(ne,q)}send(u,w){return this._sentWarnings.send||(fe.warn(de.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof u||w&&!Array.isArray(w)?u&&"object"==typeof u&&"function"==typeof w?this._rpcRequest(u,w):this._sendSync(u):new Promise((x,q)=>{try{this._rpcRequest({method:u,params:w},We(x,q,!1))}catch(ne){q(ne)}})}_sendSync(u){let w;switch(u.method){case"eth_accounts":w=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":w=this.selectedAddress||null;break;case"eth_uninstallFilter":this._rpcRequest(u,Re),w=!0;break;case"net_version":w=this.networkVersion||null;break;default:throw new Error(de.errors.unsupportedSync(u.method))}return{id:u.id,jsonrpc:u.jsonrpc,result:w}}_handleConnect(u){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:u}),fe.debug(de.info.connected(u)))}_handleDisconnect(u,w){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!u){let x;this._state.isConnected=!1,u?(x=new v.yd(1013,w||de.errors.disconnected()),fe.debug(x)):(x=new v.yd(1011,w||de.errors.permanentlyDisconnected()),fe.error(x),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",x)}}_handleStreamDisconnect(u,w){S(u,w,this),this._handleDisconnect(!1,w?w.message:void 0)}_handleAccountsChanged(u){let w=arguments.length>1&&void 0!==arguments[1]&&arguments[1],x=arguments.length>2&&void 0!==arguments[2]&&arguments[2],q=u;Array.isArray(q)||(fe.error("MetaMask: Received non-array accounts parameter. Please report this bug.",q),q=[]);for(const ne of u)if("string"!=typeof ne){fe.error("MetaMask: Received non-string account. Please report this bug.",u),q=[];break}z()(this._state.accounts,q)||(w&&Array.isArray(this._state.accounts)&&this._state.accounts.length>0&&!x&&fe.error('MetaMask: "eth_accounts" unexpectedly updated accounts. Please report this bug.',q),this._state.accounts=q,this.emit("accountsChanged",q)),this.selectedAddress!==q[0]&&(this.selectedAddress=q[0]||null)}_handleChainChanged(){let{chainId:u,networkVersion:w}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u&&w?"loading"===w?this._handleDisconnect(!0):(this._handleConnect(u),u!==this.chainId&&(this.chainId=u,this._state.initialized&&this.emit("chainChanged",this.chainId))):fe.error("MetaMask: Received invalid network parameters. Please report this bug.",{chainId:u,networkVersion:w})}_handleUnlockStateChanged(){let{accounts:u,isUnlocked:w}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"boolean"==typeof w?w!==this._state.isUnlocked&&(this._state.isUnlocked=w,this._handleAccountsChanged(u||[])):fe.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug.",{isUnlocked:w})}_warnOfDeprecation(u){!1===this._sentWarnings.events[u]&&(fe.warn(de.warnings.events[u]),this._sentWarnings.events[u]=!0)}}t(Ve,"_defaultState",{accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1,hasEmittedConnection:!1});const Je=Ve,ct=class He extends g.EventEmitter{constructor(u){let{url:w,target:x,features:q}=u;super(),t(this,"url",void 0),t(this,"target",void 0),t(this,"features",void 0),t(this,"window",void 0),t(this,"windowTimer",void 0),t(this,"iClosedWindow",void 0),this.url=w,this.target=x||"_blank",this.features=q||function(){const ne=void 0!==window.screenLeft?window.screenLeft:window.screenX,oe=void 0!==window.screenTop?window.screenTop:window.screenY,he=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,pe=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,be=Math.abs((he-1200)/2/1+ne);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=700,width=1200,top=${Math.abs((pe-700)/2/1+oe)},left=${be}`}(),this.window=void 0,this.windowTimer=void 0,this.iClosedWindow=!1,this._setupTimer()}_setupTimer(){this.windowTimer=Number(setInterval(()=>{this.window&&this.window.closed&&(clearInterval(this.windowTimer),this.iClosedWindow||this.emit("close"),this.iClosedWindow=!1,this.window=void 0),void 0===this.window&&clearInterval(this.windowTimer)},500))}open(){var u;this.window=window.open(this.url.href,this.target,this.features),null!==(u=this.window)&&void 0!==u&&u.focus&&this.window.focus()}close(){this.iClosedWindow=!0,this.window&&this.window.close()}redirect(u){u?window.location.replace(this.url.href):window.location.href=this.url.href}};function st(R){return new Promise((u,w)=>{try{const x=document.createElement("img");x.onload=()=>u(!0),x.onerror=()=>u(!1),x.src=R}catch(x){w(x)}})}const ft=R=>{const{document:u}=R,w=u.querySelector('head > meta[property="og:site_name"]');if(w)return w.content;const x=u.querySelector('head > meta[name="title"]');return x?x.content:u.title&&u.title.length>0?u.title:R.location.hostname};function rt(R){return nt.apply(this,arguments)}function nt(){return(nt=Ie(function*(R){const{document:u}=R;let w=u.querySelector('head > link[rel="shortcut icon"]');return w&&(yield st(w.href))?w.href:(w=Array.from(u.querySelectorAll('head > link[rel="icon"]')).find(x=>Boolean(x.href)),w&&(yield st(w.href))?w.href:null)})).apply(this,arguments)}var ht=Te(8764).Buffer;const pt=["host","chainId","networkName"];function at(R,u){var w=Object.keys(R);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(R);u&&(x=x.filter(function(q){return Object.getOwnPropertyDescriptor(R,q).enumerable})),w.push.apply(w,x)}return w}function vt(R){for(var u=1;u"u")return;const R=document.createElement("link"),{torusUrl:u}=yield j("production",{version:""});R.href=`${u}/popup`,R.crossOrigin="anonymous",R.type="text/html",R.rel="prefetch",R.relList&&R.relList.supports&&R.relList.supports("prefetch")&&document.head.appendChild(R)}catch(R){fe.warn(R)}})();const Y=class{constructor(){let{buttonPosition:R=se.BOTTOM_LEFT,buttonSize:u=56,modalZIndex:w=99999,apiKey:x="torus-default"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t(this,"buttonPosition",se.BOTTOM_LEFT),t(this,"buttonSize",void 0),t(this,"torusUrl",void 0),t(this,"torusIframe",void 0),t(this,"styleLink",void 0),t(this,"isLoggedIn",void 0),t(this,"isInitialized",void 0),t(this,"torusWidgetVisibility",void 0),t(this,"torusAlert",void 0),t(this,"apiKey",void 0),t(this,"modalZIndex",void 0),t(this,"alertZIndex",void 0),t(this,"torusAlertContainer",void 0),t(this,"isIframeFullScreen",void 0),t(this,"whiteLabel",void 0),t(this,"requestedVerifier",void 0),t(this,"currentVerifier",void 0),t(this,"embedTranslations",void 0),t(this,"ethereum",void 0),t(this,"provider",void 0),t(this,"communicationMux",void 0),t(this,"isLoginCallback",void 0),t(this,"paymentProviders",ce.paymentProviders),t(this,"loginHint",""),t(this,"useWalletConnect",void 0),t(this,"isCustomLogin",!1),this.buttonPosition=R,this.buttonSize=u,this.torusUrl="",this.isLoggedIn=!1,this.isInitialized=!1,this.torusWidgetVisibility=!0,this.requestedVerifier="",this.currentVerifier="",this.apiKey=x,function a(R){i=R}(x),this.modalZIndex=w,this.alertZIndex=w+1e3,this.isIframeFullScreen=!1}init(){var R=arguments,u=this;return Ie(function*(){let{buildEnv:w=ue.PRODUCTION,enableLogging:x=!1,network:q={host:"mainnet",chainId:null,networkName:"",blockExplorer:"",ticker:"",tickerName:""},loginConfig:ne={},showTorusButton:oe=!0,integrity:he={version:""},whiteLabel:pe,useWalletConnect:be=!1,mfaLevel:Ee="default"}=R.length>0&&void 0!==R[0]?R[0]:{};if(u.isInitialized)throw new Error("Already initialized");const{torusUrl:Ae,logLevel:Le}=yield j(w,he);fe.info(Ae,"url loaded"),u.torusUrl=Ae,u.whiteLabel=pe,u.useWalletConnect=be,u.isCustomLogin=!!(ne&&Object.keys(ne).length>0)||!!(pe&&Object.keys(pe).length>0),fe.setDefaultLevel(Le),x?fe.enableAll():fe.disableAll(),u.torusWidgetVisibility=oe;const Ne=new URL(Ae);Ne.pathname.endsWith("/")?Ne.pathname+="popup":Ne.pathname+="/popup",Ne.hash=`#isCustomLogin=${u.isCustomLogin}`,u.torusIframe=ye(`