bringid 0.2.1-beta → 0.3.0-beta-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +14 -8
  2. package/dist/index.js +1 -1
  3. package/dist/modules/bring-id-sdk/index.d.ts.map +1 -1
  4. package/dist/modules/bring-id-sdk/types/verify-proofs/index.d.ts +13 -1
  5. package/dist/modules/bring-id-sdk/types/verify-proofs/index.d.ts.map +1 -1
  6. package/dist/types/credential-group-points-map.d.ts +2 -0
  7. package/dist/types/credential-group-points-map.d.ts.map +1 -0
  8. package/dist/types/index.d.ts +6 -20
  9. package/dist/types/index.d.ts.map +1 -1
  10. package/dist/types/task-check.d.ts +6 -0
  11. package/dist/types/task-check.d.ts.map +1 -0
  12. package/dist/types/task-group.d.ts +2 -2
  13. package/dist/types/task-group.d.ts.map +1 -1
  14. package/dist/types/task.d.ts +9 -8
  15. package/dist/types/task.d.ts.map +1 -1
  16. package/dist/types/tasks-config.d.ts +3 -0
  17. package/dist/types/tasks-config.d.ts.map +1 -0
  18. package/dist/utils/fetch-tasks-config.d.ts +4 -0
  19. package/dist/utils/fetch-tasks-config.d.ts.map +1 -0
  20. package/dist/utils/index.d.ts +2 -1
  21. package/dist/utils/index.d.ts.map +1 -1
  22. package/package.json +1 -1
  23. package/dist/types/connection-quality.d.ts +0 -2
  24. package/dist/types/connection-quality.d.ts.map +0 -1
  25. package/dist/types/extension-status.d.ts +0 -3
  26. package/dist/types/extension-status.d.ts.map +0 -1
  27. package/dist/types/message.d.ts +0 -5
  28. package/dist/types/message.d.ts.map +0 -1
  29. package/dist/types/notarization-group-check.d.ts +0 -6
  30. package/dist/types/notarization-group-check.d.ts.map +0 -1
  31. package/dist/types/notarization-group.d.ts +0 -8
  32. package/dist/types/notarization-group.d.ts.map +0 -1
  33. package/dist/types/notarization-status.d.ts +0 -2
  34. package/dist/types/notarization-status.d.ts.map +0 -1
  35. package/dist/types/notarization-step.d.ts +0 -7
  36. package/dist/types/notarization-step.d.ts.map +0 -1
  37. package/dist/types/result.d.ts +0 -2
  38. package/dist/types/result.d.ts.map +0 -1
  39. package/dist/types/semaphore-proof-server.d.ts +0 -7
  40. package/dist/types/semaphore-proof-server.d.ts.map +0 -1
  41. package/dist/types/task-group-check.d.ts +0 -6
  42. package/dist/types/task-group-check.d.ts.map +0 -1
  43. package/dist/types/task-server.d.ts +0 -18
  44. package/dist/types/task-server.d.ts.map +0 -1
  45. package/dist/types/task-status.d.ts +0 -3
  46. package/dist/types/task-status.d.ts.map +0 -1
  47. package/dist/types/task-type.d.ts +0 -3
  48. package/dist/types/task-type.d.ts.map +0 -1
  49. package/dist/types/user-status.d.ts +0 -2
  50. package/dist/types/user-status.d.ts.map +0 -1
  51. package/dist/types/user.d.ts +0 -9
  52. package/dist/types/user.d.ts.map +0 -1
  53. package/dist/types/verification-data.d.ts +0 -9
  54. package/dist/types/verification-data.d.ts.map +0 -1
  55. package/dist/types/verification-status.d.ts +0 -2
  56. package/dist/types/verification-status.d.ts.map +0 -1
  57. package/dist/types/verification.d.ts +0 -11
  58. package/dist/types/verification.d.ts.map +0 -1
  59. package/dist/types/verify-result.d.ts +0 -11
  60. package/dist/types/verify-result.d.ts.map +0 -1
package/README.md CHANGED
@@ -21,8 +21,8 @@ const { score } = await bringid.getAddressScore("0x...");
21
21
  // Verify humanity and get proofs — requires modal setup (see below)
22
22
  const { proofs, points } = await bringid.verifyHumanity();
23
23
 
24
- // Verify proofs — works immediately
25
- const isVerified = await bringid.verifyProofs({ proofs: [ ... ]})
24
+ // Verify proofs and get points breakdown — works immediately
25
+ const { verified, points } = await bringid.verifyProofs({ proofs: [ ... ]})
26
26
 
27
27
  ```
28
28
 
@@ -123,19 +123,25 @@ const { score } = await bringid.getAddressScore("0x...");
123
123
 
124
124
  ### `bringid.verifyProofs({ proofs, provider })`
125
125
 
126
- Returns `true` if proofs are valid. If not -- returns `false`
126
+ Verifies proofs and returns verification status with points breakdown.
127
127
 
128
128
  ```ts
129
- const isVerified = await bringid.verifyProofs({ proofs: [ ... ] });
130
- // it will check the validity of proofs and return a boolean value
131
-
129
+ const { verified, points } = await bringid.verifyProofs({ proofs: [ ... ] });
130
+ // verified: true/false
131
+ // points: { total: 15, groups: [{ credential_group_id: "16", points: 10 }, ...] }
132
132
 
133
133
  const provider = new JsonRpcProvider('https://sepolia.base.org');
134
- const isVerified = await bringid.verifyProofs({ proofs: [ ... ], provider });
134
+ const { verified, points } = await bringid.verifyProofs({ proofs: [ ... ], provider });
135
135
  // it is possible to use a custom JSONRpcProvider for a proofs validity check
136
-
137
136
  ```
138
137
 
138
+ **Returns:**
139
+
140
+ - `verified` — boolean indicating if proofs are valid
141
+ - `points` — object containing:
142
+ - `total` — total points across all credential groups
143
+ - `groups` — array of `{ credential_group_id, points }` for each proof
144
+
139
145
  ### `bringid.verifyHumanity(options?)`
140
146
 
141
147
  Opens the verification modal and returns proofs. Requires the modal provider to be mounted.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.BringSDK=e():t.BringSDK=e()}(this,(function(){return function(){"use strict";var t={d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{BringID:function(){return gr}});var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16),s=[];for(let t=0;t<256;++t)s.push((t+256).toString(16).slice(1));function o(t,e,n){var o,a,c,u;const l=null!==(o=null!==(a=(t=t||{}).random)&&void 0!==a?a:null===(c=(u=t).rng)||void 0===c?void 0:c.call(u))&&void 0!==o?o:function(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(i)}();if(l.length<16)throw new Error("Random bytes length must be >= 16");if(l[6]=15&l[6]|64,l[8]=63&l[8]|128,e){if((n=n||0)<0||n+16>e.length)throw new RangeError("UUID byte range ".concat(n,":").concat(n+15," is out of buffer bounds"));for(let t=0;t<16;++t)e[n+t]=l[t];return e}return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]).toLowerCase()}(l)}var a=()=>{return!n.randomUUID||e||t?o(t,e,r):n.randomUUID();var t,e,r},c="zpka_52e44068bb9745f2be776b343e96cdab_1a60a93b",u="https://api.bringid.org";function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){f(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function f(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var p=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return fetch(t,{method:e,body:"GET"===e||"OPTIONS"===e?void 0:JSON.stringify(r),headers:h({},n)}).then((async t=>{if(!t.ok){const e=await t.json();throw new Error(e.error)}return t.json()}))},d=t=>p("".concat(u,"/v1/score/address/").concat(t),"GET",{Authorization:"Bearer ".concat(c),"content-type":"application/json"}),g=(t,e,n)=>p("".concat(u,"/v1/proofs/verify"),"POST",{Authorization:"Bearer ".concat(c),"content-type":"application/json"},{proofs:t,registry:n,chain_id:e}),y=[{inputs:[{components:[{internalType:"uint256",name:"credentialGroupId",type:"uint256"},{components:[{internalType:"uint256",name:"merkleTreeDepth",type:"uint256"},{internalType:"uint256",name:"merkleTreeRoot",type:"uint256"},{internalType:"uint256",name:"nullifier",type:"uint256"},{internalType:"uint256",name:"message",type:"uint256"},{internalType:"uint256",name:"scope",type:"uint256"},{internalType:"uint256[8]",name:"points",type:"uint256[8]"}],internalType:"struct ISemaphore.SemaphoreProof",name:"semaphoreProof",type:"tuple"}],internalType:"struct ICredentialRegistry.CredentialGroupProof",name:"proof_",type:"tuple"}],name:"verifyProof",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}],m=[{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3[]",name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"}];function b(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("Wrong positive integer: ".concat(t))}function w(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(n.length>0&&!n.includes(t.length))throw new Error("Expected Uint8Array of length ".concat(n,", not of length=").concat(t.length))}function v(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}const E=BigInt(2**32-1),O=BigInt(32);function x(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{h:Number(t&E),l:Number(t>>O&E)}:{h:0|Number(t>>O&E),l:0|Number(t&E)}}function N(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=x(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function A(t){if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got ".concat(typeof t));return new Uint8Array((new TextEncoder).encode(t))}(t)),!(t instanceof Uint8Array))throw new Error("expected Uint8Array, got ".concat(typeof t));return t}class T{clone(){return this._cloneInto()}}const[j,R,_]=[[],[],[]],k=BigInt(0),I=BigInt(1),P=BigInt(2),S=BigInt(7),U=BigInt(256),C=BigInt(113);for(let t=0,e=I,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],j.push(2*(5*r+n)),R.push((t+1)*(t+2)/2%64);let i=k;for(let t=0;t<7;t++)e=(e<<I^(e>>S)*C)%U,e&P&&(i^=I<<(I<<BigInt(t))-I);_.push(i)}const[F,B]=N(_,!0),L=(t,e,n)=>n>32?((t,e,n)=>e<<n-32|t>>>64-n)(t,e,n):((t,e,n)=>t<<n|e>>>32-n)(t,e,n),D=(t,e,n)=>n>32?((t,e,n)=>t<<n-32|e>>>64-n)(t,e,n):((t,e,n)=>e<<n|t>>>32-n)(t,e,n);class M extends T{constructor(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=r,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,b(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var s;this.state=new Uint8Array(200),this.state32=(s=this.state,new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)))}keccak(){!function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24;const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let e=0;e<10;e++)n[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const r=(e+8)%10,i=(e+2)%10,s=n[i],o=n[i+1],a=L(s,o,1)^n[r],c=D(s,o,1)^n[r+1];for(let n=0;n<50;n+=10)t[e+n]^=a,t[e+n+1]^=c}let e=t[2],i=t[3];for(let n=0;n<24;n++){const r=R[n],s=L(e,i,r),o=D(e,i,r),a=j[n];e=t[a],i=t[a+1],t[a]=s,t[a+1]=o}for(let e=0;e<50;e+=10){for(let r=0;r<10;r++)n[r]=t[e+r];for(let r=0;r<10;r++)t[e+r]^=~n[(r+2)%10]&n[(r+4)%10]}t[0]^=F[r],t[1]^=B[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){v(this);const{blockLen:e,state:n}=this,r=(t=A(t)).length;for(let i=0;i<r;){const s=Math.min(e-this.pos,r-i);for(let e=0;e<s;e++)n[this.pos++]^=t[i++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:n,blockLen:r}=this;t[n]^=e,128&e&&n===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){v(this,!1),w(t),this.finish();const e=this.state,{blockLen:n}=this;for(let r=0,i=t.length;r<i;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,i-r);t.set(e.subarray(this.posOut,this.posOut+s),r),this.posOut+=s,r+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return b(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(function(t,e){w(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least ".concat(n))}(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:n,outputLen:r,rounds:i,enableXOF:s}=this;return t||(t=new M(e,n,r,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=r,t.enableXOF=s,t.destroyed=this.destroyed,t}}const V=((t,e,n)=>function(t){const e=e=>t().update(A(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}((()=>new M(e,t,n))))(1,136,32);function z(t,e,n){const r=e.split("|").map((t=>t.trim()));for(let n=0;n<r.length;n++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error("invalid value for type ".concat(e));throw i.code="INVALID_ARGUMENT",i.argument="value.".concat(n),i.value=t,i}function J(t,e,n){for(let r in e){let i=e[r];const s=n?n[r]:null;s&&z(i,s,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function G(t,e){if(null==t)return"null";if(null==e&&(e=new Set),"object"==typeof t){if(e.has(t))return"[Circular]";e.add(t)}if(Array.isArray(t))return"[ "+t.map((t=>G(t,e))).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r<t.length;r++)n+=e[t[r]>>4],n+=e[15&t[r]];return n}if("object"==typeof t&&"function"==typeof t.toJSON)return G(t.toJSON(),e);switch(typeof t){case"boolean":case"number":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const n=Object.keys(t);return n.sort(),"{ "+n.map((n=>"".concat(G(n,e),": ").concat(G(t[n],e)))).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function K(t,e){return t&&t.code===e}function W(t,e,n){let r,i=t;{const r=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error("value will overwrite populated values: ".concat(G(n)));for(const t in n){if("shortMessage"===t)continue;const e=n[t];r.push(t+"="+G(e))}}r.push("code=".concat(e)),r.push("version=".concat("6.16.0")),r.length&&(t+=" ("+r.join(", ")+")")}switch(e){case"INVALID_ARGUMENT":r=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(t);break;default:r=new Error(t)}return J(r,{code:e}),n&&Object.assign(r,n),null==r.shortMessage&&J(r,{shortMessage:i}),r}function q(t,e,n,r){if(!t)throw W(e,n,r)}function $(t,e,n,r){q(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function H(t,e,n){null==n&&(n=""),n&&(n=": "+n),q(t>=e,"missing argument"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),q(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const Y=["NFD","NFC","NFKD","NFKC"].reduce(((t,e)=>{try{if("test"!=="test".normalize(e))throw new Error("bad");if("NFD"===e){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}t.push(e)}catch(t){}return t}),[]);function X(t,e,n){if(null==n&&(n=""),t!==e){let t=n,e="new";n&&(t+=".",e+=" "+n),q(!1,"private constructor; use ".concat(t,"from* methods"),"UNSUPPORTED_OPERATION",{operation:e})}}function Z(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if("string"==typeof t&&t.length%2==0&&t.match(/^0x[0-9a-f]*$/i)){const e=new Uint8Array((t.length-2)/2);let n=2;for(let r=0;r<e.length;r++)e[r]=parseInt(t.substring(n,n+2),16),n+=2;return e}$(!1,"invalid BytesLike value",e||"value",t)}function Q(t,e){return Z(t,e,!1)}function tt(t,e){return Z(t,e,!0)}function et(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||"number"==typeof e&&t.length!==2+2*e||!0===e&&t.length%2!=0)}const nt="0123456789abcdef";function rt(t){const e=Q(t);let n="0x";for(let t=0;t<e.length;t++){const r=e[t];n+=nt[(240&r)>>4]+nt[15&r]}return n}function it(t){return"0x"+t.map((t=>rt(t).substring(2))).join("")}function st(t,e,n){const r=Q(t);return null!=n&&n>r.length&&q(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),rt(r.slice(null==e?0:e,null==n?r.length:n))}function ot(t,e,n){const r=Q(t);q(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),rt(i)}let at=!1;const ct=function(t){return V(t)};let ut=ct;function lt(t){const e=Q(t,"data");return rt(ut(e))}function ht(t,e,n,r,i){if("BAD_PREFIX"===t||"UNEXPECTED_CONTINUE"===t){let t=0;for(let r=e+1;r<n.length&&n[r]>>6==2;r++)t++;return t}return"OVERRUN"===t?n.length-e-1:0}lt._=ct,lt.lock=function(){at=!0},lt.register=function(t){if(at)throw new TypeError("keccak256 is locked");ut=t},Object.freeze(lt);const ft=Object.freeze({error:function(t,e,n,r,i){$(!1,"invalid codepoint at offset ".concat(e,"; ").concat(t),"bytes",n)},ignore:ht,replace:function(t,e,n,r,i){return"OVERLONG"===t?($("number"==typeof i,"invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),ht(t,e,n))}});function pt(t,e){$("string"==typeof t,"invalid string value","str",t),null!=e&&(function(t){q(Y.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}(e),t=t.normalize(e));let n=[];for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){e++;const i=t.charCodeAt(e);$(e<t.length&&56320==(64512&i),"invalid surrogate pair","str",t);const s=65536+((1023&r)<<10)+(1023&i);n.push(s>>18|240),n.push(s>>12&63|128),n.push(s>>6&63|128),n.push(63&s|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return new Uint8Array(n)}function dt(t,e){return function(t,e){null==e&&(e=ft.error);const n=Q(t,"bytes"),r=[];let i=0;for(;i<n.length;){const t=n[i++];if(!(t>>7)){r.push(t);continue}let s=null,o=null;if(192==(224&t))s=1,o=127;else if(224==(240&t))s=2,o=2047;else{if(240!=(248&t)){i+=e(128==(192&t)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",i-1,n,r);continue}s=3,o=65535}if(i-1+s>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let a=t&(1<<8-s-1)-1;for(let t=0;t<s;t++){let t=n[i];if(128!=(192&t)){i+=e("MISSING_CONTINUE",i,n,r),a=null;break}a=a<<6|63&t,i++}null!==a&&(a>1114111?i+=e("OUT_OF_RANGE",i-1-s,n,r,a):a>=55296&&a<=57343?i+=e("UTF16_SURROGATE",i-1-s,n,r,a):a<=o?i+=e("OVERLONG",i-1-s,n,r,a):r.push(a))}return r}(t,e).map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function gt(t){return lt(pt(t))}const yt=BigInt(0),mt=BigInt(1),bt=9007199254740991;function wt(t,e){const n=Et(t,"value"),r=BigInt(Nt(e,"bits"));return n&(mt<<r)-mt}function vt(t,e){switch(typeof t){case"bigint":return t;case"number":return $(Number.isInteger(t),"underflow",e||"value",t),$(t>=-bt&&t<=bt,"overflow",e||"value",t),BigInt(t);case"string":try{if(""===t)throw new Error("empty string");return"-"===t[0]&&"-"!==t[1]?-BigInt(t.substring(1)):BigInt(t)}catch(n){$(!1,"invalid BigNumberish string: ".concat(n.message),e||"value",t)}}$(!1,"invalid BigNumberish value",e||"value",t)}function Et(t,e){const n=vt(t,e);return q(n>=yt,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const Ot="0123456789abcdef";function xt(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=Ot[n>>4],e+=Ot[15&n];return BigInt(e)}return vt(t)}function Nt(t,e){switch(typeof t){case"bigint":return $(t>=-bt&&t<=bt,"overflow",e||"value",t),Number(t);case"number":return $(Number.isInteger(t),"underflow",e||"value",t),$(t>=-bt&&t<=bt,"overflow",e||"value",t),t;case"string":try{if(""===t)throw new Error("empty string");return Nt(BigInt(t),e)}catch(n){$(!1,"invalid numeric string: ".concat(n.message),e||"value",t)}}$(!1,"invalid numeric value",e||"value",t)}function At(t,e){const n=Et(t,"value");let r=n.toString(16);if(null==e)r.length%2&&(r="0"+r);else{const i=Nt(e,"width");if(0===i&&n===yt)return"0x";for(q(2*i>=r.length,"value exceeds width (".concat(i," bytes)"),"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length<2*i;)r="0"+r}return"0x"+r}function Tt(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var jt=0;function Rt(t){return"__private_"+jt+++"_"+t}const _t=32,kt=new Uint8Array(_t),It=["then"],Pt={},St=new WeakMap;function Ut(t){return St.get(t)}function Ct(t,e){St.set(t,e)}function Ft(t,e){const n=new Error("deferred error during ABI decoding triggered accessing ".concat(t));throw n.error=e,n}function Bt(t,e,n){return t.indexOf(null)>=0?e.map(((t,e)=>t instanceof Dt?Bt(Ut(t),t,n):t)):t.reduce(((t,r,i)=>{let s=e.getValue(r);return r in t||(n&&s instanceof Dt&&(s=Bt(Ut(s),s,n)),t[r]=s),t}),{})}var Lt=Rt("names");class Dt extends Array{constructor(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=e[0];let i=e[1],s=(e[2]||[]).slice(),o=!0;r!==Pt&&(i=e,s=[],o=!1),super(i.length),Object.defineProperty(this,Lt,{writable:!0,value:void 0}),i.forEach(((t,e)=>{this[e]=t}));const a=s.reduce(((t,e)=>("string"==typeof e&&t.set(e,(t.get(e)||0)+1),t)),new Map);if(Ct(this,Object.freeze(i.map(((t,e)=>{const n=s[e];return null!=n&&1===a.get(n)?n:null})))),Tt(this,Lt)[Lt]=[],null==Tt(this,Lt)[Lt]&&Tt(this,Lt)[Lt],!o)return;Object.freeze(this);const c=new Proxy(this,{get:(t,e,n)=>{if("string"==typeof e){if(e.match(/^[0-9]+$/)){const n=Nt(e,"%index");if(n<0||n>=this.length)throw new RangeError("out of result range");const r=t[n];return r instanceof Error&&Ft("index ".concat(n),r),r}if(It.indexOf(e)>=0)return Reflect.get(t,e,n);const r=t[e];if(r instanceof Function)return function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];return r.apply(this===n?t:this,i)};if(!(e in t))return t.getValue.apply(this===n?t:this,[e])}return Reflect.get(t,e,n)}});return Ct(c,Ut(this)),c}toArray(t){const e=[];return this.forEach(((n,r)=>{n instanceof Error&&Ft("index ".concat(r),n),t&&n instanceof Dt&&(n=n.toArray(t)),e.push(n)})),e}toObject(t){const e=Ut(this);return e.reduce(((n,r,i)=>(q(null!=r,"value at index ".concat(i," unnamed"),"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Bt(e,this,t))),{})}slice(t,e){null==t&&(t=0),t<0&&(t+=this.length)<0&&(t=0),null==e&&(e=this.length),e<0&&(e+=this.length)<0&&(e=0),e>this.length&&(e=this.length);const n=Ut(this),r=[],i=[];for(let s=t;s<e;s++)r.push(this[s]),i.push(n[s]);return new Dt(Pt,r,i)}filter(t,e){const n=Ut(this),r=[],i=[];for(let s=0;s<this.length;s++){const o=this[s];o instanceof Error&&Ft("index ".concat(s),o),t.call(e,o,s,this)&&(r.push(o),i.push(n[s]))}return new Dt(Pt,r,i)}map(t,e){const n=[];for(let r=0;r<this.length;r++){const i=this[r];i instanceof Error&&Ft("index ".concat(r),i),n.push(t.call(e,i,r,this))}return n}getValue(t){const e=Ut(this).indexOf(t);if(-1===e)return;const n=this[e];return n instanceof Error&&Ft("property ".concat(JSON.stringify(t)),n.error),n}static fromItems(t,e){return new Dt(Pt,t,e)}}function Mt(t){let e=function(t,e){const n=Et(t,"value");if(n===yt){const t=null!=e?Nt(e,"width"):0;return new Uint8Array(t)}let r=n.toString(16);if(r.length%2&&(r="0"+r),null!=e){const n=Nt(e,"width");for(;r.length<2*n;)r="00"+r;q(2*n===r.length,"value exceeds width (".concat(n," bytes)"),"NUMERIC_FAULT",{operation:"toBeArray",fault:"overflow",value:t})}const i=new Uint8Array(r.length/2);for(let t=0;t<i.length;t++){const e=2*t;i[t]=parseInt(r.substring(e,e+2),16)}return i}(t);return q(e.length<=_t,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:_t,offset:e.length}),e.length!==_t&&(e=tt(it([kt.slice(e.length%_t),e]))),e}class Vt{constructor(t,e,n,r){this.name=void 0,this.type=void 0,this.localName=void 0,this.dynamic=void 0,J(this,{name:t,type:e,localName:n,dynamic:r},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,e){$(!1,t,this.localName,e)}}var zt=Rt("data"),Jt=Rt("dataLength"),Gt=Rt("writeData");class Kt{constructor(){Object.defineProperty(this,Gt,{value:Wt}),Object.defineProperty(this,zt,{writable:!0,value:void 0}),Object.defineProperty(this,Jt,{writable:!0,value:void 0}),Tt(this,zt)[zt]=[],Tt(this,Jt)[Jt]=0}get data(){return it(Tt(this,zt)[zt])}get length(){return Tt(this,Jt)[Jt]}appendWriter(t){return Tt(this,Gt)[Gt](tt(t.data))}writeBytes(t){let e=tt(t);const n=e.length%_t;return n&&(e=tt(it([e,kt.slice(n)]))),Tt(this,Gt)[Gt](e)}writeValue(t){return Tt(this,Gt)[Gt](Mt(t))}writeUpdatableValue(){const t=Tt(this,zt)[zt].length;return Tt(this,zt)[zt].push(kt),Tt(this,Jt)[Jt]+=_t,e=>{Tt(this,zt)[zt][t]=Mt(e)}}}function Wt(t){return Tt(this,zt)[zt].push(t),Tt(this,Jt)[Jt]+=t.length,t.length}var qt=Rt("data"),$t=Rt("offset"),Ht=Rt("bytesRead"),Yt=Rt("parent"),Xt=Rt("maxInflation"),Zt=Rt("incrementBytesRead"),Qt=Rt("peekBytes");class te{constructor(t,e,n){Object.defineProperty(this,Qt,{value:ne}),Object.defineProperty(this,Zt,{value:ee}),this.allowLoose=void 0,Object.defineProperty(this,qt,{writable:!0,value:void 0}),Object.defineProperty(this,$t,{writable:!0,value:void 0}),Object.defineProperty(this,Ht,{writable:!0,value:void 0}),Object.defineProperty(this,Yt,{writable:!0,value:void 0}),Object.defineProperty(this,Xt,{writable:!0,value:void 0}),J(this,{allowLoose:!!e}),Tt(this,qt)[qt]=tt(t),Tt(this,Ht)[Ht]=0,Tt(this,Yt)[Yt]=null,Tt(this,Xt)[Xt]=null!=n?n:1024,Tt(this,$t)[$t]=0}get data(){return rt(Tt(this,qt)[qt])}get dataLength(){return Tt(this,qt)[qt].length}get consumed(){return Tt(this,$t)[$t]}get bytes(){return new Uint8Array(Tt(this,qt)[qt])}subReader(t){const e=new te(Tt(this,qt)[qt].slice(Tt(this,$t)[$t]+t),this.allowLoose,Tt(this,Xt)[Xt]);return Tt(e,Yt)[Yt]=this,e}readBytes(t,e){let n=Tt(this,Qt)[Qt](0,t,!!e);return Tt(this,Zt)[Zt](t),Tt(this,$t)[$t]+=n.length,n.slice(0,t)}readValue(){return xt(this.readBytes(_t))}readIndex(){return Nt(xt(this.readBytes(_t)))}}function ee(t){if(Tt(this,Yt)[Yt])return Tt(Tt(this,Yt)[Yt],Zt)[Zt](t);Tt(this,Ht)[Ht]+=t,q(Tt(this,Xt)[Xt]<1||Tt(this,Ht)[Ht]<=Tt(this,Xt)[Xt]*this.dataLength,"compressed ABI data exceeds inflation ratio of ".concat(Tt(this,Xt)[Xt]," ( see: https://github.com/ethers-io/ethers.js/issues/4537 )"),"BUFFER_OVERRUN",{buffer:tt(Tt(this,qt)[qt]),offset:Tt(this,$t)[$t],length:t,info:{bytesRead:Tt(this,Ht)[Ht],dataLength:this.dataLength}})}function ne(t,e,n){let r=Math.ceil(e/_t)*_t;return Tt(this,$t)[$t]+r>Tt(this,qt)[qt].length&&(this.allowLoose&&n&&Tt(this,$t)[$t]+e<=Tt(this,qt)[qt].length?r=e:q(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:tt(Tt(this,qt)[qt]),length:Tt(this,qt)[qt].length,offset:Tt(this,$t)[$t]+r})),Tt(this,qt)[qt].slice(Tt(this,$t)[$t],Tt(this,$t)[$t]+r)}const re=BigInt(0),ie=BigInt(36);function se(t){const e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let t=0;t<40;t++)n[t]=e[t].charCodeAt(0);const r=Q(lt(n));for(let t=0;t<40;t+=2)r[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&r[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const oe={};for(let t=0;t<10;t++)oe[String(t)]=String(t);for(let t=0;t<26;t++)oe[String.fromCharCode(65+t)]=String(10+t);const ae=function(){const t={};for(let e=0;e<36;e++)t["0123456789abcdefghijklmnopqrstuvwxyz"[e]]=BigInt(e);return t}();function ce(t){if($("string"==typeof t,"invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=se(t);return $(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){$(t.substring(2,4)===function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>oe[t])).join("");for(;e.length>=15;){let t=e.substring(0,15);e=parseInt(t,10)%97+e.substring(t.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}(t),"bad icap checksum","address",t);let e=function(t){t=t.toLowerCase();let e=re;for(let n=0;n<t.length;n++)e=e*ie+ae[t[n]];return e}(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return se("0x"+e)}$(!1,"invalid address","address",t)}function ue(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var le=0;function he(t){return"__private_"+le+++"_"+t}const fe={};function pe(t,e){let n=!1;return e<0&&(n=!0,e*=-1),new me(fe,"".concat(n?"":"u","int").concat(e),t,{signed:n,width:e})}function de(t,e){return new me(fe,"bytes".concat(e||""),t,{size:e})}const ge=Symbol.for("_ethers_typed");var ye=he("options");class me{constructor(t,e,n,r){this.type=void 0,this.value=void 0,Object.defineProperty(this,ye,{writable:!0,value:void 0}),this._typedSymbol=void 0,null==r&&(r=null),X(fe,t,"Typed"),J(this,{_typedSymbol:ge,type:e,value:n}),ue(this,ye)[ye]=r,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?"tuple(".concat(this.value.map((t=>t.format())).join(","),")"):this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return ue(this,ye)[ye]}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===ue(this,ye)[ye]?-1:!1===ue(this,ye)[ye]?this.value.length:null}static from(t,e){return new me(fe,t,e)}static uint8(t){return pe(t,8)}static uint16(t){return pe(t,16)}static uint24(t){return pe(t,24)}static uint32(t){return pe(t,32)}static uint40(t){return pe(t,40)}static uint48(t){return pe(t,48)}static uint56(t){return pe(t,56)}static uint64(t){return pe(t,64)}static uint72(t){return pe(t,72)}static uint80(t){return pe(t,80)}static uint88(t){return pe(t,88)}static uint96(t){return pe(t,96)}static uint104(t){return pe(t,104)}static uint112(t){return pe(t,112)}static uint120(t){return pe(t,120)}static uint128(t){return pe(t,128)}static uint136(t){return pe(t,136)}static uint144(t){return pe(t,144)}static uint152(t){return pe(t,152)}static uint160(t){return pe(t,160)}static uint168(t){return pe(t,168)}static uint176(t){return pe(t,176)}static uint184(t){return pe(t,184)}static uint192(t){return pe(t,192)}static uint200(t){return pe(t,200)}static uint208(t){return pe(t,208)}static uint216(t){return pe(t,216)}static uint224(t){return pe(t,224)}static uint232(t){return pe(t,232)}static uint240(t){return pe(t,240)}static uint248(t){return pe(t,248)}static uint256(t){return pe(t,256)}static uint(t){return pe(t,256)}static int8(t){return pe(t,-8)}static int16(t){return pe(t,-16)}static int24(t){return pe(t,-24)}static int32(t){return pe(t,-32)}static int40(t){return pe(t,-40)}static int48(t){return pe(t,-48)}static int56(t){return pe(t,-56)}static int64(t){return pe(t,-64)}static int72(t){return pe(t,-72)}static int80(t){return pe(t,-80)}static int88(t){return pe(t,-88)}static int96(t){return pe(t,-96)}static int104(t){return pe(t,-104)}static int112(t){return pe(t,-112)}static int120(t){return pe(t,-120)}static int128(t){return pe(t,-128)}static int136(t){return pe(t,-136)}static int144(t){return pe(t,-144)}static int152(t){return pe(t,-152)}static int160(t){return pe(t,-160)}static int168(t){return pe(t,-168)}static int176(t){return pe(t,-176)}static int184(t){return pe(t,-184)}static int192(t){return pe(t,-192)}static int200(t){return pe(t,-200)}static int208(t){return pe(t,-208)}static int216(t){return pe(t,-216)}static int224(t){return pe(t,-224)}static int232(t){return pe(t,-232)}static int240(t){return pe(t,-240)}static int248(t){return pe(t,-248)}static int256(t){return pe(t,-256)}static int(t){return pe(t,-256)}static bytes1(t){return de(t,1)}static bytes2(t){return de(t,2)}static bytes3(t){return de(t,3)}static bytes4(t){return de(t,4)}static bytes5(t){return de(t,5)}static bytes6(t){return de(t,6)}static bytes7(t){return de(t,7)}static bytes8(t){return de(t,8)}static bytes9(t){return de(t,9)}static bytes10(t){return de(t,10)}static bytes11(t){return de(t,11)}static bytes12(t){return de(t,12)}static bytes13(t){return de(t,13)}static bytes14(t){return de(t,14)}static bytes15(t){return de(t,15)}static bytes16(t){return de(t,16)}static bytes17(t){return de(t,17)}static bytes18(t){return de(t,18)}static bytes19(t){return de(t,19)}static bytes20(t){return de(t,20)}static bytes21(t){return de(t,21)}static bytes22(t){return de(t,22)}static bytes23(t){return de(t,23)}static bytes24(t){return de(t,24)}static bytes25(t){return de(t,25)}static bytes26(t){return de(t,26)}static bytes27(t){return de(t,27)}static bytes28(t){return de(t,28)}static bytes29(t){return de(t,29)}static bytes30(t){return de(t,30)}static bytes31(t){return de(t,31)}static bytes32(t){return de(t,32)}static address(t){return new me(fe,"address",t)}static bool(t){return new me(fe,"bool",!!t)}static bytes(t){return new me(fe,"bytes",t)}static string(t){return new me(fe,"string",t)}static array(t,e){throw new Error("not implemented yet")}static tuple(t,e){throw new Error("not implemented yet")}static overrides(t){return new me(fe,"overrides",Object.assign({},t))}static isTyped(t){return t&&"object"==typeof t&&"_typedSymbol"in t&&t._typedSymbol===ge}static dereference(t,e){if(me.isTyped(t)){if(t.type!==e)throw new Error("invalid type: expecetd ".concat(e,", got ").concat(t.type));return t.value}return t}}class be extends Vt{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let n=me.dereference(e,"string");try{n=ce(n)}catch(t){return this._throwError(t.message,e)}return t.writeValue(n)}decode(t){return ce(At(t.readValue(),20))}}class we extends Vt{constructor(t){super(t.name,t.type,"_",t.dynamic),this.coder=void 0,this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}function ve(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&"object"==typeof n){let t={};r=e.map((e=>{const r=e.localName;return q(r,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:n}),q(!t[r],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:n}),t[r]=!0,n[r]}))}else $(!1,"invalid tuple value","tuple",n);$(e.length===r.length,"types/value length mismatch","tuple",n);let i=new Kt,s=new Kt,o=[];e.forEach(((t,e)=>{let n=r[e];if(t.dynamic){let e=s.length;t.encode(s,n);let r=i.writeUpdatableValue();o.push((t=>{r(t+e)}))}else t.encode(i,n)})),o.forEach((t=>{t(i.length)}));let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function Ee(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach((e=>{let s=null;if(e.dynamic){let n=t.readIndex(),r=i.subReader(n);try{s=e.decode(r)}catch(t){if(K(t,"BUFFER_OVERRUN"))throw t;s=t,s.baseType=e.name,s.name=e.localName,s.type=e.type}}else try{s=e.decode(t)}catch(t){if(K(t,"BUFFER_OVERRUN"))throw t;s=t,s.baseType=e.name,s.name=e.localName,s.type=e.type}if(null==s)throw new Error("investigate");n.push(s),r.push(e.localName||null)})),Dt.fromItems(n,r)}class Oe extends Vt{constructor(t,e,n){super("array",t.type+"["+(e>=0?e:"")+"]",n,-1===e||t.dynamic),this.coder=void 0,this.length=void 0,J(this,{coder:t,length:e})}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let n=0;n<this.length;n++)e.push(t);return e}encode(t,e){const n=me.dereference(e,"array");Array.isArray(n)||this._throwError("expected array value",n);let r=this.length;-1===r&&(r=n.length,t.writeValue(n.length)),H(n.length,r,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let t=0;t<n.length;t++)i.push(this.coder);return ve(t,i,n)}decode(t){let e=this.length;-1===e&&(e=t.readIndex(),q(e*_t<=t.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:t.bytes,offset:e*_t,length:t.dataLength}));let n=[];for(let t=0;t<e;t++)n.push(new we(this.coder));return Ee(t,n)}}class xe extends Vt{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){const n=me.dereference(e,"bool");return t.writeValue(n?1:0)}decode(t){return!!t.readValue()}}class Ne extends Vt{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=tt(e);let n=t.writeValue(e.length);return n+=t.writeBytes(e),n}decode(t){return t.readBytes(t.readIndex(),!0)}}class Ae extends Ne{constructor(t){super("bytes",t)}decode(t){return rt(super.decode(t))}}class Te extends Vt{constructor(t,e){let n="bytes"+String(t);super(n,n,e,!1),this.size=void 0,J(this,{size:t},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let n=tt(me.dereference(e,this.type));return n.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(n)}decode(t){return rt(t.readBytes(this.size))}}const je=new Uint8Array([]);class Re extends Vt{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes(je)}decode(t){return t.readBytes(0),null}}const _e=BigInt(0),ke=BigInt(1),Ie=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Pe extends Vt{constructor(t,e,n){const r=(e?"int":"uint")+8*t;super(r,r,n,!1),this.size=void 0,this.signed=void 0,J(this,{size:t,signed:e},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(t,e){let n=vt(me.dereference(e,this.type)),r=wt(Ie,256);if(this.signed){let t=wt(r,8*this.size-1);(n>t||n<-(t+ke))&&this._throwError("value out-of-bounds",e),n=function(t){let e=vt(t,"value");const n=BigInt(Nt(256,"width")),r=mt<<n-mt;return e<yt?(e=-e,q(e<=r,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t}),(~e&(mt<<n)-mt)+mt):(q(e<r,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t}),e)}(n)}else(n<_e||n>wt(r,8*this.size))&&this._throwError("value out-of-bounds",e);return t.writeValue(n)}decode(t){let e=wt(t.readValue(),8*this.size);return this.signed&&(e=function(t,e){const n=Et(t,"value"),r=BigInt(Nt(e,"width"));return q(n>>r===yt,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-mt?-((~n&(mt<<r)-mt)+mt):n}(e,8*this.size)),e}}class Se extends Ne{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,pt(me.dereference(e,"string")))}decode(t){return dt(super.decode(t))}}class Ue extends Vt{constructor(t,e){let n=!1;const r=[];t.forEach((t=>{t.dynamic&&(n=!0),r.push(t.type)})),super("tuple","tuple("+r.join(",")+")",e,n),this.coders=void 0,J(this,{coders:Object.freeze(t.slice())})}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[r]))})),Object.freeze(t)}encode(t,e){const n=me.dereference(e,"tuple");return ve(t,this.coders,n)}decode(t){return Ee(t,this.coders)}}var Ce;function Fe(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Be=0;function Le(t){return"__private_"+Be+++"_"+t}function De(t){const e=new Set;return t.forEach((t=>e.add(t))),Object.freeze(e)}const Me=De("external public payable override".split(" ")),Ve="constant external internal payable private public pure view override",ze=De(Ve.split(" ")),Je="constructor error event fallback function receive struct",Ge=De(Je.split(" ")),Ke="calldata memory storage payable indexed",We=De(Ke.split(" ")),qe=De([Je,Ke,"tuple returns",Ve].join(" ").split(" ")),$e={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},He=new RegExp("^(\\s*)"),Ye=new RegExp("^([0-9]+)"),Xe=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),Ze=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),Qe=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var tn=Le("offset"),en=Le("tokens"),nn=Le("subTokenString");class rn{get offset(){return Fe(this,tn)[tn]}get length(){return Fe(this,en)[en].length-Fe(this,tn)[tn]}constructor(t){Object.defineProperty(this,nn,{value:sn}),Object.defineProperty(this,tn,{writable:!0,value:void 0}),Object.defineProperty(this,en,{writable:!0,value:void 0}),Fe(this,tn)[tn]=0,Fe(this,en)[en]=t.slice()}clone(){return new rn(Fe(this,en)[en])}reset(){Fe(this,tn)[tn]=0}popKeyword(t){const e=this.peek();if("KEYWORD"!==e.type||!t.has(e.text))throw new Error("expected keyword ".concat(e.text));return this.pop().text}popType(t){if(this.peek().type!==t){const e=this.peek();throw new Error("expected ".concat(t,"; got ").concat(e.type," ").concat(JSON.stringify(e.text)))}return this.pop().text}popParen(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=Fe(this,nn)[nn](Fe(this,tn)[tn]+1,t.match+1);return Fe(this,tn)[tn]=t.match+1,e}popParams(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=[];for(;Fe(this,tn)[tn]<t.match-1;){const t=this.peek().linkNext;e.push(Fe(this,nn)[nn](Fe(this,tn)[tn]+1,t)),Fe(this,tn)[tn]=t}return Fe(this,tn)[tn]=t.match+1,e}peek(){if(Fe(this,tn)[tn]>=Fe(this,en)[en].length)throw new Error("out-of-bounds");return Fe(this,en)[en][Fe(this,tn)[tn]]}peekKeyword(t){const e=this.peekType("KEYWORD");return null!=e&&t.has(e)?e:null}peekType(t){if(0===this.length)return null;const e=this.peek();return e.type===t?e.text:null}pop(){const t=this.peek();return Fe(this,tn)[tn]++,t}toString(){const t=[];for(let e=Fe(this,tn)[tn];e<Fe(this,en)[en].length;e++){const n=Fe(this,en)[en][e];t.push("".concat(n.type,":").concat(n.text))}return"<TokenString ".concat(t.join(" "),">")}}function sn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Ce(Fe(this,en)[en].slice(t,e).map((e=>Object.freeze(Object.assign({},e,{match:e.match-t,linkBack:e.linkBack-t,linkNext:e.linkNext-t})))))}function on(t){const e=[],n=e=>{const n=s<t.length?JSON.stringify(t[s]):"$EOI";throw new Error("invalid token ".concat(n," at ").concat(s,": ").concat(e))};let r=[],i=[],s=0;for(;s<t.length;){let o=t.substring(s),a=o.match(He);a&&(s+=a[1].length,o=t.substring(s));const c={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:s,value:-1};e.push(c);let u=$e[o[0]]||"";if(u){if(c.type=u,c.text=o[0],s++,"OPEN_PAREN"===u)r.push(e.length-1),i.push(e.length-1);else if("CLOSE_PAREN"==u)0===r.length&&n("no matching open bracket"),c.match=r.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1;else if("COMMA"===u)c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1,i.push(e.length-1);else if("OPEN_BRACKET"===u)c.type="BRACKET";else if("CLOSE_BRACKET"===u){let t=e.pop().text;if(e.length>0&&"NUMBER"===e[e.length-1].type){const n=e.pop().text;t=n+t,e[e.length-1].value=Nt(n)}if(0===e.length||"BRACKET"!==e[e.length-1].type)throw new Error("missing opening bracket");e[e.length-1].text+=t}}else if(a=o.match(Xe),a){if(c.text=a[1],s+=c.text.length,qe.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(Qe)){c.type="TYPE";continue}c.type="ID"}else{if(a=o.match(Ye),!a)throw new Error("unexpected token ".concat(JSON.stringify(o[0])," at position ").concat(s));c.text=a[1],c.type="NUMBER",s+=c.text.length}}return new rn(e.map((t=>Object.freeze(t))))}function an(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error("conflicting types: ".concat(n.join(", ")))}function cn(t,e){if(e.peekKeyword(Ge)){const n=e.pop().text;if(n!==t)throw new Error("expected ".concat(t,", got ").concat(n))}return e.popType("ID")}function un(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(null==r||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error("duplicate keywords: ".concat(JSON.stringify(r)));n.add(r)}return Object.freeze(n)}function ln(t){let e=un(t,ze);return an(e,De("constant payable nonpayable".split(" "))),an(e,De("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function hn(t,e){return t.popParams().map((t=>Tn.from(t,e)))}function fn(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return vt(t.pop().text);throw new Error("invalid gas")}return null}function pn(t){if(t.length)throw new Error("unexpected tokens at offset ".concat(t.offset,": ").concat(t.toString()))}Ce=rn;const dn=new RegExp(/^(.*)\[([0-9]*)\]$/);function gn(t){const e=t.match(Qe);if($(e,"invalid type","type",t),"uint"===t)return"uint256";if("int"===t)return"int256";if(e[2]){const n=parseInt(e[2]);$(0!==n&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);$(0!==n&&n<=256&&n%8==0,"invalid numeric width","type",t)}return t}const yn={},mn=Symbol.for("_ethers_internal"),bn="_ParamTypeInternal",wn="_ErrorInternal",vn="_EventInternal",En="_ConstructorInternal",On="_FallbackInternal",xn="_FunctionInternal",Nn="_StructInternal";var An=Le("walkAsync");class Tn{constructor(t,e,n,r,i,s,o,a){if(Object.defineProperty(this,An,{value:jn}),this.name=void 0,this.type=void 0,this.baseType=void 0,this.indexed=void 0,this.components=void 0,this.arrayLength=void 0,this.arrayChildren=void 0,X(t,yn,"ParamType"),Object.defineProperty(this,mn,{value:bn}),s&&(s=Object.freeze(s.slice())),"array"===r){if(null==o||null==a)throw new Error("")}else if(null!=o||null!=a)throw new Error("");if("tuple"===r){if(null==s)throw new Error("")}else if(null!=s)throw new Error("");J(this,{name:e,type:n,baseType:r,indexed:i,components:s,arrayLength:o,arrayChildren:a})}format(t){if(null==t&&(t="sighash"),"json"===t){const e=this.name||"";if(this.isArray()){const t=JSON.parse(this.arrayChildren.format("json"));return t.name=e,t.type+="[".concat(this.arrayLength<0?"":String(this.arrayLength),"]"),JSON.stringify(t)}const n={type:"tuple"===this.baseType?"tuple":this.type,name:e};return"boolean"==typeof this.indexed&&(n.indexed=this.indexed),this.isTuple()&&(n.components=this.components.map((e=>JSON.parse(e.format(t))))),JSON.stringify(n)}let e="";return this.isArray()?(e+=this.arrayChildren.format(t),e+="[".concat(this.arrayLength<0?"":String(this.arrayLength),"]")):this.isTuple()?e+="("+this.components.map((e=>e.format(t))).join("full"===t?", ":",")+")":e+=this.type,"sighash"!==t&&(!0===this.indexed&&(e+=" indexed"),"full"===t&&this.name&&(e+=" "+this.name)),e}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(t,e){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return t.map((t=>n.arrayChildren.walk(t,e)))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");const n=this;return t.map(((t,r)=>n.components[r].walk(t,e)))}return e(this.type,t)}async walkAsync(t,e){const n=[],r=[t];return Fe(this,An)[An](n,t,e,(t=>{r[0]=t})),n.length&&await Promise.all(n),r[0]}static from(t,e){if(Tn.isParamType(t))return t;if("string"==typeof t)try{return Tn.from(on(t),e)}catch(e){$(!1,"invalid param type","obj",t)}else if(t instanceof rn){let n="",r="",i=null;un(t,De(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(r="tuple",i=t.popParams().map((t=>Tn.from(t))),n="tuple(".concat(i.map((t=>t.format())).join(","),")")):(n=gn(t.popType("TYPE")),r=n);let s=null,o=null;for(;t.length&&t.peekType("BRACKET");){const e=t.pop();s=new Tn(yn,"",n,r,null,i,o,s),o=e.value,n+=e.text,r="array",i=null}let a=null;if(un(t,We).has("indexed")){if(!e)throw new Error("");a=!0}const c=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new Tn(yn,c,n,r,a,i,o,s)}const n=t.name;$(!n||"string"==typeof n&&n.match(Ze),"invalid name","obj.name",n);let r=t.indexed;null!=r&&($(e,"parameter cannot be indexed","obj.indexed",t.indexed),r=!!r);let i=t.type,s=i.match(dn);if(s){const e=parseInt(s[2]||"-1"),o=Tn.from({type:s[1],components:t.components});return new Tn(yn,n||"",i,"array",r,null,e,o)}if("tuple"===i||i.startsWith("tuple(")||i.startsWith("(")){const e=null!=t.components?t.components.map((t=>Tn.from(t))):null;return new Tn(yn,n||"",i,"tuple",r,e,null,null)}return i=gn(t.type),new Tn(yn,n||"",i,i,r,null,null,null)}static isParamType(t){return t&&t[mn]===bn}}function jn(t,e,n,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const i=this.arrayChildren,s=e.slice();return s.forEach(((e,r)=>{Fe(i,An)[An](t,e,n,(t=>{s[r]=t}))})),void r(s)}if(this.isTuple()){const i=this.components;let s;if(Array.isArray(e))s=e.slice();else{if(null==e||"object"!=typeof e)throw new Error("invalid tuple value");s=i.map((t=>{if(!t.name)throw new Error("cannot use object value with unnamed components");if(!(t.name in e))throw new Error("missing value for component ".concat(t.name));return e[t.name]}))}if(s.length!==this.components.length)throw new Error("array is wrong length");return s.forEach(((e,r)=>{Fe(i[r],An)[An](t,e,n,(t=>{s[r]=t}))})),void r(s)}const i=n(this.type,e);i.then?t.push(async function(){r(await i)}()):r(i)}class Rn{constructor(t,e,n){this.type=void 0,this.inputs=void 0,X(t,yn,"Fragment"),J(this,{type:e,inputs:n=Object.freeze(n.slice())})}static from(t){if("string"==typeof t){try{Rn.from(JSON.parse(t))}catch(t){}return Rn.from(on(t))}if(t instanceof rn)switch(t.peekKeyword(Ge)){case"constructor":return Sn.from(t);case"error":return In.from(t);case"event":return Pn.from(t);case"fallback":case"receive":return Un.from(t);case"function":return Cn.from(t);case"struct":return Fn.from(t)}else if("object"==typeof t){switch(t.type){case"constructor":return Sn.from(t);case"error":return In.from(t);case"event":return Pn.from(t);case"fallback":case"receive":return Un.from(t);case"function":return Cn.from(t);case"struct":return Fn.from(t)}q(!1,"unsupported type: ".concat(t.type),"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}$(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return Sn.isFragment(t)}static isError(t){return In.isFragment(t)}static isEvent(t){return Pn.isFragment(t)}static isFunction(t){return Cn.isFragment(t)}static isStruct(t){return Fn.isFragment(t)}}class _n extends Rn{constructor(t,e,n,r){super(t,e,r),this.name=void 0,$("string"==typeof n&&n.match(Ze),"invalid identifier","name",n),r=Object.freeze(r.slice()),J(this,{name:n})}}function kn(t,e){return"("+e.map((e=>e.format(t))).join("full"===t?", ":",")+")"}class In extends _n{constructor(t,e,n){super(t,"error",e,n),Object.defineProperty(this,mn,{value:wn})}get selector(){return gt(this.format("sighash")).substring(0,10)}format(t){if(null==t&&(t="sighash"),"json"===t)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});const e=[];return"sighash"!==t&&e.push("error"),e.push(this.name+kn(t,this.inputs)),e.join(" ")}static from(t){if(In.isFragment(t))return t;if("string"==typeof t)return In.from(on(t));if(t instanceof rn){const e=cn("error",t),n=hn(t);return pn(t),new In(yn,e,n)}return new In(yn,t.name,t.inputs?t.inputs.map(Tn.from):[])}static isFragment(t){return t&&t[mn]===wn}}class Pn extends _n{constructor(t,e,n,r){super(t,"event",e,n),this.anonymous=void 0,Object.defineProperty(this,mn,{value:vn}),J(this,{anonymous:r})}get topicHash(){return gt(this.format("sighash"))}format(t){if(null==t&&(t="sighash"),"json"===t)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});const e=[];return"sighash"!==t&&e.push("event"),e.push(this.name+kn(t,this.inputs)),"sighash"!==t&&this.anonymous&&e.push("anonymous"),e.join(" ")}static getTopicHash(t,e){return e=(e||[]).map((t=>Tn.from(t))),new Pn(yn,t,e,!1).topicHash}static from(t){if(Pn.isFragment(t))return t;if("string"==typeof t)try{return Pn.from(on(t))}catch(e){$(!1,"invalid event fragment","obj",t)}else if(t instanceof rn){const e=cn("event",t),n=hn(t,!0),r=!!un(t,De(["anonymous"])).has("anonymous");return pn(t),new Pn(yn,e,n,r)}return new Pn(yn,t.name,t.inputs?t.inputs.map((t=>Tn.from(t,!0))):[],!!t.anonymous)}static isFragment(t){return t&&t[mn]===vn}}class Sn extends Rn{constructor(t,e,n,r,i){super(t,e,n),this.payable=void 0,this.gas=void 0,Object.defineProperty(this,mn,{value:En}),J(this,{payable:r,gas:i})}format(t){if(q(null!=t&&"sighash"!==t,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===t)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});const e=["constructor".concat(kn(t,this.inputs))];return this.payable&&e.push("payable"),null!=this.gas&&e.push("@".concat(this.gas.toString())),e.join(" ")}static from(t){if(Sn.isFragment(t))return t;if("string"==typeof t)try{return Sn.from(on(t))}catch(e){$(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof rn){un(t,De(["constructor"]));const e=hn(t),n=!!un(t,Me).has("payable"),r=fn(t);return pn(t),new Sn(yn,"constructor",e,n,r)}return new Sn(yn,"constructor",t.inputs?t.inputs.map(Tn.from):[],!!t.payable,null!=t.gas?t.gas:null)}static isFragment(t){return t&&t[mn]===En}}class Un extends Rn{constructor(t,e,n){super(t,"fallback",e),this.payable=void 0,Object.defineProperty(this,mn,{value:On}),J(this,{payable:n})}format(t){const e=0===this.inputs.length?"receive":"fallback";if("json"===t){const t=this.payable?"payable":"nonpayable";return JSON.stringify({type:e,stateMutability:t})}return"".concat(e,"()").concat(this.payable?" payable":"")}static from(t){if(Un.isFragment(t))return t;if("string"==typeof t)try{return Un.from(on(t))}catch(e){$(!1,"invalid fallback fragment","obj",t)}else if(t instanceof rn){const e=t.toString();if($(t.peekKeyword(De(["fallback","receive"])),"type must be fallback or receive","obj",e),"receive"===t.popKeyword(De(["fallback","receive"]))){const e=hn(t);return $(0===e.length,"receive cannot have arguments","obj.inputs",e),un(t,De(["payable"])),pn(t),new Un(yn,[],!0)}let n=hn(t);n.length?$(1===n.length&&"bytes"===n[0].type,"invalid fallback inputs","obj.inputs",n.map((t=>t.format("minimal"))).join(", ")):n=[Tn.from("bytes")];const r=ln(t);if($("nonpayable"===r||"payable"===r,"fallback cannot be constants","obj.stateMutability",r),un(t,De(["returns"])).has("returns")){const e=hn(t);$(1===e.length&&"bytes"===e[0].type,"invalid fallback outputs","obj.outputs",e.map((t=>t.format("minimal"))).join(", "))}return pn(t),new Un(yn,n,"payable"===r)}if("receive"===t.type)return new Un(yn,[],!0);if("fallback"===t.type){const e=[Tn.from("bytes")],n="payable"===t.stateMutability;return new Un(yn,e,n)}$(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[mn]===On}}class Cn extends _n{constructor(t,e,n,r,i,s){super(t,"function",e,r),this.constant=void 0,this.outputs=void 0,this.stateMutability=void 0,this.payable=void 0,this.gas=void 0,Object.defineProperty(this,mn,{value:xn}),J(this,{constant:"view"===n||"pure"===n,gas:s,outputs:i=Object.freeze(i.slice()),payable:"payable"===n,stateMutability:n})}get selector(){return gt(this.format("sighash")).substring(0,10)}format(t){if(null==t&&(t="sighash"),"json"===t)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t)))),outputs:this.outputs.map((e=>JSON.parse(e.format(t))))});const e=[];return"sighash"!==t&&e.push("function"),e.push(this.name+kn(t,this.inputs)),"sighash"!==t&&("nonpayable"!==this.stateMutability&&e.push(this.stateMutability),this.outputs&&this.outputs.length&&(e.push("returns"),e.push(kn(t,this.outputs))),null!=this.gas&&e.push("@".concat(this.gas.toString()))),e.join(" ")}static getSelector(t,e){return e=(e||[]).map((t=>Tn.from(t))),new Cn(yn,t,"view",e,[],null).selector}static from(t){if(Cn.isFragment(t))return t;if("string"==typeof t)try{return Cn.from(on(t))}catch(e){$(!1,"invalid function fragment","obj",t)}else if(t instanceof rn){const e=cn("function",t),n=hn(t),r=ln(t);let i=[];un(t,De(["returns"])).has("returns")&&(i=hn(t));const s=fn(t);return pn(t),new Cn(yn,e,r,n,i,s)}let e=t.stateMutability;return null==e&&(e="payable","boolean"==typeof t.constant?(e="view",t.constant||(e="payable","boolean"!=typeof t.payable||t.payable||(e="nonpayable"))):"boolean"!=typeof t.payable||t.payable||(e="nonpayable")),new Cn(yn,t.name,e,t.inputs?t.inputs.map(Tn.from):[],t.outputs?t.outputs.map(Tn.from):[],null!=t.gas?t.gas:null)}static isFragment(t){return t&&t[mn]===xn}}class Fn extends _n{constructor(t,e,n){super(t,"struct",e,n),Object.defineProperty(this,mn,{value:Nn})}format(){throw new Error("@TODO")}static from(t){if("string"==typeof t)try{return Fn.from(on(t))}catch(e){$(!1,"invalid struct fragment","obj",t)}else if(t instanceof rn){const e=cn("struct",t),n=hn(t);return pn(t),new Fn(yn,e,n)}return new Fn(yn,t.name,t.inputs?t.inputs.map(Tn.from):[])}static isFragment(t){return t&&t[mn]===Nn}}function Bn(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Ln=0;function Dn(t){return"__private_"+Ln+++"_"+t}const Mn=new Map;Mn.set(0,"GENERIC_PANIC"),Mn.set(1,"ASSERT_FALSE"),Mn.set(17,"OVERFLOW"),Mn.set(18,"DIVIDE_BY_ZERO"),Mn.set(33,"ENUM_RANGE_ERROR"),Mn.set(34,"BAD_STORAGE_DATA"),Mn.set(49,"STACK_UNDERFLOW"),Mn.set(50,"ARRAY_RANGE_ERROR"),Mn.set(65,"OUT_OF_MEMORY"),Mn.set(81,"UNINITIALIZED_FUNCTION_CALL");const Vn=new RegExp(/^bytes([0-9]*)$/),zn=new RegExp(/^(u?int)([0-9]*)$/);let Jn=null,Gn=1024;var Kn=Dn("getCoder");class Wn{constructor(){Object.defineProperty(this,Kn,{value:qn})}getDefaultValue(t){const e=t.map((t=>Bn(this,Kn)[Kn](Tn.from(t))));return new Ue(e,"_").defaultValue()}encode(t,e){H(e.length,t.length,"types/values length mismatch");const n=t.map((t=>Bn(this,Kn)[Kn](Tn.from(t)))),r=new Ue(n,"_"),i=new Kt;return r.encode(i,e),i.data}decode(t,e,n){const r=t.map((t=>Bn(this,Kn)[Kn](Tn.from(t))));return new Ue(r,"_").decode(new te(e,n,Gn))}static _setDefaultMaxInflation(t){$("number"==typeof t&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),Gn=t}static defaultAbiCoder(){return null==Jn&&(Jn=new Wn),Jn}static getBuiltinCallException(t,e,n){return function(t,e,n,r){let i="missing revert data",s=null,o=null;if(n){i="execution reverted";const t=Q(n);if(n=rt(n),0===t.length)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(t.length%32!=4)i+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===rt(t.slice(0,4)))try{s=r.decode(["string"],t.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[s]},i+=": ".concat(JSON.stringify(s))}catch(t){i+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===rt(t.slice(0,4)))try{const e=Number(r.decode(["uint256"],t.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[e]},s="Panic due to ".concat(Mn.get(e)||"UNKNOWN","(").concat(e,")"),i+=": ".concat(s)}catch(t){i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const a={to:e.to?ce(e.to):null,data:e.data||"0x"};return e.from&&(a.from=ce(e.from)),W(i,"CALL_EXCEPTION",{action:t,data:n,reason:s,transaction:a,invocation:null,revert:o})}(t,e,n,Wn.defaultAbiCoder())}}function qn(t){if(t.isArray())return new Oe(Bn(this,Kn)[Kn](t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new Ue(t.components.map((t=>Bn(this,Kn)[Kn](t))),t.name);switch(t.baseType){case"address":return new be(t.name);case"bool":return new xe(t.name);case"string":return new Se(t.name);case"bytes":return new Ae(t.name);case"":return new Re(t.name)}let e=t.type.match(zn);if(e){let n=parseInt(e[2]||"256");return $(0!==n&&n<=256&&n%8==0,"invalid "+e[1]+" bit length","param",t),new Pe(n/8,"int"===e[1],t.name)}if(e=t.type.match(Vn),e){let n=parseInt(e[1]);return $(0!==n&&n<=32,"invalid bytes length","param",t),new Te(n,t.name)}$(!1,"invalid type","type",t.type)}function $n(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Hn=0;function Yn(t){return"__private_"+Hn+++"_"+t}class Xn{constructor(t,e,n){this.fragment=void 0,this.name=void 0,this.signature=void 0,this.topic=void 0,this.args=void 0;const r=t.name,i=t.format();J(this,{fragment:t,name:r,signature:i,topic:e,args:n})}}class Zn{constructor(t,e,n,r){this.fragment=void 0,this.name=void 0,this.args=void 0,this.signature=void 0,this.selector=void 0,this.value=void 0;const i=t.name,s=t.format();J(this,{fragment:t,name:i,args:n,signature:s,selector:e,value:r})}}class Qn{constructor(t,e,n){this.fragment=void 0,this.name=void 0,this.args=void 0,this.signature=void 0,this.selector=void 0;const r=t.name,i=t.format();J(this,{fragment:t,name:r,args:n,signature:i,selector:e})}}class tr{static isIndexed(t){return!(!t||!t._isIndexed)}constructor(t){this.hash=void 0,this._isIndexed=void 0,J(this,{hash:t,_isIndexed:!0})}}const er={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},nr={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>"reverted with reason string ".concat(JSON.stringify(t))},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&er[t.toString()]&&(e=er[t.toString()]),"reverted with panic code 0x".concat(t.toString(16)," (").concat(e,")")}}};var rr=Yn("errors"),ir=Yn("events"),sr=Yn("functions"),or=Yn("abiCoder"),ar=Yn("getFunction"),cr=Yn("getEvent");class ur{constructor(t){Object.defineProperty(this,cr,{value:hr}),Object.defineProperty(this,ar,{value:lr}),this.fragments=void 0,this.deploy=void 0,this.fallback=void 0,this.receive=void 0,Object.defineProperty(this,rr,{writable:!0,value:void 0}),Object.defineProperty(this,ir,{writable:!0,value:void 0}),Object.defineProperty(this,sr,{writable:!0,value:void 0}),Object.defineProperty(this,or,{writable:!0,value:void 0});let e=[];e="string"==typeof t?JSON.parse(t):t,$n(this,sr)[sr]=new Map,$n(this,rr)[rr]=new Map,$n(this,ir)[ir]=new Map;const n=[];for(const t of e)try{n.push(Rn.from(t))}catch(e){console.log("[Warning] Invalid Fragment ".concat(JSON.stringify(t),":"),e.message)}J(this,{fragments:Object.freeze(n)});let r=null,i=!1;$n(this,or)[or]=this.getAbiCoder(),this.fragments.forEach(((t,e)=>{let n;switch(t.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void J(this,{deploy:t});case"fallback":return void(0===t.inputs.length?i=!0:($(!r||t.payable!==r.payable,"conflicting fallback fragments","fragments[".concat(e,"]"),t),r=t,i=r.payable));case"function":n=$n(this,sr)[sr];break;case"event":n=$n(this,ir)[ir];break;case"error":n=$n(this,rr)[rr];break;default:return}const s=t.format();n.has(s)||n.set(s,t)})),this.deploy||J(this,{deploy:Sn.from("constructor()")}),J(this,{fallback:r,receive:i})}format(t){const e=t?"minimal":"full";return this.fragments.map((t=>t.format(e)))}formatJson(){const t=this.fragments.map((t=>t.format("json")));return JSON.stringify(t.map((t=>JSON.parse(t))))}getAbiCoder(){return Wn.defaultAbiCoder()}getFunctionName(t){const e=$n(this,ar)[ar](t,null,!1);return $(e,"no matching function","key",t),e.name}hasFunction(t){return!!$n(this,ar)[ar](t,null,!1)}getFunction(t,e){return $n(this,ar)[ar](t,e||null,!0)}forEachFunction(t){const e=Array.from($n(this,sr)[sr].keys());e.sort(((t,e)=>t.localeCompare(e)));for(let n=0;n<e.length;n++){const r=e[n];t($n(this,sr)[sr].get(r),n)}}getEventName(t){const e=$n(this,cr)[cr](t,null,!1);return $(e,"no matching event","key",t),e.name}hasEvent(t){return!!$n(this,cr)[cr](t,null,!1)}getEvent(t,e){return $n(this,cr)[cr](t,e||null,!0)}forEachEvent(t){const e=Array.from($n(this,ir)[ir].keys());e.sort(((t,e)=>t.localeCompare(e)));for(let n=0;n<e.length;n++){const r=e[n];t($n(this,ir)[ir].get(r),n)}}getError(t,e){if(et(t)){const e=t.toLowerCase();if(nr[e])return In.from(nr[e].signature);for(const t of $n(this,rr)[rr].values())if(e===t.selector)return t;return null}if(-1===t.indexOf("(")){const e=[];for(const[n,r]of $n(this,rr)[rr])n.split("(")[0]===t&&e.push(r);if(0===e.length)return"Error"===t?In.from("error Error(string)"):"Panic"===t?In.from("error Panic(uint256)"):null;if(e.length>1){const n=e.map((t=>JSON.stringify(t.format()))).join(", ");$(!1,"ambiguous error description (i.e. ".concat(n,")"),"name",t)}return e[0]}if("Error(string)"===(t=In.from(t).format()))return In.from("error Error(string)");if("Panic(uint256)"===t)return In.from("error Panic(uint256)");return $n(this,rr)[rr].get(t)||null}forEachError(t){const e=Array.from($n(this,rr)[rr].keys());e.sort(((t,e)=>t.localeCompare(e)));for(let n=0;n<e.length;n++){const r=e[n];t($n(this,rr)[rr].get(r),n)}}_decodeParams(t,e){return $n(this,or)[or].decode(t,e)}_encodeParams(t,e){return $n(this,or)[or].encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){if("string"==typeof t){const e=this.getError(t);$(e,"unknown error","fragment",t),t=e}return $(st(e,0,4)===t.selector,"data signature does not match error ".concat(t.name,"."),"data",e),this._decodeParams(t.inputs,st(e,4))}encodeErrorResult(t,e){if("string"==typeof t){const e=this.getError(t);$(e,"unknown error","fragment",t),t=e}return it([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionData(t,e){if("string"==typeof t){const e=this.getFunction(t);$(e,"unknown function","fragment",t),t=e}return $(st(e,0,4)===t.selector,"data signature does not match function ".concat(t.name,"."),"data",e),this._decodeParams(t.inputs,st(e,4))}encodeFunctionData(t,e){if("string"==typeof t){const e=this.getFunction(t);$(e,"unknown function","fragment",t),t=e}return it([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionResult(t,e){if("string"==typeof t){const e=this.getFunction(t);$(e,"unknown function","fragment",t),t=e}let n="invalid length for result data";const r=tt(e);if(r.length%32==0)try{return $n(this,or)[or].decode(t.outputs,r)}catch(t){n="could not decode result data"}q(!1,n,"BAD_DATA",{value:rt(r),info:{method:t.name,signature:t.format()}})}makeError(t,e){const n=Q(t,"data"),r=Wn.getBuiltinCallException("call",e,n);if(r.message.startsWith("execution reverted (unknown custom error)")){const t=rt(n.slice(0,4)),e=this.getError(t);if(e)try{const t=$n(this,or)[or].decode(e.inputs,n.slice(4));r.revert={name:e.name,signature:e.format(),args:t},r.reason=r.revert.signature,r.message="execution reverted: ".concat(r.reason)}catch(t){r.message="execution reverted (coult not decode custom error)"}}const i=this.parseTransaction(e);return i&&(r.invocation={method:i.name,signature:i.signature,args:i.args}),r}encodeFunctionResult(t,e){if("string"==typeof t){const e=this.getFunction(t);$(e,"unknown function","fragment",t),t=e}return rt($n(this,or)[or].encode(t.outputs,e||[]))}encodeFilterTopics(t,e){if("string"==typeof t){const e=this.getEvent(t);$(e,"unknown event","eventFragment",t),t=e}q(e.length<=t.inputs.length,"too many arguments for ".concat(t.format()),"UNEXPECTED_ARGUMENT",{count:e.length,expectedCount:t.inputs.length});const n=[];t.anonymous||n.push(t.topicHash);const r=(t,e)=>"string"===t.type?gt(e):"bytes"===t.type?lt(rt(e)):("bool"===t.type&&"boolean"==typeof e?e=e?"0x01":"0x00":t.type.match(/^u?int/)?e=At(e):t.type.match(/^bytes/)?e=ot(e,32,!1):"address"===t.type&&$n(this,or)[or].encode(["address"],[e]),ot(rt(e),32,!0));for(e.forEach(((e,i)=>{const s=t.inputs[i];s.indexed?null==e?n.push(null):"array"===s.baseType||"tuple"===s.baseType?$(!1,"filtering with tuples or arrays not supported","contract."+s.name,e):Array.isArray(e)?n.push(e.map((t=>r(s,t)))):n.push(r(s,e)):$(null==e,"cannot filter non-indexed parameters; must be null","contract."+s.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(t,e){if("string"==typeof t){const e=this.getEvent(t);$(e,"unknown event","eventFragment",t),t=e}const n=[],r=[],i=[];return t.anonymous||n.push(t.topicHash),$(e.length===t.inputs.length,"event arguments/values mismatch","values",e),t.inputs.forEach(((t,s)=>{const o=e[s];if(t.indexed)if("string"===t.type)n.push(gt(o));else if("bytes"===t.type)n.push(lt(o));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push($n(this,or)[or].encode([t.type],[o]))}else r.push(t),i.push(o)})),{data:$n(this,or)[or].encode(r,i),topics:n}}decodeEventLog(t,e,n){if("string"==typeof t){const e=this.getEvent(t);$(e,"unknown event","eventFragment",t),t=e}if(null!=n&&!t.anonymous){const e=t.topicHash;$(et(n[0],32)&&n[0].toLowerCase()===e,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const r=[],i=[],s=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(r.push(Tn.from({type:"bytes32",name:t.name})),s.push(!0)):(r.push(t),s.push(!1)):(i.push(t),s.push(!1))}));const o=null!=n?$n(this,or)[or].decode(r,it(n)):null,a=$n(this,or)[or].decode(i,e,!0),c=[],u=[];let l=0,h=0;return t.inputs.forEach(((t,e)=>{let n=null;if(t.indexed)if(null==o)n=new tr(null);else if(s[e])n=new tr(o[h++]);else try{n=o[h++]}catch(t){n=t}else try{n=a[l++]}catch(t){n=t}c.push(n),u.push(t.name||null)})),Dt.fromItems(c,u)}parseTransaction(t){const e=Q(t.data,"tx.data"),n=vt(null!=t.value?t.value:0,"tx.value"),r=this.getFunction(rt(e.slice(0,4)));if(!r)return null;const i=$n(this,or)[or].decode(r.inputs,e.slice(4));return new Zn(r,r.selector,i,n)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){const e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new Xn(e,e.topicHash,this.decodeEventLog(e,t.data,t.topics))}parseError(t){const e=rt(t),n=this.getError(st(e,0,4));if(!n)return null;const r=$n(this,or)[or].decode(n.inputs,st(e,4));return new Qn(n,n.selector,r)}static from(t){return t instanceof ur?t:"string"==typeof t?new ur(JSON.parse(t)):"function"==typeof t.formatJson?new ur(t.formatJson()):"function"==typeof t.format?new ur(t.format("json")):new ur(t)}}function lr(t,e,n){if(et(t)){const e=t.toLowerCase();for(const t of $n(this,sr)[sr].values())if(e===t.selector)return t;return null}if(-1===t.indexOf("(")){const r=[];for(const[e,n]of $n(this,sr)[sr])e.split("(")[0]===t&&r.push(n);if(e){const t=e.length>0?e[e.length-1]:null;let n=e.length,i=!0;me.isTyped(t)&&"overrides"===t.type&&(i=!1,n--);for(let t=r.length-1;t>=0;t--){const e=r[t].inputs.length;e===n||i&&e===n-1||r.splice(t,1)}for(let t=r.length-1;t>=0;t--){const n=r[t].inputs;for(let i=0;i<e.length;i++)if(me.isTyped(e[i])){if(i>=n.length){if("overrides"===e[i].type)continue;r.splice(t,1);break}if(e[i].type!==n[i].baseType){r.splice(t,1);break}}}}if(1===r.length&&e&&e.length!==r[0].inputs.length){const t=e[e.length-1];(null==t||Array.isArray(t)||"object"!=typeof t)&&r.splice(0,1)}if(0===r.length)return null;if(r.length>1&&n){const e=r.map((t=>JSON.stringify(t.format()))).join(", ");$(!1,"ambiguous function description (i.e. matches ".concat(e,")"),"key",t)}return r[0]}return $n(this,sr)[sr].get(Cn.from(t).format())||null}function hr(t,e,n){if(et(t)){const e=t.toLowerCase();for(const t of $n(this,ir)[ir].values())if(e===t.topicHash)return t;return null}if(-1===t.indexOf("(")){const r=[];for(const[e,n]of $n(this,ir)[ir])e.split("(")[0]===t&&r.push(n);if(e){for(let t=r.length-1;t>=0;t--)r[t].inputs.length<e.length&&r.splice(t,1);for(let t=r.length-1;t>=0;t--){const n=r[t].inputs;for(let i=0;i<e.length;i++)if(me.isTyped(e[i])&&e[i].type!==n[i].baseType){r.splice(t,1);break}}}if(0===r.length)return null;if(r.length>1&&n){const e=r.map((t=>JSON.stringify(t.format()))).join(", ");$(!1,"ambiguous event description (i.e. matches ".concat(e,")"),"key",t)}return r[0]}return $n(this,ir)[ir].get(Pn.from(t).format())||null}function fr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function pr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?fr(Object(n),!0).forEach((function(e){dr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function dr(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var gr=class{constructor(t){var e=this;this.dialogWindowOrigin="",this.isDestroyed=!1,this.mode="production",this.pendingRequests=new Map,this.getMode=()=>this.mode,this.destroy=()=>{this.isDestroyed||(this.isDestroyed=!0,"undefined"!=typeof window&&window.removeEventListener("message",this.handleMessage),this.rejectAllPendingRequests("DESTROYED"))},this.handleMessage=t=>{if(t.origin!==this.dialogWindowOrigin)return;const e=t.data;if(!e.requestId)return;if("CLOSE_MODAL"===e.type)return void this.rejectAllPendingRequests("REJECTED");const n=this.pendingRequests.get(e.requestId);n&&n.requestType!==e.type&&(this.pendingRequests.delete(e.requestId),e.error?n.reject(e.error):n.resolve(e.payload))},this.verifyHumanity=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.minPoints||(t=pr(pr({},t),{},{minPoints:0})),e.request("PROOFS_REQUEST",t)},this.getAddressScore=async t=>{if(!t)throw new Error("`address` argument is required to get address score");const{score:e,message:n,signature:r}=await d(t);return{score:e,message:n,signature:r}},this.verifyProofs=async t=>{let{proofs:e,provider:n}=t;const r=await async function(t){try{const e="dev"===t?"dev-configs":"configs",n=await p("https://raw.githubusercontent.com/BringID/configs/main/".concat(e,".json"));return{REGISTRY:n.REGISTRY,CHAIN_ID:n.CHAIN_ID}}catch(t){return console.error(t),null}}(this.mode);if(!r)throw new Error("configs cannot be fetched");const i=new ur(y),s=new ur(m);if(!n)try{const{result:t}=await g(e,Number(r.CHAIN_ID),r.REGISTRY);return t}catch(t){return console.error(t),!1}const o=e.map((t=>{const e={credentialGroupId:t.credential_group_id,semaphoreProof:{merkleTreeDepth:t.semaphore_proof.merkle_tree_depth,merkleTreeRoot:t.semaphore_proof.merkle_tree_root,nullifier:t.semaphore_proof.nullifier,message:t.semaphore_proof.message,scope:t.semaphore_proof.scope,points:t.semaphore_proof.points}},n=i.encodeFunctionData("verifyProof",[e]);return{target:r.REGISTRY,allowFailure:!1,callData:n}})),a=s.encodeFunctionData("aggregate3",[o]);try{return await n.call({to:"0xca11bde05977b3631167028862be2a173976ca11",data:a}),!0}catch(t){return console.error(t),!1}},"undefined"!=typeof window&&(window.addEventListener("message",this.handleMessage),this.dialogWindowOrigin=window.location.origin),t&&t.mode&&(this.mode=t.mode)}sendMessageToDialog(t){window.postMessage(t,this.dialogWindowOrigin)}request(t,e){return new Promise(((n,r)=>{const i=a();this.pendingRequests.set(i,{resolve:n,reject:r,requestType:t}),this.sendMessageToDialog({type:t,requestId:i,payload:e})}))}rejectAllPendingRequests(t){for(const{reject:e}of this.pendingRequests.values())e(t);this.pendingRequests.clear()}};return e}()}));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.BringSDK=e():t.BringSDK=e()}(this,(function(){return function(){"use strict";var t={d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{BringID:function(){return gr}});var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16),s=[];for(let t=0;t<256;++t)s.push((t+256).toString(16).slice(1));function o(t,e,n){var o,a,c,u;const l=null!==(o=null!==(a=(t=t||{}).random)&&void 0!==a?a:null===(c=(u=t).rng)||void 0===c?void 0:c.call(u))&&void 0!==o?o:function(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(i)}();if(l.length<16)throw new Error("Random bytes length must be >= 16");if(l[6]=15&l[6]|64,l[8]=63&l[8]|128,e){if((n=n||0)<0||n+16>e.length)throw new RangeError("UUID byte range ".concat(n,":").concat(n+15," is out of buffer bounds"));for(let t=0;t<16;++t)e[n+t]=l[t];return e}return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]).toLowerCase()}(l)}var a=()=>{return!n.randomUUID||e||t?o(t,e,r):n.randomUUID();var t,e,r},c="zpka_52e44068bb9745f2be776b343e96cdab_1a60a93b",u="https://api.bringid.org";function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){f(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function f(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var p=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return fetch(t,{method:e,body:"GET"===e||"OPTIONS"===e?void 0:JSON.stringify(r),headers:h({},n)}).then((async t=>{if(!t.ok){const e=await t.json();throw new Error(e.error)}return t.json()}))},d=t=>p("".concat(u,"/v1/score/address/").concat(t),"GET",{Authorization:"Bearer ".concat(c),"content-type":"application/json"}),g=(t,e,n)=>p("".concat(u,"/v1/proofs/verify"),"POST",{Authorization:"Bearer ".concat(c),"content-type":"application/json"},{proofs:t,registry:n,chain_id:e}),y=[{inputs:[{components:[{internalType:"uint256",name:"credentialGroupId",type:"uint256"},{components:[{internalType:"uint256",name:"merkleTreeDepth",type:"uint256"},{internalType:"uint256",name:"merkleTreeRoot",type:"uint256"},{internalType:"uint256",name:"nullifier",type:"uint256"},{internalType:"uint256",name:"message",type:"uint256"},{internalType:"uint256",name:"scope",type:"uint256"},{internalType:"uint256[8]",name:"points",type:"uint256[8]"}],internalType:"struct ISemaphore.SemaphoreProof",name:"semaphoreProof",type:"tuple"}],internalType:"struct ICredentialRegistry.CredentialGroupProof",name:"proof_",type:"tuple"}],name:"verifyProof",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}],m=[{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3[]",name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"}];function b(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("Wrong positive integer: ".concat(t))}function w(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(n.length>0&&!n.includes(t.length))throw new Error("Expected Uint8Array of length ".concat(n,", not of length=").concat(t.length))}function v(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}const E=BigInt(2**32-1),O=BigInt(32);function x(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{h:Number(t&E),l:Number(t>>O&E)}:{h:0|Number(t>>O&E),l:0|Number(t&E)}}function N(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=x(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function j(t){if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got ".concat(typeof t));return new Uint8Array((new TextEncoder).encode(t))}(t)),!(t instanceof Uint8Array))throw new Error("expected Uint8Array, got ".concat(typeof t));return t}class A{clone(){return this._cloneInto()}}const[T,_,R]=[[],[],[]],k=BigInt(0),I=BigInt(1),P=BigInt(2),S=BigInt(7),U=BigInt(256),C=BigInt(113);for(let t=0,e=I,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],T.push(2*(5*r+n)),_.push((t+1)*(t+2)/2%64);let i=k;for(let t=0;t<7;t++)e=(e<<I^(e>>S)*C)%U,e&P&&(i^=I<<(I<<BigInt(t))-I);R.push(i)}const[F,B]=N(R,!0),D=(t,e,n)=>n>32?((t,e,n)=>e<<n-32|t>>>64-n)(t,e,n):((t,e,n)=>t<<n|e>>>32-n)(t,e,n),L=(t,e,n)=>n>32?((t,e,n)=>t<<n-32|e>>>64-n)(t,e,n):((t,e,n)=>e<<n|t>>>32-n)(t,e,n);class M extends A{constructor(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=r,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,b(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var s;this.state=new Uint8Array(200),this.state32=(s=this.state,new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)))}keccak(){!function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24;const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let e=0;e<10;e++)n[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const r=(e+8)%10,i=(e+2)%10,s=n[i],o=n[i+1],a=D(s,o,1)^n[r],c=L(s,o,1)^n[r+1];for(let n=0;n<50;n+=10)t[e+n]^=a,t[e+n+1]^=c}let e=t[2],i=t[3];for(let n=0;n<24;n++){const r=_[n],s=D(e,i,r),o=L(e,i,r),a=T[n];e=t[a],i=t[a+1],t[a]=s,t[a+1]=o}for(let e=0;e<50;e+=10){for(let r=0;r<10;r++)n[r]=t[e+r];for(let r=0;r<10;r++)t[e+r]^=~n[(r+2)%10]&n[(r+4)%10]}t[0]^=F[r],t[1]^=B[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){v(this);const{blockLen:e,state:n}=this,r=(t=j(t)).length;for(let i=0;i<r;){const s=Math.min(e-this.pos,r-i);for(let e=0;e<s;e++)n[this.pos++]^=t[i++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:n,blockLen:r}=this;t[n]^=e,128&e&&n===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){v(this,!1),w(t),this.finish();const e=this.state,{blockLen:n}=this;for(let r=0,i=t.length;r<i;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,i-r);t.set(e.subarray(this.posOut,this.posOut+s),r),this.posOut+=s,r+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return b(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(function(t,e){w(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least ".concat(n))}(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:n,outputLen:r,rounds:i,enableXOF:s}=this;return t||(t=new M(e,n,r,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=r,t.enableXOF=s,t.destroyed=this.destroyed,t}}const V=((t,e,n)=>function(t){const e=e=>t().update(j(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}((()=>new M(e,t,n))))(1,136,32);function z(t,e,n){const r=e.split("|").map((t=>t.trim()));for(let n=0;n<r.length;n++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error("invalid value for type ".concat(e));throw i.code="INVALID_ARGUMENT",i.argument="value.".concat(n),i.value=t,i}function J(t,e,n){for(let r in e){let i=e[r];const s=n?n[r]:null;s&&z(i,s,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function G(t,e){if(null==t)return"null";if(null==e&&(e=new Set),"object"==typeof t){if(e.has(t))return"[Circular]";e.add(t)}if(Array.isArray(t))return"[ "+t.map((t=>G(t,e))).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r<t.length;r++)n+=e[t[r]>>4],n+=e[15&t[r]];return n}if("object"==typeof t&&"function"==typeof t.toJSON)return G(t.toJSON(),e);switch(typeof t){case"boolean":case"number":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const n=Object.keys(t);return n.sort(),"{ "+n.map((n=>"".concat(G(n,e),": ").concat(G(t[n],e)))).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function K(t,e){return t&&t.code===e}function W(t,e,n){let r,i=t;{const r=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error("value will overwrite populated values: ".concat(G(n)));for(const t in n){if("shortMessage"===t)continue;const e=n[t];r.push(t+"="+G(e))}}r.push("code=".concat(e)),r.push("version=".concat("6.16.0")),r.length&&(t+=" ("+r.join(", ")+")")}switch(e){case"INVALID_ARGUMENT":r=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(t);break;default:r=new Error(t)}return J(r,{code:e}),n&&Object.assign(r,n),null==r.shortMessage&&J(r,{shortMessage:i}),r}function q(t,e,n,r){if(!t)throw W(e,n,r)}function $(t,e,n,r){q(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function H(t,e,n){null==n&&(n=""),n&&(n=": "+n),q(t>=e,"missing argument"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),q(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const Y=["NFD","NFC","NFKD","NFKC"].reduce(((t,e)=>{try{if("test"!=="test".normalize(e))throw new Error("bad");if("NFD"===e){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}t.push(e)}catch(t){}return t}),[]);function X(t,e,n){if(null==n&&(n=""),t!==e){let t=n,e="new";n&&(t+=".",e+=" "+n),q(!1,"private constructor; use ".concat(t,"from* methods"),"UNSUPPORTED_OPERATION",{operation:e})}}function Z(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if("string"==typeof t&&t.length%2==0&&t.match(/^0x[0-9a-f]*$/i)){const e=new Uint8Array((t.length-2)/2);let n=2;for(let r=0;r<e.length;r++)e[r]=parseInt(t.substring(n,n+2),16),n+=2;return e}$(!1,"invalid BytesLike value",e||"value",t)}function Q(t,e){return Z(t,e,!1)}function tt(t,e){return Z(t,e,!0)}function et(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||"number"==typeof e&&t.length!==2+2*e||!0===e&&t.length%2!=0)}const nt="0123456789abcdef";function rt(t){const e=Q(t);let n="0x";for(let t=0;t<e.length;t++){const r=e[t];n+=nt[(240&r)>>4]+nt[15&r]}return n}function it(t){return"0x"+t.map((t=>rt(t).substring(2))).join("")}function st(t,e,n){const r=Q(t);return null!=n&&n>r.length&&q(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),rt(r.slice(null==e?0:e,null==n?r.length:n))}function ot(t,e,n){const r=Q(t);q(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),rt(i)}let at=!1;const ct=function(t){return V(t)};let ut=ct;function lt(t){const e=Q(t,"data");return rt(ut(e))}function ht(t,e,n,r,i){if("BAD_PREFIX"===t||"UNEXPECTED_CONTINUE"===t){let t=0;for(let r=e+1;r<n.length&&n[r]>>6==2;r++)t++;return t}return"OVERRUN"===t?n.length-e-1:0}lt._=ct,lt.lock=function(){at=!0},lt.register=function(t){if(at)throw new TypeError("keccak256 is locked");ut=t},Object.freeze(lt);const ft=Object.freeze({error:function(t,e,n,r,i){$(!1,"invalid codepoint at offset ".concat(e,"; ").concat(t),"bytes",n)},ignore:ht,replace:function(t,e,n,r,i){return"OVERLONG"===t?($("number"==typeof i,"invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),ht(t,e,n))}});function pt(t,e){$("string"==typeof t,"invalid string value","str",t),null!=e&&(function(t){q(Y.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}(e),t=t.normalize(e));let n=[];for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){e++;const i=t.charCodeAt(e);$(e<t.length&&56320==(64512&i),"invalid surrogate pair","str",t);const s=65536+((1023&r)<<10)+(1023&i);n.push(s>>18|240),n.push(s>>12&63|128),n.push(s>>6&63|128),n.push(63&s|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return new Uint8Array(n)}function dt(t,e){return function(t,e){null==e&&(e=ft.error);const n=Q(t,"bytes"),r=[];let i=0;for(;i<n.length;){const t=n[i++];if(!(t>>7)){r.push(t);continue}let s=null,o=null;if(192==(224&t))s=1,o=127;else if(224==(240&t))s=2,o=2047;else{if(240!=(248&t)){i+=e(128==(192&t)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",i-1,n,r);continue}s=3,o=65535}if(i-1+s>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let a=t&(1<<8-s-1)-1;for(let t=0;t<s;t++){let t=n[i];if(128!=(192&t)){i+=e("MISSING_CONTINUE",i,n,r),a=null;break}a=a<<6|63&t,i++}null!==a&&(a>1114111?i+=e("OUT_OF_RANGE",i-1-s,n,r,a):a>=55296&&a<=57343?i+=e("UTF16_SURROGATE",i-1-s,n,r,a):a<=o?i+=e("OVERLONG",i-1-s,n,r,a):r.push(a))}return r}(t,e).map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function gt(t){return lt(pt(t))}const yt=BigInt(0),mt=BigInt(1),bt=9007199254740991;function wt(t,e){const n=Et(t,"value"),r=BigInt(Nt(e,"bits"));return n&(mt<<r)-mt}function vt(t,e){switch(typeof t){case"bigint":return t;case"number":return $(Number.isInteger(t),"underflow",e||"value",t),$(t>=-bt&&t<=bt,"overflow",e||"value",t),BigInt(t);case"string":try{if(""===t)throw new Error("empty string");return"-"===t[0]&&"-"!==t[1]?-BigInt(t.substring(1)):BigInt(t)}catch(n){$(!1,"invalid BigNumberish string: ".concat(n.message),e||"value",t)}}$(!1,"invalid BigNumberish value",e||"value",t)}function Et(t,e){const n=vt(t,e);return q(n>=yt,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const Ot="0123456789abcdef";function xt(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=Ot[n>>4],e+=Ot[15&n];return BigInt(e)}return vt(t)}function Nt(t,e){switch(typeof t){case"bigint":return $(t>=-bt&&t<=bt,"overflow",e||"value",t),Number(t);case"number":return $(Number.isInteger(t),"underflow",e||"value",t),$(t>=-bt&&t<=bt,"overflow",e||"value",t),t;case"string":try{if(""===t)throw new Error("empty string");return Nt(BigInt(t),e)}catch(n){$(!1,"invalid numeric string: ".concat(n.message),e||"value",t)}}$(!1,"invalid numeric value",e||"value",t)}function jt(t,e){const n=Et(t,"value");let r=n.toString(16);if(null==e)r.length%2&&(r="0"+r);else{const i=Nt(e,"width");if(0===i&&n===yt)return"0x";for(q(2*i>=r.length,"value exceeds width (".concat(i," bytes)"),"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length<2*i;)r="0"+r}return"0x"+r}function At(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Tt=0;function _t(t){return"__private_"+Tt+++"_"+t}const Rt=32,kt=new Uint8Array(Rt),It=["then"],Pt={},St=new WeakMap;function Ut(t){return St.get(t)}function Ct(t,e){St.set(t,e)}function Ft(t,e){const n=new Error("deferred error during ABI decoding triggered accessing ".concat(t));throw n.error=e,n}function Bt(t,e,n){return t.indexOf(null)>=0?e.map(((t,e)=>t instanceof Lt?Bt(Ut(t),t,n):t)):t.reduce(((t,r,i)=>{let s=e.getValue(r);return r in t||(n&&s instanceof Lt&&(s=Bt(Ut(s),s,n)),t[r]=s),t}),{})}var Dt=_t("names");class Lt extends Array{constructor(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=e[0];let i=e[1],s=(e[2]||[]).slice(),o=!0;r!==Pt&&(i=e,s=[],o=!1),super(i.length),Object.defineProperty(this,Dt,{writable:!0,value:void 0}),i.forEach(((t,e)=>{this[e]=t}));const a=s.reduce(((t,e)=>("string"==typeof e&&t.set(e,(t.get(e)||0)+1),t)),new Map);if(Ct(this,Object.freeze(i.map(((t,e)=>{const n=s[e];return null!=n&&1===a.get(n)?n:null})))),At(this,Dt)[Dt]=[],null==At(this,Dt)[Dt]&&At(this,Dt)[Dt],!o)return;Object.freeze(this);const c=new Proxy(this,{get:(t,e,n)=>{if("string"==typeof e){if(e.match(/^[0-9]+$/)){const n=Nt(e,"%index");if(n<0||n>=this.length)throw new RangeError("out of result range");const r=t[n];return r instanceof Error&&Ft("index ".concat(n),r),r}if(It.indexOf(e)>=0)return Reflect.get(t,e,n);const r=t[e];if(r instanceof Function)return function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];return r.apply(this===n?t:this,i)};if(!(e in t))return t.getValue.apply(this===n?t:this,[e])}return Reflect.get(t,e,n)}});return Ct(c,Ut(this)),c}toArray(t){const e=[];return this.forEach(((n,r)=>{n instanceof Error&&Ft("index ".concat(r),n),t&&n instanceof Lt&&(n=n.toArray(t)),e.push(n)})),e}toObject(t){const e=Ut(this);return e.reduce(((n,r,i)=>(q(null!=r,"value at index ".concat(i," unnamed"),"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Bt(e,this,t))),{})}slice(t,e){null==t&&(t=0),t<0&&(t+=this.length)<0&&(t=0),null==e&&(e=this.length),e<0&&(e+=this.length)<0&&(e=0),e>this.length&&(e=this.length);const n=Ut(this),r=[],i=[];for(let s=t;s<e;s++)r.push(this[s]),i.push(n[s]);return new Lt(Pt,r,i)}filter(t,e){const n=Ut(this),r=[],i=[];for(let s=0;s<this.length;s++){const o=this[s];o instanceof Error&&Ft("index ".concat(s),o),t.call(e,o,s,this)&&(r.push(o),i.push(n[s]))}return new Lt(Pt,r,i)}map(t,e){const n=[];for(let r=0;r<this.length;r++){const i=this[r];i instanceof Error&&Ft("index ".concat(r),i),n.push(t.call(e,i,r,this))}return n}getValue(t){const e=Ut(this).indexOf(t);if(-1===e)return;const n=this[e];return n instanceof Error&&Ft("property ".concat(JSON.stringify(t)),n.error),n}static fromItems(t,e){return new Lt(Pt,t,e)}}function Mt(t){let e=function(t,e){const n=Et(t,"value");if(n===yt){const t=null!=e?Nt(e,"width"):0;return new Uint8Array(t)}let r=n.toString(16);if(r.length%2&&(r="0"+r),null!=e){const n=Nt(e,"width");for(;r.length<2*n;)r="00"+r;q(2*n===r.length,"value exceeds width (".concat(n," bytes)"),"NUMERIC_FAULT",{operation:"toBeArray",fault:"overflow",value:t})}const i=new Uint8Array(r.length/2);for(let t=0;t<i.length;t++){const e=2*t;i[t]=parseInt(r.substring(e,e+2),16)}return i}(t);return q(e.length<=Rt,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:Rt,offset:e.length}),e.length!==Rt&&(e=tt(it([kt.slice(e.length%Rt),e]))),e}class Vt{constructor(t,e,n,r){this.name=void 0,this.type=void 0,this.localName=void 0,this.dynamic=void 0,J(this,{name:t,type:e,localName:n,dynamic:r},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,e){$(!1,t,this.localName,e)}}var zt=_t("data"),Jt=_t("dataLength"),Gt=_t("writeData");class Kt{constructor(){Object.defineProperty(this,Gt,{value:Wt}),Object.defineProperty(this,zt,{writable:!0,value:void 0}),Object.defineProperty(this,Jt,{writable:!0,value:void 0}),At(this,zt)[zt]=[],At(this,Jt)[Jt]=0}get data(){return it(At(this,zt)[zt])}get length(){return At(this,Jt)[Jt]}appendWriter(t){return At(this,Gt)[Gt](tt(t.data))}writeBytes(t){let e=tt(t);const n=e.length%Rt;return n&&(e=tt(it([e,kt.slice(n)]))),At(this,Gt)[Gt](e)}writeValue(t){return At(this,Gt)[Gt](Mt(t))}writeUpdatableValue(){const t=At(this,zt)[zt].length;return At(this,zt)[zt].push(kt),At(this,Jt)[Jt]+=Rt,e=>{At(this,zt)[zt][t]=Mt(e)}}}function Wt(t){return At(this,zt)[zt].push(t),At(this,Jt)[Jt]+=t.length,t.length}var qt=_t("data"),$t=_t("offset"),Ht=_t("bytesRead"),Yt=_t("parent"),Xt=_t("maxInflation"),Zt=_t("incrementBytesRead"),Qt=_t("peekBytes");class te{constructor(t,e,n){Object.defineProperty(this,Qt,{value:ne}),Object.defineProperty(this,Zt,{value:ee}),this.allowLoose=void 0,Object.defineProperty(this,qt,{writable:!0,value:void 0}),Object.defineProperty(this,$t,{writable:!0,value:void 0}),Object.defineProperty(this,Ht,{writable:!0,value:void 0}),Object.defineProperty(this,Yt,{writable:!0,value:void 0}),Object.defineProperty(this,Xt,{writable:!0,value:void 0}),J(this,{allowLoose:!!e}),At(this,qt)[qt]=tt(t),At(this,Ht)[Ht]=0,At(this,Yt)[Yt]=null,At(this,Xt)[Xt]=null!=n?n:1024,At(this,$t)[$t]=0}get data(){return rt(At(this,qt)[qt])}get dataLength(){return At(this,qt)[qt].length}get consumed(){return At(this,$t)[$t]}get bytes(){return new Uint8Array(At(this,qt)[qt])}subReader(t){const e=new te(At(this,qt)[qt].slice(At(this,$t)[$t]+t),this.allowLoose,At(this,Xt)[Xt]);return At(e,Yt)[Yt]=this,e}readBytes(t,e){let n=At(this,Qt)[Qt](0,t,!!e);return At(this,Zt)[Zt](t),At(this,$t)[$t]+=n.length,n.slice(0,t)}readValue(){return xt(this.readBytes(Rt))}readIndex(){return Nt(xt(this.readBytes(Rt)))}}function ee(t){if(At(this,Yt)[Yt])return At(At(this,Yt)[Yt],Zt)[Zt](t);At(this,Ht)[Ht]+=t,q(At(this,Xt)[Xt]<1||At(this,Ht)[Ht]<=At(this,Xt)[Xt]*this.dataLength,"compressed ABI data exceeds inflation ratio of ".concat(At(this,Xt)[Xt]," ( see: https://github.com/ethers-io/ethers.js/issues/4537 )"),"BUFFER_OVERRUN",{buffer:tt(At(this,qt)[qt]),offset:At(this,$t)[$t],length:t,info:{bytesRead:At(this,Ht)[Ht],dataLength:this.dataLength}})}function ne(t,e,n){let r=Math.ceil(e/Rt)*Rt;return At(this,$t)[$t]+r>At(this,qt)[qt].length&&(this.allowLoose&&n&&At(this,$t)[$t]+e<=At(this,qt)[qt].length?r=e:q(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:tt(At(this,qt)[qt]),length:At(this,qt)[qt].length,offset:At(this,$t)[$t]+r})),At(this,qt)[qt].slice(At(this,$t)[$t],At(this,$t)[$t]+r)}const re=BigInt(0),ie=BigInt(36);function se(t){const e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let t=0;t<40;t++)n[t]=e[t].charCodeAt(0);const r=Q(lt(n));for(let t=0;t<40;t+=2)r[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&r[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const oe={};for(let t=0;t<10;t++)oe[String(t)]=String(t);for(let t=0;t<26;t++)oe[String.fromCharCode(65+t)]=String(10+t);const ae=function(){const t={};for(let e=0;e<36;e++)t["0123456789abcdefghijklmnopqrstuvwxyz"[e]]=BigInt(e);return t}();function ce(t){if($("string"==typeof t,"invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=se(t);return $(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){$(t.substring(2,4)===function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>oe[t])).join("");for(;e.length>=15;){let t=e.substring(0,15);e=parseInt(t,10)%97+e.substring(t.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}(t),"bad icap checksum","address",t);let e=function(t){t=t.toLowerCase();let e=re;for(let n=0;n<t.length;n++)e=e*ie+ae[t[n]];return e}(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return se("0x"+e)}$(!1,"invalid address","address",t)}function ue(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var le=0;function he(t){return"__private_"+le+++"_"+t}const fe={};function pe(t,e){let n=!1;return e<0&&(n=!0,e*=-1),new me(fe,"".concat(n?"":"u","int").concat(e),t,{signed:n,width:e})}function de(t,e){return new me(fe,"bytes".concat(e||""),t,{size:e})}const ge=Symbol.for("_ethers_typed");var ye=he("options");class me{constructor(t,e,n,r){this.type=void 0,this.value=void 0,Object.defineProperty(this,ye,{writable:!0,value:void 0}),this._typedSymbol=void 0,null==r&&(r=null),X(fe,t,"Typed"),J(this,{_typedSymbol:ge,type:e,value:n}),ue(this,ye)[ye]=r,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?"tuple(".concat(this.value.map((t=>t.format())).join(","),")"):this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return ue(this,ye)[ye]}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===ue(this,ye)[ye]?-1:!1===ue(this,ye)[ye]?this.value.length:null}static from(t,e){return new me(fe,t,e)}static uint8(t){return pe(t,8)}static uint16(t){return pe(t,16)}static uint24(t){return pe(t,24)}static uint32(t){return pe(t,32)}static uint40(t){return pe(t,40)}static uint48(t){return pe(t,48)}static uint56(t){return pe(t,56)}static uint64(t){return pe(t,64)}static uint72(t){return pe(t,72)}static uint80(t){return pe(t,80)}static uint88(t){return pe(t,88)}static uint96(t){return pe(t,96)}static uint104(t){return pe(t,104)}static uint112(t){return pe(t,112)}static uint120(t){return pe(t,120)}static uint128(t){return pe(t,128)}static uint136(t){return pe(t,136)}static uint144(t){return pe(t,144)}static uint152(t){return pe(t,152)}static uint160(t){return pe(t,160)}static uint168(t){return pe(t,168)}static uint176(t){return pe(t,176)}static uint184(t){return pe(t,184)}static uint192(t){return pe(t,192)}static uint200(t){return pe(t,200)}static uint208(t){return pe(t,208)}static uint216(t){return pe(t,216)}static uint224(t){return pe(t,224)}static uint232(t){return pe(t,232)}static uint240(t){return pe(t,240)}static uint248(t){return pe(t,248)}static uint256(t){return pe(t,256)}static uint(t){return pe(t,256)}static int8(t){return pe(t,-8)}static int16(t){return pe(t,-16)}static int24(t){return pe(t,-24)}static int32(t){return pe(t,-32)}static int40(t){return pe(t,-40)}static int48(t){return pe(t,-48)}static int56(t){return pe(t,-56)}static int64(t){return pe(t,-64)}static int72(t){return pe(t,-72)}static int80(t){return pe(t,-80)}static int88(t){return pe(t,-88)}static int96(t){return pe(t,-96)}static int104(t){return pe(t,-104)}static int112(t){return pe(t,-112)}static int120(t){return pe(t,-120)}static int128(t){return pe(t,-128)}static int136(t){return pe(t,-136)}static int144(t){return pe(t,-144)}static int152(t){return pe(t,-152)}static int160(t){return pe(t,-160)}static int168(t){return pe(t,-168)}static int176(t){return pe(t,-176)}static int184(t){return pe(t,-184)}static int192(t){return pe(t,-192)}static int200(t){return pe(t,-200)}static int208(t){return pe(t,-208)}static int216(t){return pe(t,-216)}static int224(t){return pe(t,-224)}static int232(t){return pe(t,-232)}static int240(t){return pe(t,-240)}static int248(t){return pe(t,-248)}static int256(t){return pe(t,-256)}static int(t){return pe(t,-256)}static bytes1(t){return de(t,1)}static bytes2(t){return de(t,2)}static bytes3(t){return de(t,3)}static bytes4(t){return de(t,4)}static bytes5(t){return de(t,5)}static bytes6(t){return de(t,6)}static bytes7(t){return de(t,7)}static bytes8(t){return de(t,8)}static bytes9(t){return de(t,9)}static bytes10(t){return de(t,10)}static bytes11(t){return de(t,11)}static bytes12(t){return de(t,12)}static bytes13(t){return de(t,13)}static bytes14(t){return de(t,14)}static bytes15(t){return de(t,15)}static bytes16(t){return de(t,16)}static bytes17(t){return de(t,17)}static bytes18(t){return de(t,18)}static bytes19(t){return de(t,19)}static bytes20(t){return de(t,20)}static bytes21(t){return de(t,21)}static bytes22(t){return de(t,22)}static bytes23(t){return de(t,23)}static bytes24(t){return de(t,24)}static bytes25(t){return de(t,25)}static bytes26(t){return de(t,26)}static bytes27(t){return de(t,27)}static bytes28(t){return de(t,28)}static bytes29(t){return de(t,29)}static bytes30(t){return de(t,30)}static bytes31(t){return de(t,31)}static bytes32(t){return de(t,32)}static address(t){return new me(fe,"address",t)}static bool(t){return new me(fe,"bool",!!t)}static bytes(t){return new me(fe,"bytes",t)}static string(t){return new me(fe,"string",t)}static array(t,e){throw new Error("not implemented yet")}static tuple(t,e){throw new Error("not implemented yet")}static overrides(t){return new me(fe,"overrides",Object.assign({},t))}static isTyped(t){return t&&"object"==typeof t&&"_typedSymbol"in t&&t._typedSymbol===ge}static dereference(t,e){if(me.isTyped(t)){if(t.type!==e)throw new Error("invalid type: expecetd ".concat(e,", got ").concat(t.type));return t.value}return t}}class be extends Vt{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let n=me.dereference(e,"string");try{n=ce(n)}catch(t){return this._throwError(t.message,e)}return t.writeValue(n)}decode(t){return ce(jt(t.readValue(),20))}}class we extends Vt{constructor(t){super(t.name,t.type,"_",t.dynamic),this.coder=void 0,this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}function ve(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&"object"==typeof n){let t={};r=e.map((e=>{const r=e.localName;return q(r,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:n}),q(!t[r],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:n}),t[r]=!0,n[r]}))}else $(!1,"invalid tuple value","tuple",n);$(e.length===r.length,"types/value length mismatch","tuple",n);let i=new Kt,s=new Kt,o=[];e.forEach(((t,e)=>{let n=r[e];if(t.dynamic){let e=s.length;t.encode(s,n);let r=i.writeUpdatableValue();o.push((t=>{r(t+e)}))}else t.encode(i,n)})),o.forEach((t=>{t(i.length)}));let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function Ee(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach((e=>{let s=null;if(e.dynamic){let n=t.readIndex(),r=i.subReader(n);try{s=e.decode(r)}catch(t){if(K(t,"BUFFER_OVERRUN"))throw t;s=t,s.baseType=e.name,s.name=e.localName,s.type=e.type}}else try{s=e.decode(t)}catch(t){if(K(t,"BUFFER_OVERRUN"))throw t;s=t,s.baseType=e.name,s.name=e.localName,s.type=e.type}if(null==s)throw new Error("investigate");n.push(s),r.push(e.localName||null)})),Lt.fromItems(n,r)}class Oe extends Vt{constructor(t,e,n){super("array",t.type+"["+(e>=0?e:"")+"]",n,-1===e||t.dynamic),this.coder=void 0,this.length=void 0,J(this,{coder:t,length:e})}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let n=0;n<this.length;n++)e.push(t);return e}encode(t,e){const n=me.dereference(e,"array");Array.isArray(n)||this._throwError("expected array value",n);let r=this.length;-1===r&&(r=n.length,t.writeValue(n.length)),H(n.length,r,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let t=0;t<n.length;t++)i.push(this.coder);return ve(t,i,n)}decode(t){let e=this.length;-1===e&&(e=t.readIndex(),q(e*Rt<=t.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:t.bytes,offset:e*Rt,length:t.dataLength}));let n=[];for(let t=0;t<e;t++)n.push(new we(this.coder));return Ee(t,n)}}class xe extends Vt{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){const n=me.dereference(e,"bool");return t.writeValue(n?1:0)}decode(t){return!!t.readValue()}}class Ne extends Vt{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=tt(e);let n=t.writeValue(e.length);return n+=t.writeBytes(e),n}decode(t){return t.readBytes(t.readIndex(),!0)}}class je extends Ne{constructor(t){super("bytes",t)}decode(t){return rt(super.decode(t))}}class Ae extends Vt{constructor(t,e){let n="bytes"+String(t);super(n,n,e,!1),this.size=void 0,J(this,{size:t},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let n=tt(me.dereference(e,this.type));return n.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(n)}decode(t){return rt(t.readBytes(this.size))}}const Te=new Uint8Array([]);class _e extends Vt{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes(Te)}decode(t){return t.readBytes(0),null}}const Re=BigInt(0),ke=BigInt(1),Ie=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Pe extends Vt{constructor(t,e,n){const r=(e?"int":"uint")+8*t;super(r,r,n,!1),this.size=void 0,this.signed=void 0,J(this,{size:t,signed:e},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(t,e){let n=vt(me.dereference(e,this.type)),r=wt(Ie,256);if(this.signed){let t=wt(r,8*this.size-1);(n>t||n<-(t+ke))&&this._throwError("value out-of-bounds",e),n=function(t){let e=vt(t,"value");const n=BigInt(Nt(256,"width")),r=mt<<n-mt;return e<yt?(e=-e,q(e<=r,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t}),(~e&(mt<<n)-mt)+mt):(q(e<r,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t}),e)}(n)}else(n<Re||n>wt(r,8*this.size))&&this._throwError("value out-of-bounds",e);return t.writeValue(n)}decode(t){let e=wt(t.readValue(),8*this.size);return this.signed&&(e=function(t,e){const n=Et(t,"value"),r=BigInt(Nt(e,"width"));return q(n>>r===yt,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-mt?-((~n&(mt<<r)-mt)+mt):n}(e,8*this.size)),e}}class Se extends Ne{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,pt(me.dereference(e,"string")))}decode(t){return dt(super.decode(t))}}class Ue extends Vt{constructor(t,e){let n=!1;const r=[];t.forEach((t=>{t.dynamic&&(n=!0),r.push(t.type)})),super("tuple","tuple("+r.join(",")+")",e,n),this.coders=void 0,J(this,{coders:Object.freeze(t.slice())})}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[r]))})),Object.freeze(t)}encode(t,e){const n=me.dereference(e,"tuple");return ve(t,this.coders,n)}decode(t){return Ee(t,this.coders)}}var Ce;function Fe(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Be=0;function De(t){return"__private_"+Be+++"_"+t}function Le(t){const e=new Set;return t.forEach((t=>e.add(t))),Object.freeze(e)}const Me=Le("external public payable override".split(" ")),Ve="constant external internal payable private public pure view override",ze=Le(Ve.split(" ")),Je="constructor error event fallback function receive struct",Ge=Le(Je.split(" ")),Ke="calldata memory storage payable indexed",We=Le(Ke.split(" ")),qe=Le([Je,Ke,"tuple returns",Ve].join(" ").split(" ")),$e={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},He=new RegExp("^(\\s*)"),Ye=new RegExp("^([0-9]+)"),Xe=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),Ze=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),Qe=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var tn=De("offset"),en=De("tokens"),nn=De("subTokenString");class rn{get offset(){return Fe(this,tn)[tn]}get length(){return Fe(this,en)[en].length-Fe(this,tn)[tn]}constructor(t){Object.defineProperty(this,nn,{value:sn}),Object.defineProperty(this,tn,{writable:!0,value:void 0}),Object.defineProperty(this,en,{writable:!0,value:void 0}),Fe(this,tn)[tn]=0,Fe(this,en)[en]=t.slice()}clone(){return new rn(Fe(this,en)[en])}reset(){Fe(this,tn)[tn]=0}popKeyword(t){const e=this.peek();if("KEYWORD"!==e.type||!t.has(e.text))throw new Error("expected keyword ".concat(e.text));return this.pop().text}popType(t){if(this.peek().type!==t){const e=this.peek();throw new Error("expected ".concat(t,"; got ").concat(e.type," ").concat(JSON.stringify(e.text)))}return this.pop().text}popParen(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=Fe(this,nn)[nn](Fe(this,tn)[tn]+1,t.match+1);return Fe(this,tn)[tn]=t.match+1,e}popParams(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=[];for(;Fe(this,tn)[tn]<t.match-1;){const t=this.peek().linkNext;e.push(Fe(this,nn)[nn](Fe(this,tn)[tn]+1,t)),Fe(this,tn)[tn]=t}return Fe(this,tn)[tn]=t.match+1,e}peek(){if(Fe(this,tn)[tn]>=Fe(this,en)[en].length)throw new Error("out-of-bounds");return Fe(this,en)[en][Fe(this,tn)[tn]]}peekKeyword(t){const e=this.peekType("KEYWORD");return null!=e&&t.has(e)?e:null}peekType(t){if(0===this.length)return null;const e=this.peek();return e.type===t?e.text:null}pop(){const t=this.peek();return Fe(this,tn)[tn]++,t}toString(){const t=[];for(let e=Fe(this,tn)[tn];e<Fe(this,en)[en].length;e++){const n=Fe(this,en)[en][e];t.push("".concat(n.type,":").concat(n.text))}return"<TokenString ".concat(t.join(" "),">")}}function sn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Ce(Fe(this,en)[en].slice(t,e).map((e=>Object.freeze(Object.assign({},e,{match:e.match-t,linkBack:e.linkBack-t,linkNext:e.linkNext-t})))))}function on(t){const e=[],n=e=>{const n=s<t.length?JSON.stringify(t[s]):"$EOI";throw new Error("invalid token ".concat(n," at ").concat(s,": ").concat(e))};let r=[],i=[],s=0;for(;s<t.length;){let o=t.substring(s),a=o.match(He);a&&(s+=a[1].length,o=t.substring(s));const c={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:s,value:-1};e.push(c);let u=$e[o[0]]||"";if(u){if(c.type=u,c.text=o[0],s++,"OPEN_PAREN"===u)r.push(e.length-1),i.push(e.length-1);else if("CLOSE_PAREN"==u)0===r.length&&n("no matching open bracket"),c.match=r.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1;else if("COMMA"===u)c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1,i.push(e.length-1);else if("OPEN_BRACKET"===u)c.type="BRACKET";else if("CLOSE_BRACKET"===u){let t=e.pop().text;if(e.length>0&&"NUMBER"===e[e.length-1].type){const n=e.pop().text;t=n+t,e[e.length-1].value=Nt(n)}if(0===e.length||"BRACKET"!==e[e.length-1].type)throw new Error("missing opening bracket");e[e.length-1].text+=t}}else if(a=o.match(Xe),a){if(c.text=a[1],s+=c.text.length,qe.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(Qe)){c.type="TYPE";continue}c.type="ID"}else{if(a=o.match(Ye),!a)throw new Error("unexpected token ".concat(JSON.stringify(o[0])," at position ").concat(s));c.text=a[1],c.type="NUMBER",s+=c.text.length}}return new rn(e.map((t=>Object.freeze(t))))}function an(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error("conflicting types: ".concat(n.join(", ")))}function cn(t,e){if(e.peekKeyword(Ge)){const n=e.pop().text;if(n!==t)throw new Error("expected ".concat(t,", got ").concat(n))}return e.popType("ID")}function un(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(null==r||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error("duplicate keywords: ".concat(JSON.stringify(r)));n.add(r)}return Object.freeze(n)}function ln(t){let e=un(t,ze);return an(e,Le("constant payable nonpayable".split(" "))),an(e,Le("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function hn(t,e){return t.popParams().map((t=>An.from(t,e)))}function fn(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return vt(t.pop().text);throw new Error("invalid gas")}return null}function pn(t){if(t.length)throw new Error("unexpected tokens at offset ".concat(t.offset,": ").concat(t.toString()))}Ce=rn;const dn=new RegExp(/^(.*)\[([0-9]*)\]$/);function gn(t){const e=t.match(Qe);if($(e,"invalid type","type",t),"uint"===t)return"uint256";if("int"===t)return"int256";if(e[2]){const n=parseInt(e[2]);$(0!==n&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);$(0!==n&&n<=256&&n%8==0,"invalid numeric width","type",t)}return t}const yn={},mn=Symbol.for("_ethers_internal"),bn="_ParamTypeInternal",wn="_ErrorInternal",vn="_EventInternal",En="_ConstructorInternal",On="_FallbackInternal",xn="_FunctionInternal",Nn="_StructInternal";var jn=De("walkAsync");class An{constructor(t,e,n,r,i,s,o,a){if(Object.defineProperty(this,jn,{value:Tn}),this.name=void 0,this.type=void 0,this.baseType=void 0,this.indexed=void 0,this.components=void 0,this.arrayLength=void 0,this.arrayChildren=void 0,X(t,yn,"ParamType"),Object.defineProperty(this,mn,{value:bn}),s&&(s=Object.freeze(s.slice())),"array"===r){if(null==o||null==a)throw new Error("")}else if(null!=o||null!=a)throw new Error("");if("tuple"===r){if(null==s)throw new Error("")}else if(null!=s)throw new Error("");J(this,{name:e,type:n,baseType:r,indexed:i,components:s,arrayLength:o,arrayChildren:a})}format(t){if(null==t&&(t="sighash"),"json"===t){const e=this.name||"";if(this.isArray()){const t=JSON.parse(this.arrayChildren.format("json"));return t.name=e,t.type+="[".concat(this.arrayLength<0?"":String(this.arrayLength),"]"),JSON.stringify(t)}const n={type:"tuple"===this.baseType?"tuple":this.type,name:e};return"boolean"==typeof this.indexed&&(n.indexed=this.indexed),this.isTuple()&&(n.components=this.components.map((e=>JSON.parse(e.format(t))))),JSON.stringify(n)}let e="";return this.isArray()?(e+=this.arrayChildren.format(t),e+="[".concat(this.arrayLength<0?"":String(this.arrayLength),"]")):this.isTuple()?e+="("+this.components.map((e=>e.format(t))).join("full"===t?", ":",")+")":e+=this.type,"sighash"!==t&&(!0===this.indexed&&(e+=" indexed"),"full"===t&&this.name&&(e+=" "+this.name)),e}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(t,e){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return t.map((t=>n.arrayChildren.walk(t,e)))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");const n=this;return t.map(((t,r)=>n.components[r].walk(t,e)))}return e(this.type,t)}async walkAsync(t,e){const n=[],r=[t];return Fe(this,jn)[jn](n,t,e,(t=>{r[0]=t})),n.length&&await Promise.all(n),r[0]}static from(t,e){if(An.isParamType(t))return t;if("string"==typeof t)try{return An.from(on(t),e)}catch(e){$(!1,"invalid param type","obj",t)}else if(t instanceof rn){let n="",r="",i=null;un(t,Le(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(r="tuple",i=t.popParams().map((t=>An.from(t))),n="tuple(".concat(i.map((t=>t.format())).join(","),")")):(n=gn(t.popType("TYPE")),r=n);let s=null,o=null;for(;t.length&&t.peekType("BRACKET");){const e=t.pop();s=new An(yn,"",n,r,null,i,o,s),o=e.value,n+=e.text,r="array",i=null}let a=null;if(un(t,We).has("indexed")){if(!e)throw new Error("");a=!0}const c=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new An(yn,c,n,r,a,i,o,s)}const n=t.name;$(!n||"string"==typeof n&&n.match(Ze),"invalid name","obj.name",n);let r=t.indexed;null!=r&&($(e,"parameter cannot be indexed","obj.indexed",t.indexed),r=!!r);let i=t.type,s=i.match(dn);if(s){const e=parseInt(s[2]||"-1"),o=An.from({type:s[1],components:t.components});return new An(yn,n||"",i,"array",r,null,e,o)}if("tuple"===i||i.startsWith("tuple(")||i.startsWith("(")){const e=null!=t.components?t.components.map((t=>An.from(t))):null;return new An(yn,n||"",i,"tuple",r,e,null,null)}return i=gn(t.type),new An(yn,n||"",i,i,r,null,null,null)}static isParamType(t){return t&&t[mn]===bn}}function Tn(t,e,n,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const i=this.arrayChildren,s=e.slice();return s.forEach(((e,r)=>{Fe(i,jn)[jn](t,e,n,(t=>{s[r]=t}))})),void r(s)}if(this.isTuple()){const i=this.components;let s;if(Array.isArray(e))s=e.slice();else{if(null==e||"object"!=typeof e)throw new Error("invalid tuple value");s=i.map((t=>{if(!t.name)throw new Error("cannot use object value with unnamed components");if(!(t.name in e))throw new Error("missing value for component ".concat(t.name));return e[t.name]}))}if(s.length!==this.components.length)throw new Error("array is wrong length");return s.forEach(((e,r)=>{Fe(i[r],jn)[jn](t,e,n,(t=>{s[r]=t}))})),void r(s)}const i=n(this.type,e);i.then?t.push(async function(){r(await i)}()):r(i)}class _n{constructor(t,e,n){this.type=void 0,this.inputs=void 0,X(t,yn,"Fragment"),J(this,{type:e,inputs:n=Object.freeze(n.slice())})}static from(t){if("string"==typeof t){try{_n.from(JSON.parse(t))}catch(t){}return _n.from(on(t))}if(t instanceof rn)switch(t.peekKeyword(Ge)){case"constructor":return Sn.from(t);case"error":return In.from(t);case"event":return Pn.from(t);case"fallback":case"receive":return Un.from(t);case"function":return Cn.from(t);case"struct":return Fn.from(t)}else if("object"==typeof t){switch(t.type){case"constructor":return Sn.from(t);case"error":return In.from(t);case"event":return Pn.from(t);case"fallback":case"receive":return Un.from(t);case"function":return Cn.from(t);case"struct":return Fn.from(t)}q(!1,"unsupported type: ".concat(t.type),"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}$(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return Sn.isFragment(t)}static isError(t){return In.isFragment(t)}static isEvent(t){return Pn.isFragment(t)}static isFunction(t){return Cn.isFragment(t)}static isStruct(t){return Fn.isFragment(t)}}class Rn extends _n{constructor(t,e,n,r){super(t,e,r),this.name=void 0,$("string"==typeof n&&n.match(Ze),"invalid identifier","name",n),r=Object.freeze(r.slice()),J(this,{name:n})}}function kn(t,e){return"("+e.map((e=>e.format(t))).join("full"===t?", ":",")+")"}class In extends Rn{constructor(t,e,n){super(t,"error",e,n),Object.defineProperty(this,mn,{value:wn})}get selector(){return gt(this.format("sighash")).substring(0,10)}format(t){if(null==t&&(t="sighash"),"json"===t)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});const e=[];return"sighash"!==t&&e.push("error"),e.push(this.name+kn(t,this.inputs)),e.join(" ")}static from(t){if(In.isFragment(t))return t;if("string"==typeof t)return In.from(on(t));if(t instanceof rn){const e=cn("error",t),n=hn(t);return pn(t),new In(yn,e,n)}return new In(yn,t.name,t.inputs?t.inputs.map(An.from):[])}static isFragment(t){return t&&t[mn]===wn}}class Pn extends Rn{constructor(t,e,n,r){super(t,"event",e,n),this.anonymous=void 0,Object.defineProperty(this,mn,{value:vn}),J(this,{anonymous:r})}get topicHash(){return gt(this.format("sighash"))}format(t){if(null==t&&(t="sighash"),"json"===t)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});const e=[];return"sighash"!==t&&e.push("event"),e.push(this.name+kn(t,this.inputs)),"sighash"!==t&&this.anonymous&&e.push("anonymous"),e.join(" ")}static getTopicHash(t,e){return e=(e||[]).map((t=>An.from(t))),new Pn(yn,t,e,!1).topicHash}static from(t){if(Pn.isFragment(t))return t;if("string"==typeof t)try{return Pn.from(on(t))}catch(e){$(!1,"invalid event fragment","obj",t)}else if(t instanceof rn){const e=cn("event",t),n=hn(t,!0),r=!!un(t,Le(["anonymous"])).has("anonymous");return pn(t),new Pn(yn,e,n,r)}return new Pn(yn,t.name,t.inputs?t.inputs.map((t=>An.from(t,!0))):[],!!t.anonymous)}static isFragment(t){return t&&t[mn]===vn}}class Sn extends _n{constructor(t,e,n,r,i){super(t,e,n),this.payable=void 0,this.gas=void 0,Object.defineProperty(this,mn,{value:En}),J(this,{payable:r,gas:i})}format(t){if(q(null!=t&&"sighash"!==t,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===t)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});const e=["constructor".concat(kn(t,this.inputs))];return this.payable&&e.push("payable"),null!=this.gas&&e.push("@".concat(this.gas.toString())),e.join(" ")}static from(t){if(Sn.isFragment(t))return t;if("string"==typeof t)try{return Sn.from(on(t))}catch(e){$(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof rn){un(t,Le(["constructor"]));const e=hn(t),n=!!un(t,Me).has("payable"),r=fn(t);return pn(t),new Sn(yn,"constructor",e,n,r)}return new Sn(yn,"constructor",t.inputs?t.inputs.map(An.from):[],!!t.payable,null!=t.gas?t.gas:null)}static isFragment(t){return t&&t[mn]===En}}class Un extends _n{constructor(t,e,n){super(t,"fallback",e),this.payable=void 0,Object.defineProperty(this,mn,{value:On}),J(this,{payable:n})}format(t){const e=0===this.inputs.length?"receive":"fallback";if("json"===t){const t=this.payable?"payable":"nonpayable";return JSON.stringify({type:e,stateMutability:t})}return"".concat(e,"()").concat(this.payable?" payable":"")}static from(t){if(Un.isFragment(t))return t;if("string"==typeof t)try{return Un.from(on(t))}catch(e){$(!1,"invalid fallback fragment","obj",t)}else if(t instanceof rn){const e=t.toString();if($(t.peekKeyword(Le(["fallback","receive"])),"type must be fallback or receive","obj",e),"receive"===t.popKeyword(Le(["fallback","receive"]))){const e=hn(t);return $(0===e.length,"receive cannot have arguments","obj.inputs",e),un(t,Le(["payable"])),pn(t),new Un(yn,[],!0)}let n=hn(t);n.length?$(1===n.length&&"bytes"===n[0].type,"invalid fallback inputs","obj.inputs",n.map((t=>t.format("minimal"))).join(", ")):n=[An.from("bytes")];const r=ln(t);if($("nonpayable"===r||"payable"===r,"fallback cannot be constants","obj.stateMutability",r),un(t,Le(["returns"])).has("returns")){const e=hn(t);$(1===e.length&&"bytes"===e[0].type,"invalid fallback outputs","obj.outputs",e.map((t=>t.format("minimal"))).join(", "))}return pn(t),new Un(yn,n,"payable"===r)}if("receive"===t.type)return new Un(yn,[],!0);if("fallback"===t.type){const e=[An.from("bytes")],n="payable"===t.stateMutability;return new Un(yn,e,n)}$(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[mn]===On}}class Cn extends Rn{constructor(t,e,n,r,i,s){super(t,"function",e,r),this.constant=void 0,this.outputs=void 0,this.stateMutability=void 0,this.payable=void 0,this.gas=void 0,Object.defineProperty(this,mn,{value:xn}),J(this,{constant:"view"===n||"pure"===n,gas:s,outputs:i=Object.freeze(i.slice()),payable:"payable"===n,stateMutability:n})}get selector(){return gt(this.format("sighash")).substring(0,10)}format(t){if(null==t&&(t="sighash"),"json"===t)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t)))),outputs:this.outputs.map((e=>JSON.parse(e.format(t))))});const e=[];return"sighash"!==t&&e.push("function"),e.push(this.name+kn(t,this.inputs)),"sighash"!==t&&("nonpayable"!==this.stateMutability&&e.push(this.stateMutability),this.outputs&&this.outputs.length&&(e.push("returns"),e.push(kn(t,this.outputs))),null!=this.gas&&e.push("@".concat(this.gas.toString()))),e.join(" ")}static getSelector(t,e){return e=(e||[]).map((t=>An.from(t))),new Cn(yn,t,"view",e,[],null).selector}static from(t){if(Cn.isFragment(t))return t;if("string"==typeof t)try{return Cn.from(on(t))}catch(e){$(!1,"invalid function fragment","obj",t)}else if(t instanceof rn){const e=cn("function",t),n=hn(t),r=ln(t);let i=[];un(t,Le(["returns"])).has("returns")&&(i=hn(t));const s=fn(t);return pn(t),new Cn(yn,e,r,n,i,s)}let e=t.stateMutability;return null==e&&(e="payable","boolean"==typeof t.constant?(e="view",t.constant||(e="payable","boolean"!=typeof t.payable||t.payable||(e="nonpayable"))):"boolean"!=typeof t.payable||t.payable||(e="nonpayable")),new Cn(yn,t.name,e,t.inputs?t.inputs.map(An.from):[],t.outputs?t.outputs.map(An.from):[],null!=t.gas?t.gas:null)}static isFragment(t){return t&&t[mn]===xn}}class Fn extends Rn{constructor(t,e,n){super(t,"struct",e,n),Object.defineProperty(this,mn,{value:Nn})}format(){throw new Error("@TODO")}static from(t){if("string"==typeof t)try{return Fn.from(on(t))}catch(e){$(!1,"invalid struct fragment","obj",t)}else if(t instanceof rn){const e=cn("struct",t),n=hn(t);return pn(t),new Fn(yn,e,n)}return new Fn(yn,t.name,t.inputs?t.inputs.map(An.from):[])}static isFragment(t){return t&&t[mn]===Nn}}function Bn(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Dn=0;function Ln(t){return"__private_"+Dn+++"_"+t}const Mn=new Map;Mn.set(0,"GENERIC_PANIC"),Mn.set(1,"ASSERT_FALSE"),Mn.set(17,"OVERFLOW"),Mn.set(18,"DIVIDE_BY_ZERO"),Mn.set(33,"ENUM_RANGE_ERROR"),Mn.set(34,"BAD_STORAGE_DATA"),Mn.set(49,"STACK_UNDERFLOW"),Mn.set(50,"ARRAY_RANGE_ERROR"),Mn.set(65,"OUT_OF_MEMORY"),Mn.set(81,"UNINITIALIZED_FUNCTION_CALL");const Vn=new RegExp(/^bytes([0-9]*)$/),zn=new RegExp(/^(u?int)([0-9]*)$/);let Jn=null,Gn=1024;var Kn=Ln("getCoder");class Wn{constructor(){Object.defineProperty(this,Kn,{value:qn})}getDefaultValue(t){const e=t.map((t=>Bn(this,Kn)[Kn](An.from(t))));return new Ue(e,"_").defaultValue()}encode(t,e){H(e.length,t.length,"types/values length mismatch");const n=t.map((t=>Bn(this,Kn)[Kn](An.from(t)))),r=new Ue(n,"_"),i=new Kt;return r.encode(i,e),i.data}decode(t,e,n){const r=t.map((t=>Bn(this,Kn)[Kn](An.from(t))));return new Ue(r,"_").decode(new te(e,n,Gn))}static _setDefaultMaxInflation(t){$("number"==typeof t&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),Gn=t}static defaultAbiCoder(){return null==Jn&&(Jn=new Wn),Jn}static getBuiltinCallException(t,e,n){return function(t,e,n,r){let i="missing revert data",s=null,o=null;if(n){i="execution reverted";const t=Q(n);if(n=rt(n),0===t.length)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(t.length%32!=4)i+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===rt(t.slice(0,4)))try{s=r.decode(["string"],t.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[s]},i+=": ".concat(JSON.stringify(s))}catch(t){i+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===rt(t.slice(0,4)))try{const e=Number(r.decode(["uint256"],t.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[e]},s="Panic due to ".concat(Mn.get(e)||"UNKNOWN","(").concat(e,")"),i+=": ".concat(s)}catch(t){i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const a={to:e.to?ce(e.to):null,data:e.data||"0x"};return e.from&&(a.from=ce(e.from)),W(i,"CALL_EXCEPTION",{action:t,data:n,reason:s,transaction:a,invocation:null,revert:o})}(t,e,n,Wn.defaultAbiCoder())}}function qn(t){if(t.isArray())return new Oe(Bn(this,Kn)[Kn](t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new Ue(t.components.map((t=>Bn(this,Kn)[Kn](t))),t.name);switch(t.baseType){case"address":return new be(t.name);case"bool":return new xe(t.name);case"string":return new Se(t.name);case"bytes":return new je(t.name);case"":return new _e(t.name)}let e=t.type.match(zn);if(e){let n=parseInt(e[2]||"256");return $(0!==n&&n<=256&&n%8==0,"invalid "+e[1]+" bit length","param",t),new Pe(n/8,"int"===e[1],t.name)}if(e=t.type.match(Vn),e){let n=parseInt(e[1]);return $(0!==n&&n<=32,"invalid bytes length","param",t),new Ae(n,t.name)}$(!1,"invalid type","type",t.type)}function $n(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Hn=0;function Yn(t){return"__private_"+Hn+++"_"+t}class Xn{constructor(t,e,n){this.fragment=void 0,this.name=void 0,this.signature=void 0,this.topic=void 0,this.args=void 0;const r=t.name,i=t.format();J(this,{fragment:t,name:r,signature:i,topic:e,args:n})}}class Zn{constructor(t,e,n,r){this.fragment=void 0,this.name=void 0,this.args=void 0,this.signature=void 0,this.selector=void 0,this.value=void 0;const i=t.name,s=t.format();J(this,{fragment:t,name:i,args:n,signature:s,selector:e,value:r})}}class Qn{constructor(t,e,n){this.fragment=void 0,this.name=void 0,this.args=void 0,this.signature=void 0,this.selector=void 0;const r=t.name,i=t.format();J(this,{fragment:t,name:r,args:n,signature:i,selector:e})}}class tr{static isIndexed(t){return!(!t||!t._isIndexed)}constructor(t){this.hash=void 0,this._isIndexed=void 0,J(this,{hash:t,_isIndexed:!0})}}const er={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},nr={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>"reverted with reason string ".concat(JSON.stringify(t))},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&er[t.toString()]&&(e=er[t.toString()]),"reverted with panic code 0x".concat(t.toString(16)," (").concat(e,")")}}};var rr=Yn("errors"),ir=Yn("events"),sr=Yn("functions"),or=Yn("abiCoder"),ar=Yn("getFunction"),cr=Yn("getEvent");class ur{constructor(t){Object.defineProperty(this,cr,{value:hr}),Object.defineProperty(this,ar,{value:lr}),this.fragments=void 0,this.deploy=void 0,this.fallback=void 0,this.receive=void 0,Object.defineProperty(this,rr,{writable:!0,value:void 0}),Object.defineProperty(this,ir,{writable:!0,value:void 0}),Object.defineProperty(this,sr,{writable:!0,value:void 0}),Object.defineProperty(this,or,{writable:!0,value:void 0});let e=[];e="string"==typeof t?JSON.parse(t):t,$n(this,sr)[sr]=new Map,$n(this,rr)[rr]=new Map,$n(this,ir)[ir]=new Map;const n=[];for(const t of e)try{n.push(_n.from(t))}catch(e){console.log("[Warning] Invalid Fragment ".concat(JSON.stringify(t),":"),e.message)}J(this,{fragments:Object.freeze(n)});let r=null,i=!1;$n(this,or)[or]=this.getAbiCoder(),this.fragments.forEach(((t,e)=>{let n;switch(t.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void J(this,{deploy:t});case"fallback":return void(0===t.inputs.length?i=!0:($(!r||t.payable!==r.payable,"conflicting fallback fragments","fragments[".concat(e,"]"),t),r=t,i=r.payable));case"function":n=$n(this,sr)[sr];break;case"event":n=$n(this,ir)[ir];break;case"error":n=$n(this,rr)[rr];break;default:return}const s=t.format();n.has(s)||n.set(s,t)})),this.deploy||J(this,{deploy:Sn.from("constructor()")}),J(this,{fallback:r,receive:i})}format(t){const e=t?"minimal":"full";return this.fragments.map((t=>t.format(e)))}formatJson(){const t=this.fragments.map((t=>t.format("json")));return JSON.stringify(t.map((t=>JSON.parse(t))))}getAbiCoder(){return Wn.defaultAbiCoder()}getFunctionName(t){const e=$n(this,ar)[ar](t,null,!1);return $(e,"no matching function","key",t),e.name}hasFunction(t){return!!$n(this,ar)[ar](t,null,!1)}getFunction(t,e){return $n(this,ar)[ar](t,e||null,!0)}forEachFunction(t){const e=Array.from($n(this,sr)[sr].keys());e.sort(((t,e)=>t.localeCompare(e)));for(let n=0;n<e.length;n++){const r=e[n];t($n(this,sr)[sr].get(r),n)}}getEventName(t){const e=$n(this,cr)[cr](t,null,!1);return $(e,"no matching event","key",t),e.name}hasEvent(t){return!!$n(this,cr)[cr](t,null,!1)}getEvent(t,e){return $n(this,cr)[cr](t,e||null,!0)}forEachEvent(t){const e=Array.from($n(this,ir)[ir].keys());e.sort(((t,e)=>t.localeCompare(e)));for(let n=0;n<e.length;n++){const r=e[n];t($n(this,ir)[ir].get(r),n)}}getError(t,e){if(et(t)){const e=t.toLowerCase();if(nr[e])return In.from(nr[e].signature);for(const t of $n(this,rr)[rr].values())if(e===t.selector)return t;return null}if(-1===t.indexOf("(")){const e=[];for(const[n,r]of $n(this,rr)[rr])n.split("(")[0]===t&&e.push(r);if(0===e.length)return"Error"===t?In.from("error Error(string)"):"Panic"===t?In.from("error Panic(uint256)"):null;if(e.length>1){const n=e.map((t=>JSON.stringify(t.format()))).join(", ");$(!1,"ambiguous error description (i.e. ".concat(n,")"),"name",t)}return e[0]}if("Error(string)"===(t=In.from(t).format()))return In.from("error Error(string)");if("Panic(uint256)"===t)return In.from("error Panic(uint256)");return $n(this,rr)[rr].get(t)||null}forEachError(t){const e=Array.from($n(this,rr)[rr].keys());e.sort(((t,e)=>t.localeCompare(e)));for(let n=0;n<e.length;n++){const r=e[n];t($n(this,rr)[rr].get(r),n)}}_decodeParams(t,e){return $n(this,or)[or].decode(t,e)}_encodeParams(t,e){return $n(this,or)[or].encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){if("string"==typeof t){const e=this.getError(t);$(e,"unknown error","fragment",t),t=e}return $(st(e,0,4)===t.selector,"data signature does not match error ".concat(t.name,"."),"data",e),this._decodeParams(t.inputs,st(e,4))}encodeErrorResult(t,e){if("string"==typeof t){const e=this.getError(t);$(e,"unknown error","fragment",t),t=e}return it([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionData(t,e){if("string"==typeof t){const e=this.getFunction(t);$(e,"unknown function","fragment",t),t=e}return $(st(e,0,4)===t.selector,"data signature does not match function ".concat(t.name,"."),"data",e),this._decodeParams(t.inputs,st(e,4))}encodeFunctionData(t,e){if("string"==typeof t){const e=this.getFunction(t);$(e,"unknown function","fragment",t),t=e}return it([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionResult(t,e){if("string"==typeof t){const e=this.getFunction(t);$(e,"unknown function","fragment",t),t=e}let n="invalid length for result data";const r=tt(e);if(r.length%32==0)try{return $n(this,or)[or].decode(t.outputs,r)}catch(t){n="could not decode result data"}q(!1,n,"BAD_DATA",{value:rt(r),info:{method:t.name,signature:t.format()}})}makeError(t,e){const n=Q(t,"data"),r=Wn.getBuiltinCallException("call",e,n);if(r.message.startsWith("execution reverted (unknown custom error)")){const t=rt(n.slice(0,4)),e=this.getError(t);if(e)try{const t=$n(this,or)[or].decode(e.inputs,n.slice(4));r.revert={name:e.name,signature:e.format(),args:t},r.reason=r.revert.signature,r.message="execution reverted: ".concat(r.reason)}catch(t){r.message="execution reverted (coult not decode custom error)"}}const i=this.parseTransaction(e);return i&&(r.invocation={method:i.name,signature:i.signature,args:i.args}),r}encodeFunctionResult(t,e){if("string"==typeof t){const e=this.getFunction(t);$(e,"unknown function","fragment",t),t=e}return rt($n(this,or)[or].encode(t.outputs,e||[]))}encodeFilterTopics(t,e){if("string"==typeof t){const e=this.getEvent(t);$(e,"unknown event","eventFragment",t),t=e}q(e.length<=t.inputs.length,"too many arguments for ".concat(t.format()),"UNEXPECTED_ARGUMENT",{count:e.length,expectedCount:t.inputs.length});const n=[];t.anonymous||n.push(t.topicHash);const r=(t,e)=>"string"===t.type?gt(e):"bytes"===t.type?lt(rt(e)):("bool"===t.type&&"boolean"==typeof e?e=e?"0x01":"0x00":t.type.match(/^u?int/)?e=jt(e):t.type.match(/^bytes/)?e=ot(e,32,!1):"address"===t.type&&$n(this,or)[or].encode(["address"],[e]),ot(rt(e),32,!0));for(e.forEach(((e,i)=>{const s=t.inputs[i];s.indexed?null==e?n.push(null):"array"===s.baseType||"tuple"===s.baseType?$(!1,"filtering with tuples or arrays not supported","contract."+s.name,e):Array.isArray(e)?n.push(e.map((t=>r(s,t)))):n.push(r(s,e)):$(null==e,"cannot filter non-indexed parameters; must be null","contract."+s.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(t,e){if("string"==typeof t){const e=this.getEvent(t);$(e,"unknown event","eventFragment",t),t=e}const n=[],r=[],i=[];return t.anonymous||n.push(t.topicHash),$(e.length===t.inputs.length,"event arguments/values mismatch","values",e),t.inputs.forEach(((t,s)=>{const o=e[s];if(t.indexed)if("string"===t.type)n.push(gt(o));else if("bytes"===t.type)n.push(lt(o));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push($n(this,or)[or].encode([t.type],[o]))}else r.push(t),i.push(o)})),{data:$n(this,or)[or].encode(r,i),topics:n}}decodeEventLog(t,e,n){if("string"==typeof t){const e=this.getEvent(t);$(e,"unknown event","eventFragment",t),t=e}if(null!=n&&!t.anonymous){const e=t.topicHash;$(et(n[0],32)&&n[0].toLowerCase()===e,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const r=[],i=[],s=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(r.push(An.from({type:"bytes32",name:t.name})),s.push(!0)):(r.push(t),s.push(!1)):(i.push(t),s.push(!1))}));const o=null!=n?$n(this,or)[or].decode(r,it(n)):null,a=$n(this,or)[or].decode(i,e,!0),c=[],u=[];let l=0,h=0;return t.inputs.forEach(((t,e)=>{let n=null;if(t.indexed)if(null==o)n=new tr(null);else if(s[e])n=new tr(o[h++]);else try{n=o[h++]}catch(t){n=t}else try{n=a[l++]}catch(t){n=t}c.push(n),u.push(t.name||null)})),Lt.fromItems(c,u)}parseTransaction(t){const e=Q(t.data,"tx.data"),n=vt(null!=t.value?t.value:0,"tx.value"),r=this.getFunction(rt(e.slice(0,4)));if(!r)return null;const i=$n(this,or)[or].decode(r.inputs,e.slice(4));return new Zn(r,r.selector,i,n)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){const e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new Xn(e,e.topicHash,this.decodeEventLog(e,t.data,t.topics))}parseError(t){const e=rt(t),n=this.getError(st(e,0,4));if(!n)return null;const r=$n(this,or)[or].decode(n.inputs,st(e,4));return new Qn(n,n.selector,r)}static from(t){return t instanceof ur?t:"string"==typeof t?new ur(JSON.parse(t)):"function"==typeof t.formatJson?new ur(t.formatJson()):"function"==typeof t.format?new ur(t.format("json")):new ur(t)}}function lr(t,e,n){if(et(t)){const e=t.toLowerCase();for(const t of $n(this,sr)[sr].values())if(e===t.selector)return t;return null}if(-1===t.indexOf("(")){const r=[];for(const[e,n]of $n(this,sr)[sr])e.split("(")[0]===t&&r.push(n);if(e){const t=e.length>0?e[e.length-1]:null;let n=e.length,i=!0;me.isTyped(t)&&"overrides"===t.type&&(i=!1,n--);for(let t=r.length-1;t>=0;t--){const e=r[t].inputs.length;e===n||i&&e===n-1||r.splice(t,1)}for(let t=r.length-1;t>=0;t--){const n=r[t].inputs;for(let i=0;i<e.length;i++)if(me.isTyped(e[i])){if(i>=n.length){if("overrides"===e[i].type)continue;r.splice(t,1);break}if(e[i].type!==n[i].baseType){r.splice(t,1);break}}}}if(1===r.length&&e&&e.length!==r[0].inputs.length){const t=e[e.length-1];(null==t||Array.isArray(t)||"object"!=typeof t)&&r.splice(0,1)}if(0===r.length)return null;if(r.length>1&&n){const e=r.map((t=>JSON.stringify(t.format()))).join(", ");$(!1,"ambiguous function description (i.e. matches ".concat(e,")"),"key",t)}return r[0]}return $n(this,sr)[sr].get(Cn.from(t).format())||null}function hr(t,e,n){if(et(t)){const e=t.toLowerCase();for(const t of $n(this,ir)[ir].values())if(e===t.topicHash)return t;return null}if(-1===t.indexOf("(")){const r=[];for(const[e,n]of $n(this,ir)[ir])e.split("(")[0]===t&&r.push(n);if(e){for(let t=r.length-1;t>=0;t--)r[t].inputs.length<e.length&&r.splice(t,1);for(let t=r.length-1;t>=0;t--){const n=r[t].inputs;for(let i=0;i<e.length;i++)if(me.isTyped(e[i])&&e[i].type!==n[i].baseType){r.splice(t,1);break}}}if(0===r.length)return null;if(r.length>1&&n){const e=r.map((t=>JSON.stringify(t.format()))).join(", ");$(!1,"ambiguous event description (i.e. matches ".concat(e,")"),"key",t)}return r[0]}return $n(this,ir)[ir].get(Pn.from(t).format())||null}function fr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function pr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?fr(Object(n),!0).forEach((function(e){dr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function dr(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var gr=class{constructor(t){var e=this;this.dialogWindowOrigin="",this.isDestroyed=!1,this.mode="production",this.pendingRequests=new Map,this.getMode=()=>this.mode,this.destroy=()=>{this.isDestroyed||(this.isDestroyed=!0,"undefined"!=typeof window&&window.removeEventListener("message",this.handleMessage),this.rejectAllPendingRequests("DESTROYED"))},this.handleMessage=t=>{if(t.origin!==this.dialogWindowOrigin)return;const e=t.data;if(!e.requestId)return;if("CLOSE_MODAL"===e.type)return void this.rejectAllPendingRequests("REJECTED");const n=this.pendingRequests.get(e.requestId);n&&n.requestType!==e.type&&(this.pendingRequests.delete(e.requestId),e.error?n.reject(e.error):n.resolve(e.payload))},this.verifyHumanity=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.minPoints||(t=pr(pr({},t),{},{minPoints:0})),e.request("PROOFS_REQUEST",t)},this.getAddressScore=async t=>{if(!t)throw new Error("`address` argument is required to get address score");const{score:e,message:n,signature:r}=await d(t);return{score:e,message:n,signature:r}},this.verifyProofs=async t=>{let{proofs:e,provider:n}=t;const r={verified:!1,points:{total:0,groups:[]}},i=await async function(t){try{const e="dev"===t?"dev-configs":"configs",n=await p("https://raw.githubusercontent.com/BringID/configs/main/".concat(e,".json"));return{REGISTRY:n.REGISTRY,CHAIN_ID:n.CHAIN_ID}}catch(t){return console.error(t),null}}(this.mode);if(!i)throw new Error("configs cannot be fetched");const s=await async function(t){try{const e="dev"===t?"tasks-sepolia":"tasks",n=await p("https://raw.githubusercontent.com/BringID/configs/main/".concat(e,".json")),r=new Map;for(const t of n)for(const e of t.groups)r.set(e.credentialGroupId,e.points);return r}catch(t){return console.error(t),null}}(this.mode);if(!s)throw new Error("tasks config cannot be fetched");const o=()=>{const t=e.map((t=>{var e;const n=null!==(e=s.get(t.credential_group_id))&&void 0!==e?e:0;return{credential_group_id:t.credential_group_id,points:n}}));return{verified:!0,points:{total:t.reduce(((t,e)=>t+e.points),0),groups:t}}};if(!n)try{const{result:t}=await g(e,Number(i.CHAIN_ID),i.REGISTRY);return t?o():r}catch(t){return console.error(t),r}const a=new ur(y),c=new ur(m),u=e.map((t=>{const e={credentialGroupId:t.credential_group_id,semaphoreProof:{merkleTreeDepth:t.semaphore_proof.merkle_tree_depth,merkleTreeRoot:t.semaphore_proof.merkle_tree_root,nullifier:t.semaphore_proof.nullifier,message:t.semaphore_proof.message,scope:t.semaphore_proof.scope,points:t.semaphore_proof.points}},n=a.encodeFunctionData("verifyProof",[e]);return{target:i.REGISTRY,allowFailure:!1,callData:n}})),l=c.encodeFunctionData("aggregate3",[u]);try{return await n.call({to:"0xca11bde05977b3631167028862be2a173976ca11",data:l}),o()}catch(t){return console.error(t),r}},"undefined"!=typeof window&&(window.addEventListener("message",this.handleMessage),this.dialogWindowOrigin=window.location.origin),t&&t.mode&&(this.mode=t.mode)}sendMessageToDialog(t){window.postMessage(t,this.dialogWindowOrigin)}request(t,e){return new Promise(((n,r)=>{const i=a();this.pendingRequests.set(i,{resolve:n,reject:r,requestType:t}),this.sendMessageToDialog({type:t,requestId:i,payload:e})}))}rejectAllPendingRequests(t){for(const{reject:e}of this.pendingRequests.values())e(t);this.pendingRequests.clear()}};return e}()}));
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/bring-id-sdk/index.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,EACN,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAMhB,qBAAa,OAAO;IAClB,OAAO,CAAC,kBAAkB,CAAK;IAC/B,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,IAAI,CAAsB;IAElC,OAAO,CAAC,eAAe,CAOnB;gBAEQ,IAAI,CAAC,EAAE,gBAAgB;IAWnC,OAAO,cAEN;IAED,OAAO,EAAE,QAAQ,CAOhB;IAED,sBAAsB;IACtB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,aAAa,CAwBnB;IAEF,0CAA0C;IAC1C,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,wBAAwB;IAQhC,qBAAqB;IACrB,cAAc,EAAE,eAAe,CAK9B;IAED,eAAe,EAAE,gBAAgB,CAiBhC;IAGD,YAAY,EAAE,aAAa,CAqE1B;CAEF;AAED,eAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/bring-id-sdk/index.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,EACN,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAMhB,qBAAa,OAAO;IAClB,OAAO,CAAC,kBAAkB,CAAK;IAC/B,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,IAAI,CAAsB;IAElC,OAAO,CAAC,eAAe,CAOnB;gBAEQ,IAAI,CAAC,EAAE,gBAAgB;IAWnC,OAAO,cAEN;IAED,OAAO,EAAE,QAAQ,CAOhB;IAED,sBAAsB;IACtB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,aAAa,CAwBnB;IAEF,0CAA0C;IAC1C,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,wBAAwB;IAQhC,qBAAqB;IACrB,cAAc,EAAE,eAAe,CAK9B;IAED,eAAe,EAAE,gBAAgB,CAiBhC;IAGD,YAAY,EAAE,aAAa,CAyG1B;CAEF;AAED,eAAe,OAAO,CAAA"}
@@ -4,6 +4,18 @@ type TArgs = {
4
4
  proofs: TSemaphoreProof[];
5
5
  provider?: ethers.JsonRpcProvider;
6
6
  };
7
- type TVerifyProofs = (payload: TArgs) => Promise<boolean>;
7
+ type TCredentialGroupPoints = {
8
+ credential_group_id: string;
9
+ points: number;
10
+ };
11
+ type TVerifyProofsResult = {
12
+ verified: boolean;
13
+ points: {
14
+ total: number;
15
+ groups: TCredentialGroupPoints[];
16
+ };
17
+ };
18
+ type TVerifyProofs = (payload: TArgs) => Promise<TVerifyProofsResult>;
8
19
  export default TVerifyProofs;
20
+ export type { TVerifyProofsResult, TCredentialGroupPoints };
9
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/bring-id-sdk/types/verify-proofs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,eAAe,CAAA;CAClC,CAAA;AAED,KAAK,aAAa,GAAG,CAAC,OAAO,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAEzD,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/bring-id-sdk/types/verify-proofs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,eAAe,CAAA;CAClC,CAAA;AAED,KAAK,sBAAsB,GAAG;IAC5B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,sBAAsB,EAAE,CAAA;KACjC,CAAA;CACF,CAAA;AAED,KAAK,aAAa,GAAG,CAAC,OAAO,EAAE,KAAK,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAErE,eAAe,aAAa,CAAA;AAC5B,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export type TCredentialGroupPointsMap = Map<string, number>;
2
+ //# sourceMappingURL=credential-group-points-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-group-points-map.d.ts","sourceRoot":"","sources":["../../src/types/credential-group-points-map.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yBAAyB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA"}
@@ -1,32 +1,18 @@
1
1
  import TSemaphoreProof from "./semaphore-proof";
2
- import TExtensionStatus from './extension-status';
3
2
  import TErrorType from "./error-type";
4
3
  import TRequestType from "./request-type";
5
4
  import TRequest from './request';
6
5
  import TResponse from './response';
7
6
  import TGenerateSignature from './generate-signature';
8
- import TTask from "./task";
9
- import TVerificationData from './verification-data';
10
7
  import TScoreMessage from "./score-message";
11
8
  import { TOutboundMessage, TProofsRequestMessage, TUserKeyReadyMessage } from './outbound-message';
12
9
  import { TCloseModalMessage, TGenerateUserKeyMessage, TInboundMessage, TProofsResponseMessage } from './inbound-message';
13
- import { TInboundMessageType, TMessage, TOutboundMessageType } from './message';
14
10
  import TCall3 from './call3';
15
11
  import TMode from "./mode";
16
- export { TTaskGroupCheck } from './task-group-check';
17
- export { TTaskGroup } from './task-group';
18
- export type { Result } from './result';
19
- export type { TNotarizationStatus } from './notarization-status';
20
- export type { TNotarizationStep } from './notarization-step';
21
- export type { TNotarizationGroup } from './notarization-group';
22
- export type { TNotarizationGroupCheck } from './notarization-group-check';
23
- export type { TConnectionQuality } from './connection-quality';
24
- export type { TSemaphoreProofServer } from './semaphore-proof-server';
25
- export type { TUserStatus } from './user-status';
26
- export type { TUser } from './user';
27
- export type { TVerificationStatus } from './verification-status';
28
- export type { TVerification } from './verification';
29
- export type { TTaskServer } from './task-server';
30
- export type { TVerifyResult } from './verify-result';
31
- export { TMode, TOutboundMessage, TProofsRequestMessage, TUserKeyReadyMessage, TSemaphoreProof, TCloseModalMessage, TGenerateUserKeyMessage, TInboundMessage, TInboundMessageType, TMessage, TOutboundMessageType, TProofsResponseMessage, TExtensionStatus, TErrorType, TRequestType, TRequest, TGenerateSignature, TResponse, TTask, TCall3, TVerificationData, TScoreMessage };
12
+ export type { TTaskCheck } from './task-check';
13
+ export type { TTaskGroup } from './task-group';
14
+ export type { TTask } from './task';
15
+ export type { TTasksConfig } from './tasks-config';
16
+ export type { TCredentialGroupPointsMap } from './credential-group-points-map';
17
+ export { TMode, TOutboundMessage, TProofsRequestMessage, TUserKeyReadyMessage, TSemaphoreProof, TCloseModalMessage, TGenerateUserKeyMessage, TInboundMessage, TProofsResponseMessage, TErrorType, TRequestType, TRequest, TGenerateSignature, TResponse, TCall3, TScoreMessage };
32
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,QAAQ,MAAM,WAAW,CAAA;AAChC,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AACrD,OAAO,KAAK,MAAM,QAAQ,CAAA;AAC1B,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,mBAAmB,EACnB,QAAQ,EACR,oBAAoB,EACrB,MAAM,WAAW,CAAA;AAClB,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,MAAM,QAAQ,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,YAAY,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EAEf,mBAAmB,EACnB,QAAQ,EACR,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,KAAK,EACL,MAAM,EACN,iBAAiB,EACjB,aAAa,EACd,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,QAAQ,MAAM,WAAW,CAAA;AAChC,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AACrD,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,MAAM,QAAQ,CAAA;AAE1B,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,YAAY,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AACnC,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,YAAY,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AAE9E,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,MAAM,EACN,aAAa,EACd,CAAA"}
@@ -0,0 +1,6 @@
1
+ export type TTaskCheck = {
2
+ key: string;
3
+ type: string;
4
+ value: string;
5
+ };
6
+ //# sourceMappingURL=task-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-check.d.ts","sourceRoot":"","sources":["../../src/types/task-check.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
@@ -1,8 +1,8 @@
1
- import { TTaskGroupCheck } from './';
1
+ import { TTaskCheck } from './task-check';
2
2
  export type TTaskGroup = {
3
3
  points: number;
4
4
  semaphoreGroupId: string;
5
5
  credentialGroupId: string;
6
- checks?: TTaskGroupCheck[];
6
+ checks: TTaskCheck[];
7
7
  };
8
8
  //# sourceMappingURL=task-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"task-group.d.ts","sourceRoot":"","sources":["../../src/types/task-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAErC,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;CAC5B,CAAC"}
1
+ {"version":3,"file":"task-group.d.ts","sourceRoot":"","sources":["../../src/types/task-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,MAAM,CAAA;IACzB,MAAM,EAAE,UAAU,EAAE,CAAA;CACrB,CAAA"}
@@ -1,12 +1,13 @@
1
- import { TNotarizationGroup } from "./notarization-group";
2
- type TTask = {
3
- id: string;
1
+ import { TTaskGroup } from './task-group';
2
+ export type TTask = {
4
3
  title: string;
5
- description?: string;
6
- icon: string;
7
- groups: TNotarizationGroup[];
4
+ id: string;
8
5
  service: string;
9
- oauthUrl: string | undefined;
6
+ description: string;
7
+ icon: string;
8
+ verificationType?: string;
9
+ verificationUrl?: string;
10
+ oauthUrl?: string;
11
+ groups: TTaskGroup[];
10
12
  };
11
- export default TTask;
12
13
  //# sourceMappingURL=task.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/types/task.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,KAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/types/task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,MAAM,KAAK,GAAG;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,UAAU,EAAE,CAAA;CACrB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { TTask } from './task';
2
+ export type TTasksConfig = TTask[];
3
+ //# sourceMappingURL=tasks-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks-config.d.ts","sourceRoot":"","sources":["../../src/types/tasks-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE9B,MAAM,MAAM,YAAY,GAAG,KAAK,EAAE,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { TMode, TCredentialGroupPointsMap } from '@/types';
2
+ declare function fetchTasksConfig(mode: TMode): Promise<TCredentialGroupPointsMap | null>;
3
+ export default fetchTasksConfig;
4
+ //# sourceMappingURL=fetch-tasks-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-tasks-config.d.ts","sourceRoot":"","sources":["../../src/utils/fetch-tasks-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAgB,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAGxE,iBAAe,gBAAgB,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAmBtF;AAED,eAAe,gBAAgB,CAAA"}
@@ -7,5 +7,6 @@ import msToTime from './ms-to-time';
7
7
  import isValidInboundMessage from './validate-inbound-message';
8
8
  import isValidOutboundMessage from './validate-outbound-message';
9
9
  import fetchRegistryConfig from './fetch-registry-config';
10
- export { generateId, shortenString, msToTime, defineApiUrl, api, createQueryString, isValidInboundMessage, isValidOutboundMessage, fetchRegistryConfig };
10
+ import fetchTasksConfig from './fetch-tasks-config';
11
+ export { generateId, shortenString, msToTime, defineApiUrl, api, createQueryString, isValidInboundMessage, isValidOutboundMessage, fetchRegistryConfig, fetchTasksConfig };
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,eAAe,CAAA;AAEtC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,QAAQ,MAAM,cAAc,CAAC;AACpC,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,mBAAmB,MAAM,yBAAyB,CAAA;AAEzD,OAAO,EACL,UAAU,EACV,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,GAAG,EACH,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACpB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,eAAe,CAAA;AAEtC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,QAAQ,MAAM,cAAc,CAAC;AACpC,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,mBAAmB,MAAM,yBAAyB,CAAA;AACzD,OAAO,gBAAgB,MAAM,sBAAsB,CAAA;AAEnD,OAAO,EACL,UAAU,EACV,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,GAAG,EACH,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EACjB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bringid",
3
- "version": "0.2.1-beta",
3
+ "version": "0.3.0-beta-rc.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -1,2 +0,0 @@
1
- export type TConnectionQuality = 'good' | 'fair' | 'poor' | 'excellent';
2
- //# sourceMappingURL=connection-quality.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connection-quality.d.ts","sourceRoot":"","sources":["../../src/types/connection-quality.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC"}
@@ -1,3 +0,0 @@
1
- type TExtensionStatus = 'EXTENSION_IS_INSTALLED_AND_CONNECTED' | 'EXTENSION_IS_INSTALLED_AND_NOT_CONNECTED' | 'EXTENSION_IS_NOT_INSTALLED';
2
- export default TExtensionStatus;
3
- //# sourceMappingURL=extension-status.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extension-status.d.ts","sourceRoot":"","sources":["../../src/types/extension-status.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG,sCAAsC,GACtC,0CAA0C,GAC1C,4BAA4B,CAAA;AAEpD,eAAe,gBAAgB,CAAA"}
@@ -1,5 +0,0 @@
1
- import { TInboundMessage, TOutboundMessage } from "./";
2
- export type TMessage = TOutboundMessage | TInboundMessage;
3
- export type TOutboundMessageType = TOutboundMessage['type'];
4
- export type TInboundMessageType = TInboundMessage['type'];
5
- //# sourceMappingURL=message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/types/message.ts"],"names":[],"mappings":"AAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAA;AACtD,MAAM,MAAM,QAAQ,GAAG,gBAAgB,GAAG,eAAe,CAAA;AAEzD,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;AAC3D,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA"}
@@ -1,6 +0,0 @@
1
- export type TNotarizationGroupCheck = {
2
- key: string;
3
- type: string;
4
- value: string;
5
- };
6
- //# sourceMappingURL=notarization-group-check.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notarization-group-check.d.ts","sourceRoot":"","sources":["../../src/types/notarization-group-check.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAAG;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -1,8 +0,0 @@
1
- import { TNotarizationGroupCheck } from './notarization-group-check';
2
- export type TNotarizationGroup = {
3
- points: number;
4
- semaphoreGroupId: string;
5
- credentialGroupId: string;
6
- checks?: TNotarizationGroupCheck[];
7
- };
8
- //# sourceMappingURL=notarization-group.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notarization-group.d.ts","sourceRoot":"","sources":["../../src/types/notarization-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAErE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACpC,CAAC"}
@@ -1,2 +0,0 @@
1
- export type TNotarizationStatus = 'completed' | 'current' | 'disabled';
2
- //# sourceMappingURL=notarization-status.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notarization-status.d.ts","sourceRoot":"","sources":["../../src/types/notarization-status.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC"}
@@ -1,7 +0,0 @@
1
- import { TNotarizationStatus } from './notarization-status';
2
- export type TNotarizationStep = {
3
- status: TNotarizationStatus;
4
- text: string;
5
- notarization?: boolean;
6
- };
7
- //# sourceMappingURL=notarization-step.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notarization-step.d.ts","sourceRoot":"","sources":["../../src/types/notarization-step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC"}
@@ -1,2 +0,0 @@
1
- export type Result<T> = T | Error;
2
- //# sourceMappingURL=result.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../src/types/result.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC"}
@@ -1,7 +0,0 @@
1
- export type TSemaphoreProofServer = {
2
- root: string;
3
- leaf: string;
4
- index: number;
5
- siblings: string[];
6
- };
7
- //# sourceMappingURL=semaphore-proof-server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"semaphore-proof-server.d.ts","sourceRoot":"","sources":["../../src/types/semaphore-proof-server.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC"}
@@ -1,6 +0,0 @@
1
- export type TTaskGroupCheck = {
2
- key: string;
3
- type: string;
4
- value: string;
5
- };
6
- //# sourceMappingURL=task-group-check.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-group-check.d.ts","sourceRoot":"","sources":["../../src/types/task-group-check.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -1,18 +0,0 @@
1
- import TTaskType from './task-type';
2
- import TTaskStatus from './task-status';
3
- export type TTaskServer = {
4
- id: string;
5
- type: TTaskType;
6
- status: TTaskStatus;
7
- id_hash: string | null;
8
- registry: string;
9
- credential_group_id: string;
10
- verifier_signature: string;
11
- identity_commitment: string;
12
- batch_id: null | string;
13
- scheduled_time: number;
14
- created_at: string;
15
- updated_at: string;
16
- tx_hash: string;
17
- };
18
- //# sourceMappingURL=task-server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-server.d.ts","sourceRoot":"","sources":["../../src/types/task-server.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -1,3 +0,0 @@
1
- type TTaskStatus = 'scheduled' | 'pending' | 'completed' | 'failed';
2
- export default TTaskStatus;
3
- //# sourceMappingURL=task-status.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-status.d.ts","sourceRoot":"","sources":["../../src/types/task-status.tsx"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEpE,eAAe,WAAW,CAAC"}
@@ -1,3 +0,0 @@
1
- type TTaskType = 'claim' | 'verification';
2
- export default TTaskType;
3
- //# sourceMappingURL=task-type.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-type.d.ts","sourceRoot":"","sources":["../../src/types/task-type.tsx"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;AAE1C,eAAe,SAAS,CAAC"}
@@ -1,2 +0,0 @@
1
- export type TUserStatus = 'basic' | 'advanced';
2
- //# sourceMappingURL=user-status.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-status.d.ts","sourceRoot":"","sources":["../../src/types/user-status.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC"}
@@ -1,9 +0,0 @@
1
- export type TUser = {
2
- key: string | null;
3
- id: string | null;
4
- address: string | null;
5
- loading: boolean;
6
- apiKey: string | null;
7
- scope: null | string;
8
- };
9
- //# sourceMappingURL=user.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/types/user.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;CACrB,CAAC"}
@@ -1,9 +0,0 @@
1
- type TVerificationData = {
2
- signature: string;
3
- verifier_hash: string;
4
- verifier_message: {
5
- id_hash: string;
6
- };
7
- };
8
- export default TVerificationData;
9
- //# sourceMappingURL=verification-data.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verification-data.d.ts","sourceRoot":"","sources":["../../src/types/verification-data.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE;QAChB,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,eAAe,iBAAiB,CAAA"}
@@ -1,2 +0,0 @@
1
- export type TVerificationStatus = 'scheduled' | 'pending' | 'completed' | 'failed' | 'default';
2
- //# sourceMappingURL=verification-status.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verification-status.d.ts","sourceRoot":"","sources":["../../src/types/verification-status.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,CAAC"}
@@ -1,11 +0,0 @@
1
- import { TVerificationStatus } from './verification-status';
2
- export type TVerification = {
3
- status: TVerificationStatus;
4
- scheduledTime: number;
5
- credentialGroupId: string;
6
- batchId?: string | null;
7
- txHash?: string;
8
- fetched: boolean;
9
- taskId: string;
10
- };
11
- //# sourceMappingURL=verification.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../src/types/verification.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -1,11 +0,0 @@
1
- export type TVerifyResult = {
2
- verifierHash: string;
3
- signature: string;
4
- verifierMessage: {
5
- registry: string;
6
- credentialGroupId: string;
7
- idHash: string;
8
- identityCommitment: string;
9
- };
10
- };
11
- //# sourceMappingURL=verify-result.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify-result.d.ts","sourceRoot":"","sources":["../../src/types/verify-result.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC;QACf,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH,CAAC"}