@acedatacloud/nexior 3.30.2 → 3.30.3

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 (161) hide show
  1. package/dist/assets/Auth-C4dVHIKO.js +1 -0
  2. package/dist/assets/BotPlaceholder-Blzus1Ba.js +1 -0
  3. package/dist/assets/Callback-CTYxeo8Z.js +1 -0
  4. package/dist/assets/Console-BbGWMKKZ.js +1 -0
  5. package/dist/assets/Conversation-DiVMGW94.js +23 -0
  6. package/dist/assets/CopyToClipboard-CmHXEPMr.js +1 -0
  7. package/dist/assets/{Detail-HplVitVr.css → Detail-D68ZlN5z.css} +1 -1
  8. package/dist/assets/Detail-VDnCOUUU.js +2 -0
  9. package/dist/assets/{EditArray-DpGXSb1V.js → EditArray-OA-NVBZO.js} +1 -1
  10. package/dist/assets/Extra-BY28y3mx.js +1 -0
  11. package/dist/assets/FilePreview-DQpvzXs_.js +1 -0
  12. package/dist/assets/History-B1pKVuTR.js +1 -0
  13. package/dist/assets/{ImagePreview-Dun0qhAC.js → ImagePreview-DpdyaY-J.js} +1 -1
  14. package/dist/assets/ImageWrapper-D-q49c6z.js +1 -0
  15. package/dist/assets/Index-BCkGN8zE.css +1 -0
  16. package/dist/assets/Index-BJGORTT2.js +1 -0
  17. package/dist/assets/Index-Ba9yXMzu.js +1 -0
  18. package/dist/assets/Index-C7LHJpMK.js +1 -0
  19. package/dist/assets/Index-CCcF6hZ9.js +1 -0
  20. package/dist/assets/Index-Ch-rWHP2.css +1 -0
  21. package/dist/assets/{Index-CXVGa2ZU.css → Index-CuZIoeXJ.css} +1 -1
  22. package/dist/assets/{Index-DtTR08nA.css → Index-CujgCEXB.css} +1 -1
  23. package/dist/assets/Index-D1Rz1tfd.js +1 -0
  24. package/dist/assets/Index-D2oTY94j.js +1 -0
  25. package/dist/assets/Index-D7GnQkM4.js +1 -0
  26. package/dist/assets/{Index-BlTMjqXS.js → Index-DUJTbNQH.js} +1 -1
  27. package/dist/assets/Index-DZMphueF.js +1 -0
  28. package/dist/assets/Index-DZT53ftk.js +1 -0
  29. package/dist/assets/Index-DgsKsh3B.js +1 -0
  30. package/dist/assets/Index-Dia7Vi_r.js +1 -0
  31. package/dist/assets/Index-Ds2oO7k1.js +1 -0
  32. package/dist/assets/{Index-BS4HFQ5A.css → Index-DxzQLCOp.css} +1 -1
  33. package/dist/assets/Index-LTWS2Usl.css +1 -0
  34. package/dist/assets/Index-O0SBFGmH.js +1 -0
  35. package/dist/assets/Index-_Jl_BYAz.js +1 -0
  36. package/dist/assets/Index-dyBrOVOM.js +1 -0
  37. package/dist/assets/Index-guHNQauE.js +1 -0
  38. package/dist/assets/Index-myIt_TK4.js +1 -0
  39. package/dist/assets/Index-sDMWgguk.js +1 -0
  40. package/dist/assets/Index-xfpPqB6k.js +1 -0
  41. package/dist/assets/Invitees-DkWxP4e3.js +1 -0
  42. package/dist/assets/{List-DX7teWzL.js → List-BqzG7ehZ.js} +1 -1
  43. package/dist/assets/List-BxIMcYD8.js +1 -0
  44. package/dist/assets/{List-0wMSr6sl.js → List-CEq_u8D0.js} +1 -1
  45. package/dist/assets/{Login-HaVOMqv1.js → Login-CIXJrgOw.js} +1 -1
  46. package/dist/assets/Main-CQsNTqVL.js +1 -0
  47. package/dist/assets/Navigator-BrdQZd1b.js +1 -0
  48. package/dist/assets/NoTasks-BiOsXlaq.js +1 -0
  49. package/dist/assets/{Pagination-B1kOfzR8.js → Pagination-BbqydTat.js} +1 -1
  50. package/dist/assets/ScrollList-DPLKBqBd.js +1 -0
  51. package/dist/assets/{Status-CviAA8Me.js → Status-UWszJlPM.js} +1 -1
  52. package/dist/assets/Subscribe-DUBYadQ1.js +1 -0
  53. package/dist/assets/TransportWebHID-BEAZzcY0.js +1 -0
  54. package/dist/assets/VideoPlayer-DWTQSZjy.js +1 -0
  55. package/dist/assets/avatar-D84fE3q6.js +1 -0
  56. package/dist/assets/bignumber-C1xKUtxX.js +1 -0
  57. package/dist/assets/common-Cg7wDjqw.js +1 -0
  58. package/dist/assets/common-DFpFqR7d.js +1 -0
  59. package/dist/assets/{distribution-D9pkXpfI.js → distribution-CJuee8y2.js} +1 -1
  60. package/dist/assets/draggabilly-23WCleZP.js +14 -0
  61. package/dist/assets/hailuo-BW-py-iC.js +1 -0
  62. package/dist/assets/hailuo-CPbFju9j.js +1 -0
  63. package/dist/assets/index-BLy_0GNg.js +9 -0
  64. package/dist/assets/index-BfyfYtZm.js +1 -0
  65. package/dist/assets/index-C1rwxuCG.js +48 -0
  66. package/dist/assets/index-C49kyaKg.js +1 -0
  67. package/dist/assets/{index-BhLJWZHg.css → index-CJFrXZHu.css} +1 -1
  68. package/dist/assets/index-D-6_CPHX.js +196 -0
  69. package/dist/assets/index-DLiWuf1u.js +3 -0
  70. package/dist/assets/index-D_w37A4E.js +303 -0
  71. package/dist/assets/index-FyDryJF8.js +613 -0
  72. package/dist/assets/index-jeGnfJ_l.js +3 -0
  73. package/dist/assets/index.es-L8lIAtWn.js +1 -0
  74. package/dist/assets/{midjourney-pGIr4mFy.js → midjourney-7qNi1gDF.js} +1 -1
  75. package/dist/assets/{midjourney-DrEvLpOW.js → midjourney-AZSr0dUI.js} +1 -1
  76. package/dist/assets/{midjourney-DTPFL7H6.js → midjourney-BA9N9EzD.js} +1 -1
  77. package/dist/assets/{midjourney-BiEcgyn_.js → midjourney-BELjzcp_.js} +1 -1
  78. package/dist/assets/{midjourney-3qTfZ2g0.js → midjourney-BXioF2pd.js} +1 -1
  79. package/dist/assets/{midjourney-BB8_8Y0b.js → midjourney-BertSXin.js} +1 -1
  80. package/dist/assets/{midjourney-BX43t6mP.js → midjourney-C45UFOHr.js} +1 -1
  81. package/dist/assets/{midjourney-BSa-zke8.js → midjourney-C9mIk6WS.js} +1 -1
  82. package/dist/assets/{midjourney-BPH2f-mB.js → midjourney-CD2E4s8K.js} +1 -1
  83. package/dist/assets/{midjourney-J2zj1IYa.js → midjourney-CJ_sZW8R.js} +1 -1
  84. package/dist/assets/{midjourney-DrLxaHYR.js → midjourney-CTHpnRlb.js} +1 -1
  85. package/dist/assets/{midjourney-DLjNdgAu.js → midjourney-CZZTzaNU.js} +1 -1
  86. package/dist/assets/{midjourney-CsMxES1u.js → midjourney-CZybL7nq.js} +1 -1
  87. package/dist/assets/{midjourney-S0C_rEm5.js → midjourney-D0jbNv1J.js} +1 -1
  88. package/dist/assets/{midjourney-BforSgJQ.js → midjourney-D7EOsHLu.js} +1 -1
  89. package/dist/assets/{midjourney-DtqGn3W4.js → midjourney-H5Wuq1-p.js} +1 -1
  90. package/dist/assets/{midjourney-CF6rGKLn.js → midjourney-HSS4vV-y.js} +1 -1
  91. package/dist/assets/{midjourney-BlWzdaOt.js → midjourney-NmlOsMCS.js} +1 -1
  92. package/dist/assets/{order-DYcfG_Yw.js → order-DUXA8yqM.js} +1 -1
  93. package/dist/assets/{pagination-bjoHZNQW.js → pagination-CihAE3FS.js} +1 -1
  94. package/dist/assets/price-BRDkc6EK.js +1 -0
  95. package/dist/assets/solana-wallets-o-Zvvwmq.js +2 -0
  96. package/dist/assets/solanaEmbed.esm-B2cUJHFV.js +10 -0
  97. package/dist/assets/string_decoder-BJaILowq.js +1 -0
  98. package/dist/assets/vendor-chart-CZ0ow4AA.js +18 -0
  99. package/dist/assets/vendor-dayjs-CzbnksQQ.js +1 -0
  100. package/dist/assets/vendor-element-plus-B4FTqxj4.js +30 -0
  101. package/dist/assets/{vendor-highlight-BX2iaugd.js → vendor-highlight-CvK2rpA0.js} +2 -2
  102. package/dist/assets/{vendor-vue-BzRnDgD5.js → vendor-vue-1w_NBnjl.js} +1 -1
  103. package/dist/assets/{vendor-vue-router-nHemWFue.js → vendor-vue-router-Dj5bcX0v.js} +2 -2
  104. package/dist/assets/vendor-web3-BWcfcUXi.js +4912 -0
  105. package/dist/assets/vendor-web3-CY2j0e5U.css +1 -0
  106. package/dist/assets/vue-plyr-BqJN4-Iw.css +1 -0
  107. package/dist/assets/vue-plyr-QZFBikSk.js +2 -0
  108. package/dist/assets/web-D_YOPR7Z.js +1 -0
  109. package/dist/assets/web-TogH-A1y.js +1 -0
  110. package/dist/index.html +21 -12
  111. package/dist/llms.txt +43 -0
  112. package/dist/robots.txt +1 -0
  113. package/package.json +1 -1
  114. package/dist/assets/Auth-BkGrZ4Al.js +0 -1
  115. package/dist/assets/BotPlaceholder-ClX8uvvo.js +0 -1
  116. package/dist/assets/Callback-IUPA4O7m.js +0 -1
  117. package/dist/assets/Console-BTsHmxR2.js +0 -1
  118. package/dist/assets/Conversation-BQBR_j0K.js +0 -2
  119. package/dist/assets/CopyToClipboard-D0yPTPYW.js +0 -1
  120. package/dist/assets/Detail-BcwTLOZv.js +0 -2
  121. package/dist/assets/Extra-CE80Lwfe.js +0 -1
  122. package/dist/assets/FilePreview-FTIIxIUg.js +0 -1
  123. package/dist/assets/History-Cq4Psb81.js +0 -1
  124. package/dist/assets/ImageWrapper-DAJLZ3ud.js +0 -1
  125. package/dist/assets/Index-B3g6nU2_.js +0 -1
  126. package/dist/assets/Index-B8R2yKg9.js +0 -1
  127. package/dist/assets/Index-B8lqf5YW.js +0 -1
  128. package/dist/assets/Index-BEZF06uI.js +0 -1
  129. package/dist/assets/Index-BdtTQ6vy.js +0 -1
  130. package/dist/assets/Index-Bj7Azusj.js +0 -1
  131. package/dist/assets/Index-C1IT2qoC.css +0 -1
  132. package/dist/assets/Index-CisgqdWF.js +0 -1
  133. package/dist/assets/Index-DOEux2Eg.js +0 -1
  134. package/dist/assets/Index-DQFKWn2R.js +0 -1
  135. package/dist/assets/Index-DWvt1qKL.js +0 -1
  136. package/dist/assets/Index-DXqYbSJL.js +0 -1
  137. package/dist/assets/Index-DfUlcZfy.js +0 -1
  138. package/dist/assets/Index-DyjIS2LR.js +0 -1
  139. package/dist/assets/Index-KwYNRzOz.js +0 -1
  140. package/dist/assets/Index-M5tWRCsH.js +0 -1
  141. package/dist/assets/Index-Zpzkw1HQ.js +0 -1
  142. package/dist/assets/Index-ocDyFWdk.js +0 -1
  143. package/dist/assets/Invitees-BCHKmn__.js +0 -1
  144. package/dist/assets/List-D-RW25bD.js +0 -1
  145. package/dist/assets/Main-DgiFebD-.js +0 -1
  146. package/dist/assets/Navigator-D08MfOeK.js +0 -1
  147. package/dist/assets/NoTasks-CQZOGbwI.js +0 -1
  148. package/dist/assets/ScrollList-CfFOKFbb.js +0 -1
  149. package/dist/assets/Subscribe-QybZFlvY.js +0 -1
  150. package/dist/assets/VideoPlayer-Bx5Q-Jo7.js +0 -1
  151. package/dist/assets/common-4G-6GjVw.js +0 -1
  152. package/dist/assets/common-Dq_GF8st.js +0 -1
  153. package/dist/assets/hailuo-D-zG7pKA.js +0 -1
  154. package/dist/assets/hailuo-DjqqC0kS.js +0 -1
  155. package/dist/assets/index-BwtxyV6k.js +0 -3
  156. package/dist/assets/price-Clo8IP03.js +0 -1
  157. package/dist/assets/vendor-B4-12K57.js +0 -5564
  158. package/dist/assets/vendor-Cp-P0JlL.css +0 -1
  159. package/dist/assets/vendor-chart-BKONGlyX.js +0 -13
  160. package/dist/assets/vendor-dayjs-D6Igi227.js +0 -1
  161. package/dist/assets/vendor-element-plus-C2t7-rNg.js +0 -6
@@ -0,0 +1,10 @@
1
+ import{k as bt,j as dr,r as Qo,x as Zo,F as Xi,P as Un}from"./vendor-web3-BWcfcUXi.js";import{r as es}from"./string_decoder-BJaILowq.js";import{g as mt,j as Lt}from"./vendor-dayjs-CzbnksQQ.js";import"./vendor-vue-1w_NBnjl.js";function kt(r){"@babel/helpers - typeof";return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kt(r)}function ts(r,e){if(kt(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(kt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function rs(r){var e=ts(r,"string");return kt(e)=="symbol"?e:e+""}function pe(r,e,t){return(e=rs(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Bn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,n)}return t}function $e(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bn(Object(t),!0).forEach(function(n){pe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Bn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Dr={exports:{}},kr={exports:{}},jr,qn;function Te(){if(qn)return jr;qn=1;class r extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let n="";for(let s=0;s<t.length;s++)n+=` ${t[s].stack}
2
+ `;super(n),this.name="AggregateError",this.errors=t}}return jr={AggregateError:r,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,n){return e.slice(t,n)},Error,FunctionPrototypeCall(e,t,...n){return e.call(t,...n)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,n){return Object.defineProperty(e,t,n)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,n){return e.then(t,n)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,n){return e.slice(t,n)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,n){return e.set(t,n)},Boolean,Uint8Array},jr}var Wr={exports:{}},Fr,$n;function Qi(){return $n||($n=1,Fr={format(r,...e){return r.replace(/%([sdifj])/g,function(...[t,n]){const s=e.shift();return n==="f"?s.toFixed(6):n==="j"?JSON.stringify(s):n==="s"&&typeof s=="object"?`${s.constructor!==Object?s.constructor.name:""} {}`.trim():s.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'"))if(r.includes('"')){if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}else return`"${r}"`;return`'${r}'`;case"number":return isNaN(r)?"NaN":Object.is(r,-0)?String(r):r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}}}),Fr}var Ur,Hn;function Me(){if(Hn)return Ur;Hn=1;const{format:r,inspect:e}=Qi(),{AggregateError:t}=Te(),n=globalThis.AggregateError||t,s=Symbol("kIsNodeError"),f=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o=/^([A-Z][a-z0-9]*)+$/,p="__node_internal_",I={};function A(E,P){if(!E)throw new I.ERR_INTERNAL_ASSERTION(P)}function D(E){let P="",_=E.length;const R=E[0]==="-"?1:0;for(;_>=R+4;_-=3)P=`_${E.slice(_-3,_)}${P}`;return`${E.slice(0,_)}${P}`}function F(E,P,_){if(typeof P=="function")return A(P.length<=_.length,`Code: ${E}; The provided arguments length (${_.length}) does not match the required ones (${P.length}).`),P(..._);const R=(P.match(/%[dfijoOs]/g)||[]).length;return A(R===_.length,`Code: ${E}; The provided arguments length (${_.length}) does not match the required ones (${R}).`),_.length===0?P:r(P,..._)}function m(E,P,_){_||(_=Error);class R extends _{constructor(...J){super(F(E,P,J))}toString(){return`${this.name} [${E}]: ${this.message}`}}Object.defineProperties(R.prototype,{name:{value:_.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${E}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),R.prototype.code=E,R.prototype[s]=!0,I[E]=R}function B(E){const P=p+E.name;return Object.defineProperty(E,"name",{value:P}),E}function q(E,P){if(E&&P&&E!==P){if(Array.isArray(P.errors))return P.errors.push(E),P;const _=new n([P,E],P.message);return _.code=P.code,_}return E||P}class O extends Error{constructor(P="The operation was aborted",_=void 0){if(_!==void 0&&typeof _!="object")throw new I.ERR_INVALID_ARG_TYPE("options","Object",_);super(P,_),this.code="ABORT_ERR",this.name="AbortError"}}return m("ERR_ASSERTION","%s",Error),m("ERR_INVALID_ARG_TYPE",(E,P,_)=>{A(typeof E=="string","'name' must be a string"),Array.isArray(P)||(P=[P]);let R="The ";E.endsWith(" argument")?R+=`${E} `:R+=`"${E}" ${E.includes(".")?"property":"argument"} `,R+="must be ";const te=[],J=[],ae=[];for(const i of P)A(typeof i=="string","All expected entries have to be of type string"),f.includes(i)?te.push(i.toLowerCase()):o.test(i)?J.push(i):(A(i!=="object",'The value "object" should be written as "Object"'),ae.push(i));if(J.length>0){const i=te.indexOf("object");i!==-1&&(te.splice(te,i,1),J.push("Object"))}if(te.length>0){switch(te.length){case 1:R+=`of type ${te[0]}`;break;case 2:R+=`one of type ${te[0]} or ${te[1]}`;break;default:{const i=te.pop();R+=`one of type ${te.join(", ")}, or ${i}`}}(J.length>0||ae.length>0)&&(R+=" or ")}if(J.length>0){switch(J.length){case 1:R+=`an instance of ${J[0]}`;break;case 2:R+=`an instance of ${J[0]} or ${J[1]}`;break;default:{const i=J.pop();R+=`an instance of ${J.join(", ")}, or ${i}`}}ae.length>0&&(R+=" or ")}switch(ae.length){case 0:break;case 1:ae[0].toLowerCase()!==ae[0]&&(R+="an "),R+=`${ae[0]}`;break;case 2:R+=`one of ${ae[0]} or ${ae[1]}`;break;default:{const i=ae.pop();R+=`one of ${ae.join(", ")}, or ${i}`}}if(_==null)R+=`. Received ${_}`;else if(typeof _=="function"&&_.name)R+=`. Received function ${_.name}`;else if(typeof _=="object"){var he;if((he=_.constructor)!==null&&he!==void 0&&he.name)R+=`. Received an instance of ${_.constructor.name}`;else{const i=e(_,{depth:-1});R+=`. Received ${i}`}}else{let i=e(_,{colors:!1});i.length>25&&(i=`${i.slice(0,25)}...`),R+=`. Received type ${typeof _} (${i})`}return R},TypeError),m("ERR_INVALID_ARG_VALUE",(E,P,_="is invalid")=>{let R=e(P);return R.length>128&&(R=R.slice(0,128)+"..."),`The ${E.includes(".")?"property":"argument"} '${E}' ${_}. Received ${R}`},TypeError),m("ERR_INVALID_RETURN_VALUE",(E,P,_)=>{var R;const te=_!=null&&(R=_.constructor)!==null&&R!==void 0&&R.name?`instance of ${_.constructor.name}`:`type ${typeof _}`;return`Expected ${E} to be returned from the "${P}" function but got ${te}.`},TypeError),m("ERR_MISSING_ARGS",(...E)=>{A(E.length>0,"At least one arg needs to be specified");let P;const _=E.length;switch(E=(Array.isArray(E)?E:[E]).map(R=>`"${R}"`).join(" or "),_){case 1:P+=`The ${E[0]} argument`;break;case 2:P+=`The ${E[0]} and ${E[1]} arguments`;break;default:{const R=E.pop();P+=`The ${E.join(", ")}, and ${R} arguments`}break}return`${P} must be specified`},TypeError),m("ERR_OUT_OF_RANGE",(E,P,_)=>{A(P,'Missing "range" argument');let R;if(Number.isInteger(_)&&Math.abs(_)>2**32)R=D(String(_));else if(typeof _=="bigint"){R=String(_);const te=BigInt(2)**BigInt(32);(_>te||_<-te)&&(R=D(R)),R+="n"}else R=e(_);return`The value of "${E}" is out of range. It must be ${P}. Received ${R}`},RangeError),m("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),m("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),m("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),m("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),m("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),m("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),m("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),m("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),m("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),m("ERR_STREAM_WRITE_AFTER_END","write after end",Error),m("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Ur={AbortError:O,aggregateTwoErrors:B(q),hideStackFrames:B,codes:I},Ur}var Pt={exports:{}},Gn;function jt(){if(Gn)return Pt.exports;Gn=1;const{AbortController:r,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return Pt.exports=r,Pt.exports.AbortSignal=e,Pt.exports.default=r,Pt.exports}var zn;function We(){return zn||(zn=1,function(r){const e=bt(),{format:t,inspect:n}=Qi(),{codes:{ERR_INVALID_ARG_TYPE:s}}=Me(),{kResistStopPropagation:f,AggregateError:o,SymbolDispose:p}=Te(),I=globalThis.AbortSignal||jt().AbortSignal,A=globalThis.AbortController||jt().AbortController,D=Object.getPrototypeOf(async function(){}).constructor,F=globalThis.Blob||e.Blob,m=typeof F<"u"?function(E){return E instanceof F}:function(E){return!1},B=(O,E)=>{if(O!==void 0&&(O===null||typeof O!="object"||!("aborted"in O)))throw new s(E,"AbortSignal",O)},q=(O,E)=>{if(typeof O!="function")throw new s(E,"Function",O)};r.exports={AggregateError:o,kEmptyObject:Object.freeze({}),once(O){let E=!1;return function(...P){E||(E=!0,O.apply(this,P))}},createDeferredPromise:function(){let O,E;return{promise:new Promise((_,R)=>{O=_,E=R}),resolve:O,reject:E}},promisify(O){return new Promise((E,P)=>{O((_,...R)=>_?P(_):E(...R))})},debuglog(){return function(){}},format:t,inspect:n,types:{isAsyncFunction(O){return O instanceof D},isArrayBufferView(O){return ArrayBuffer.isView(O)}},isBlob:m,deprecate(O,E){return O},addAbortListener:dr().addAbortListener||function(E,P){if(E===void 0)throw new s("signal","AbortSignal",E);B(E,"signal"),q(P,"listener");let _;return E.aborted?queueMicrotask(()=>P()):(E.addEventListener("abort",P,{__proto__:null,once:!0,[f]:!0}),_=()=>{E.removeEventListener("abort",P)}),{__proto__:null,[p](){var R;(R=_)===null||R===void 0||R()}}},AbortSignalAny:I.any||function(E){if(E.length===1)return E[0];const P=new A,_=()=>P.abort();return E.forEach(R=>{B(R,"signals"),R.addEventListener("abort",_,{once:!0})}),P.signal.addEventListener("abort",()=>{E.forEach(R=>R.removeEventListener("abort",_))},{once:!0}),P.signal}},r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}(Wr)),Wr.exports}var Zt={},Br,Kn;function Wt(){if(Kn)return Br;Kn=1;const{ArrayIsArray:r,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:n,NumberIsInteger:s,NumberIsNaN:f,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:p,NumberParseInt:I,ObjectPrototypeHasOwnProperty:A,RegExpPrototypeExec:D,String:F,StringPrototypeToUpperCase:m,StringPrototypeTrim:B}=Te(),{hideStackFrames:q,codes:{ERR_SOCKET_BAD_PORT:O,ERR_INVALID_ARG_TYPE:E,ERR_INVALID_ARG_VALUE:P,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:R}}=Me(),{normalizeEncoding:te}=We(),{isAsyncFunction:J,isArrayBufferView:ae}=We().types,he={};function i(C){return C===(C|0)}function d(C){return C===C>>>0}const a=/^[0-7]+$/,u="must be a 32-bit unsigned integer or an octal string";function c(C,K,X){if(typeof C>"u"&&(C=X),typeof C=="string"){if(D(a,C)===null)throw new P(K,C,u);C=I(C,8)}return y(C,K),C}const l=q((C,K,X=p,G=o)=>{if(typeof C!="number")throw new E(K,"number",C);if(!s(C))throw new _(K,"an integer",C);if(C<X||C>G)throw new _(K,`>= ${X} && <= ${G}`,C)}),T=q((C,K,X=-2147483648,G=2147483647)=>{if(typeof C!="number")throw new E(K,"number",C);if(!s(C))throw new _(K,"an integer",C);if(C<X||C>G)throw new _(K,`>= ${X} && <= ${G}`,C)}),y=q((C,K,X=!1)=>{if(typeof C!="number")throw new E(K,"number",C);if(!s(C))throw new _(K,"an integer",C);const G=X?1:0,be=4294967295;if(C<G||C>be)throw new _(K,`>= ${G} && <= ${be}`,C)});function v(C,K){if(typeof C!="string")throw new E(K,"string",C)}function M(C,K,X=void 0,G){if(typeof C!="number")throw new E(K,"number",C);if(X!=null&&C<X||G!=null&&C>G||(X!=null||G!=null)&&f(C))throw new _(K,`${X!=null?`>= ${X}`:""}${X!=null&&G!=null?" && ":""}${G!=null?`<= ${G}`:""}`,C)}const b=q((C,K,X)=>{if(!e(X,C)){const be="must be one of: "+t(n(X,Ne=>typeof Ne=="string"?`'${Ne}'`:F(Ne)),", ");throw new P(K,C,be)}});function k(C,K){if(typeof C!="boolean")throw new E(K,"boolean",C)}function g(C,K,X){return C==null||!A(C,K)?X:C[K]}const W=q((C,K,X=null)=>{const G=g(X,"allowArray",!1),be=g(X,"allowFunction",!1);if(!g(X,"nullable",!1)&&C===null||!G&&r(C)||typeof C!="object"&&(!be||typeof C!="function"))throw new E(K,"Object",C)}),V=q((C,K)=>{if(C!=null&&typeof C!="object"&&typeof C!="function")throw new E(K,"a dictionary",C)}),j=q((C,K,X=0)=>{if(!r(C))throw new E(K,"Array",C);if(C.length<X){const G=`must be longer than ${X}`;throw new P(K,C,G)}});function re(C,K){j(C,K);for(let X=0;X<C.length;X++)v(C[X],`${K}[${X}]`)}function Q(C,K){j(C,K);for(let X=0;X<C.length;X++)k(C[X],`${K}[${X}]`)}function se(C,K){j(C,K);for(let X=0;X<C.length;X++){const G=C[X],be=`${K}[${X}]`;if(G==null)throw new E(be,"AbortSignal",G);ue(G,be)}}function le(C,K="signal"){if(v(C,K),he[C]===void 0)throw he[m(C)]!==void 0?new R(C+" (signals must use all capital letters)"):new R(C)}const H=q((C,K="buffer")=>{if(!ae(C))throw new E(K,["Buffer","TypedArray","DataView"],C)});function z(C,K){const X=te(K),G=C.length;if(X==="hex"&&G%2!==0)throw new P("encoding",K,`is invalid for data of length ${G}`)}function oe(C,K="Port",X=!0){if(typeof C!="number"&&typeof C!="string"||typeof C=="string"&&B(C).length===0||+C!==+C>>>0||C>65535||C===0&&!X)throw new O(K,C,X);return C|0}const ue=q((C,K)=>{if(C!==void 0&&(C===null||typeof C!="object"||!("aborted"in C)))throw new E(K,"AbortSignal",C)}),ce=q((C,K)=>{if(typeof C!="function")throw new E(K,"Function",C)}),N=q((C,K)=>{if(typeof C!="function"||J(C))throw new E(K,"Function",C)}),L=q((C,K)=>{if(C!==void 0)throw new E(K,"undefined",C)});function U(C,K,X){if(!e(X,C))throw new E(K,`('${t(X,"|")}')`,C)}const ne=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ee(C,K){if(typeof C>"u"||!D(ne,C))throw new P(K,C,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Z(C){if(typeof C=="string")return ee(C,"hints"),C;if(r(C)){const K=C.length;let X="";if(K===0)return X;for(let G=0;G<K;G++){const be=C[G];ee(be,"hints"),X+=be,G!==K-1&&(X+=", ")}return X}throw new P("hints",C,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return Br={isInt32:i,isUint32:d,parseFileMode:c,validateArray:j,validateStringArray:re,validateBooleanArray:Q,validateAbortSignalArray:se,validateBoolean:k,validateBuffer:H,validateDictionary:V,validateEncoding:z,validateFunction:ce,validateInt32:T,validateInteger:l,validateNumber:M,validateObject:W,validateOneOf:b,validatePlainFunction:N,validatePort:oe,validateSignalName:le,validateString:v,validateUint32:y,validateUndefined:L,validateUnion:U,validateAbortSignal:ue,validateLinkHeaderValue:Z},Br}var er={exports:{}},qr={exports:{}},Vn;function wt(){if(Vn)return qr.exports;Vn=1;var r=qr.exports={},e,t;function n(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=n}catch{e=n}try{typeof clearTimeout=="function"?t=clearTimeout:t=s}catch{t=s}})();function f(O){if(e===setTimeout)return setTimeout(O,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(O,0);try{return e(O,0)}catch{try{return e.call(null,O,0)}catch{return e.call(this,O,0)}}}function o(O){if(t===clearTimeout)return clearTimeout(O);if((t===s||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(O);try{return t(O)}catch{try{return t.call(null,O)}catch{return t.call(this,O)}}}var p=[],I=!1,A,D=-1;function F(){!I||!A||(I=!1,A.length?p=A.concat(p):D=-1,p.length&&m())}function m(){if(!I){var O=f(F);I=!0;for(var E=p.length;E;){for(A=p,p=[];++D<E;)A&&A[D].run();D=-1,E=p.length}A=null,I=!1,o(O)}}r.nextTick=function(O){var E=new Array(arguments.length-1);if(arguments.length>1)for(var P=1;P<arguments.length;P++)E[P-1]=arguments[P];p.push(new B(O,E)),p.length===1&&!I&&f(m)};function B(O,E){this.fun=O,this.array=E}B.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function q(){}return r.on=q,r.addListener=q,r.once=q,r.off=q,r.removeListener=q,r.removeAllListeners=q,r.emit=q,r.prependListener=q,r.prependOnceListener=q,r.listeners=function(O){return[]},r.binding=function(O){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(O){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},qr.exports}var $r,Jn;function nt(){if(Jn)return $r;Jn=1;const{SymbolAsyncIterator:r,SymbolIterator:e,SymbolFor:t}=Te(),n=t("nodejs.stream.destroyed"),s=t("nodejs.stream.errored"),f=t("nodejs.stream.readable"),o=t("nodejs.stream.writable"),p=t("nodejs.stream.disturbed"),I=t("nodejs.webstream.isClosedPromise"),A=t("nodejs.webstream.controllerErrorFunction");function D(g,W=!1){var V;return!!(g&&typeof g.pipe=="function"&&typeof g.on=="function"&&(!W||typeof g.pause=="function"&&typeof g.resume=="function")&&(!g._writableState||((V=g._readableState)===null||V===void 0?void 0:V.readable)!==!1)&&(!g._writableState||g._readableState))}function F(g){var W;return!!(g&&typeof g.write=="function"&&typeof g.on=="function"&&(!g._readableState||((W=g._writableState)===null||W===void 0?void 0:W.writable)!==!1))}function m(g){return!!(g&&typeof g.pipe=="function"&&g._readableState&&typeof g.on=="function"&&typeof g.write=="function")}function B(g){return g&&(g._readableState||g._writableState||typeof g.write=="function"&&typeof g.on=="function"||typeof g.pipe=="function"&&typeof g.on=="function")}function q(g){return!!(g&&!B(g)&&typeof g.pipeThrough=="function"&&typeof g.getReader=="function"&&typeof g.cancel=="function")}function O(g){return!!(g&&!B(g)&&typeof g.getWriter=="function"&&typeof g.abort=="function")}function E(g){return!!(g&&!B(g)&&typeof g.readable=="object"&&typeof g.writable=="object")}function P(g){return q(g)||O(g)||E(g)}function _(g,W){return g==null?!1:W===!0?typeof g[r]=="function":W===!1?typeof g[e]=="function":typeof g[r]=="function"||typeof g[e]=="function"}function R(g){if(!B(g))return null;const W=g._writableState,V=g._readableState,j=W||V;return!!(g.destroyed||g[n]||j!=null&&j.destroyed)}function te(g){if(!F(g))return null;if(g.writableEnded===!0)return!0;const W=g._writableState;return W!=null&&W.errored?!1:typeof W?.ended!="boolean"?null:W.ended}function J(g,W){if(!F(g))return null;if(g.writableFinished===!0)return!0;const V=g._writableState;return V!=null&&V.errored?!1:typeof V?.finished!="boolean"?null:!!(V.finished||W===!1&&V.ended===!0&&V.length===0)}function ae(g){if(!D(g))return null;if(g.readableEnded===!0)return!0;const W=g._readableState;return!W||W.errored?!1:typeof W?.ended!="boolean"?null:W.ended}function he(g,W){if(!D(g))return null;const V=g._readableState;return V!=null&&V.errored?!1:typeof V?.endEmitted!="boolean"?null:!!(V.endEmitted||W===!1&&V.ended===!0&&V.length===0)}function i(g){return g&&g[f]!=null?g[f]:typeof g?.readable!="boolean"?null:R(g)?!1:D(g)&&g.readable&&!he(g)}function d(g){return g&&g[o]!=null?g[o]:typeof g?.writable!="boolean"?null:R(g)?!1:F(g)&&g.writable&&!te(g)}function a(g,W){return B(g)?R(g)?!0:!(W?.readable!==!1&&i(g)||W?.writable!==!1&&d(g)):null}function u(g){var W,V;return B(g)?g.writableErrored?g.writableErrored:(W=(V=g._writableState)===null||V===void 0?void 0:V.errored)!==null&&W!==void 0?W:null:null}function c(g){var W,V;return B(g)?g.readableErrored?g.readableErrored:(W=(V=g._readableState)===null||V===void 0?void 0:V.errored)!==null&&W!==void 0?W:null:null}function l(g){if(!B(g))return null;if(typeof g.closed=="boolean")return g.closed;const W=g._writableState,V=g._readableState;return typeof W?.closed=="boolean"||typeof V?.closed=="boolean"?W?.closed||V?.closed:typeof g._closed=="boolean"&&T(g)?g._closed:null}function T(g){return typeof g._closed=="boolean"&&typeof g._defaultKeepAlive=="boolean"&&typeof g._removedConnection=="boolean"&&typeof g._removedContLen=="boolean"}function y(g){return typeof g._sent100=="boolean"&&T(g)}function v(g){var W;return typeof g._consuming=="boolean"&&typeof g._dumped=="boolean"&&((W=g.req)===null||W===void 0?void 0:W.upgradeOrConnect)===void 0}function M(g){if(!B(g))return null;const W=g._writableState,V=g._readableState,j=W||V;return!j&&y(g)||!!(j&&j.autoDestroy&&j.emitClose&&j.closed===!1)}function b(g){var W;return!!(g&&((W=g[p])!==null&&W!==void 0?W:g.readableDidRead||g.readableAborted))}function k(g){var W,V,j,re,Q,se,le,H,z,oe;return!!(g&&((W=(V=(j=(re=(Q=(se=g[s])!==null&&se!==void 0?se:g.readableErrored)!==null&&Q!==void 0?Q:g.writableErrored)!==null&&re!==void 0?re:(le=g._readableState)===null||le===void 0?void 0:le.errorEmitted)!==null&&j!==void 0?j:(H=g._writableState)===null||H===void 0?void 0:H.errorEmitted)!==null&&V!==void 0?V:(z=g._readableState)===null||z===void 0?void 0:z.errored)!==null&&W!==void 0?W:!((oe=g._writableState)===null||oe===void 0)&&oe.errored))}return $r={isDestroyed:R,kIsDestroyed:n,isDisturbed:b,kIsDisturbed:p,isErrored:k,kIsErrored:s,isReadable:i,kIsReadable:f,kIsClosedPromise:I,kControllerErrorFunction:A,kIsWritable:o,isClosed:l,isDuplexNodeStream:m,isFinished:a,isIterable:_,isReadableNodeStream:D,isReadableStream:q,isReadableEnded:ae,isReadableFinished:he,isReadableErrored:c,isNodeStream:B,isWebStream:P,isWritable:d,isWritableNodeStream:F,isWritableStream:O,isWritableEnded:te,isWritableFinished:J,isWritableErrored:u,isServerRequest:v,isServerResponse:y,willEmitClose:M,isTransformStream:E},$r}var Yn;function lt(){if(Yn)return er.exports;Yn=1;const r=wt(),{AbortError:e,codes:t}=Me(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:s}=t,{kEmptyObject:f,once:o}=We(),{validateAbortSignal:p,validateFunction:I,validateObject:A,validateBoolean:D}=Wt(),{Promise:F,PromisePrototypeThen:m,SymbolDispose:B}=Te(),{isClosed:q,isReadable:O,isReadableNodeStream:E,isReadableStream:P,isReadableFinished:_,isReadableErrored:R,isWritable:te,isWritableNodeStream:J,isWritableStream:ae,isWritableFinished:he,isWritableErrored:i,isNodeStream:d,willEmitClose:a,kIsClosedPromise:u}=nt();let c;function l(b){return b.setHeader&&typeof b.abort=="function"}const T=()=>{};function y(b,k,g){var W,V;if(arguments.length===2?(g=k,k=f):k==null?k=f:A(k,"options"),I(g,"callback"),p(k.signal,"options.signal"),g=o(g),P(b)||ae(b))return v(b,k,g);if(!d(b))throw new n("stream",["ReadableStream","WritableStream","Stream"],b);const j=(W=k.readable)!==null&&W!==void 0?W:E(b),re=(V=k.writable)!==null&&V!==void 0?V:J(b),Q=b._writableState,se=b._readableState,le=()=>{b.writable||oe()};let H=a(b)&&E(b)===j&&J(b)===re,z=he(b,!1);const oe=()=>{z=!0,b.destroyed&&(H=!1),!(H&&(!b.readable||j))&&(!j||ue)&&g.call(b)};let ue=_(b,!1);const ce=()=>{ue=!0,b.destroyed&&(H=!1),!(H&&(!b.writable||re))&&(!re||z)&&g.call(b)},N=C=>{g.call(b,C)};let L=q(b);const U=()=>{L=!0;const C=i(b)||R(b);if(C&&typeof C!="boolean")return g.call(b,C);if(j&&!ue&&E(b,!0)&&!_(b,!1))return g.call(b,new s);if(re&&!z&&!he(b,!1))return g.call(b,new s);g.call(b)},ne=()=>{L=!0;const C=i(b)||R(b);if(C&&typeof C!="boolean")return g.call(b,C);g.call(b)},ee=()=>{b.req.on("finish",oe)};l(b)?(b.on("complete",oe),H||b.on("abort",U),b.req?ee():b.on("request",ee)):re&&!Q&&(b.on("end",le),b.on("close",le)),!H&&typeof b.aborted=="boolean"&&b.on("aborted",U),b.on("end",ce),b.on("finish",oe),k.error!==!1&&b.on("error",N),b.on("close",U),L?r.nextTick(U):Q!=null&&Q.errorEmitted||se!=null&&se.errorEmitted?H||r.nextTick(ne):(!j&&(!H||O(b))&&(z||te(b)===!1)||!re&&(!H||te(b))&&(ue||O(b)===!1)||se&&b.req&&b.aborted)&&r.nextTick(ne);const Z=()=>{g=T,b.removeListener("aborted",U),b.removeListener("complete",oe),b.removeListener("abort",U),b.removeListener("request",ee),b.req&&b.req.removeListener("finish",oe),b.removeListener("end",le),b.removeListener("close",le),b.removeListener("finish",oe),b.removeListener("end",ce),b.removeListener("error",N),b.removeListener("close",U)};if(k.signal&&!L){const C=()=>{const K=g;Z(),K.call(b,new e(void 0,{cause:k.signal.reason}))};if(k.signal.aborted)r.nextTick(C);else{c=c||We().addAbortListener;const K=c(k.signal,C),X=g;g=o((...G)=>{K[B](),X.apply(b,G)})}}return Z}function v(b,k,g){let W=!1,V=T;if(k.signal)if(V=()=>{W=!0,g.call(b,new e(void 0,{cause:k.signal.reason}))},k.signal.aborted)r.nextTick(V);else{c=c||We().addAbortListener;const re=c(k.signal,V),Q=g;g=o((...se)=>{re[B](),Q.apply(b,se)})}const j=(...re)=>{W||r.nextTick(()=>g.apply(b,re))};return m(b[u].promise,j,j),T}function M(b,k){var g;let W=!1;return k===null&&(k=f),(g=k)!==null&&g!==void 0&&g.cleanup&&(D(k.cleanup,"cleanup"),W=k.cleanup),new F((V,j)=>{const re=y(b,k,Q=>{W&&re(),Q?j(Q):V()})})}return er.exports=y,er.exports.finished=M,er.exports}var Hr,Xn;function St(){if(Xn)return Hr;Xn=1;const r=wt(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:n}=Me(),{Symbol:s}=Te(),{kIsDestroyed:f,isDestroyed:o,isFinished:p,isServerRequest:I}=nt(),A=s("kDestroy"),D=s("kConstruct");function F(a,u,c){a&&(a.stack,u&&!u.errored&&(u.errored=a),c&&!c.errored&&(c.errored=a))}function m(a,u){const c=this._readableState,l=this._writableState,T=l||c;return l!=null&&l.destroyed||c!=null&&c.destroyed?(typeof u=="function"&&u(),this):(F(a,l,c),l&&(l.destroyed=!0),c&&(c.destroyed=!0),T.constructed?B(this,a,u):this.once(A,function(y){B(this,e(y,a),u)}),this)}function B(a,u,c){let l=!1;function T(y){if(l)return;l=!0;const v=a._readableState,M=a._writableState;F(y,M,v),M&&(M.closed=!0),v&&(v.closed=!0),typeof c=="function"&&c(y),y?r.nextTick(q,a,y):r.nextTick(O,a)}try{a._destroy(u||null,T)}catch(y){T(y)}}function q(a,u){E(a,u),O(a)}function O(a){const u=a._readableState,c=a._writableState;c&&(c.closeEmitted=!0),u&&(u.closeEmitted=!0),(c!=null&&c.emitClose||u!=null&&u.emitClose)&&a.emit("close")}function E(a,u){const c=a._readableState,l=a._writableState;l!=null&&l.errorEmitted||c!=null&&c.errorEmitted||(l&&(l.errorEmitted=!0),c&&(c.errorEmitted=!0),a.emit("error",u))}function P(){const a=this._readableState,u=this._writableState;a&&(a.constructed=!0,a.closed=!1,a.closeEmitted=!1,a.destroyed=!1,a.errored=null,a.errorEmitted=!1,a.reading=!1,a.ended=a.readable===!1,a.endEmitted=a.readable===!1),u&&(u.constructed=!0,u.destroyed=!1,u.closed=!1,u.closeEmitted=!1,u.errored=null,u.errorEmitted=!1,u.finalCalled=!1,u.prefinished=!1,u.ended=u.writable===!1,u.ending=u.writable===!1,u.finished=u.writable===!1)}function _(a,u,c){const l=a._readableState,T=a._writableState;if(T!=null&&T.destroyed||l!=null&&l.destroyed)return this;l!=null&&l.autoDestroy||T!=null&&T.autoDestroy?a.destroy(u):u&&(u.stack,T&&!T.errored&&(T.errored=u),l&&!l.errored&&(l.errored=u),c?r.nextTick(E,a,u):E(a,u))}function R(a,u){if(typeof a._construct!="function")return;const c=a._readableState,l=a._writableState;c&&(c.constructed=!1),l&&(l.constructed=!1),a.once(D,u),!(a.listenerCount(D)>1)&&r.nextTick(te,a)}function te(a){let u=!1;function c(l){if(u){_(a,l??new t);return}u=!0;const T=a._readableState,y=a._writableState,v=y||T;T&&(T.constructed=!0),y&&(y.constructed=!0),v.destroyed?a.emit(A,l):l?_(a,l,!0):r.nextTick(J,a)}try{a._construct(l=>{r.nextTick(c,l)})}catch(l){r.nextTick(c,l)}}function J(a){a.emit(D)}function ae(a){return a?.setHeader&&typeof a.abort=="function"}function he(a){a.emit("close")}function i(a,u){a.emit("error",u),r.nextTick(he,a)}function d(a,u){!a||o(a)||(!u&&!p(a)&&(u=new n),I(a)?(a.socket=null,a.destroy(u)):ae(a)?a.abort():ae(a.req)?a.req.abort():typeof a.destroy=="function"?a.destroy(u):typeof a.close=="function"?a.close():u?r.nextTick(i,a,u):r.nextTick(he,a),a.destroyed||(a[f]=!0))}return Hr={construct:R,destroyer:d,destroy:m,undestroy:P,errorOrDestroy:_},Hr}var Gr,Qn;function vn(){if(Qn)return Gr;Qn=1;const{ArrayIsArray:r,ObjectSetPrototypeOf:e}=Te(),{EventEmitter:t}=dr();function n(f){t.call(this,f)}e(n.prototype,t.prototype),e(n,t),n.prototype.pipe=function(f,o){const p=this;function I(O){f.writable&&f.write(O)===!1&&p.pause&&p.pause()}p.on("data",I);function A(){p.readable&&p.resume&&p.resume()}f.on("drain",A),!f._isStdio&&(!o||o.end!==!1)&&(p.on("end",F),p.on("close",m));let D=!1;function F(){D||(D=!0,f.end())}function m(){D||(D=!0,typeof f.destroy=="function"&&f.destroy())}function B(O){q(),t.listenerCount(this,"error")===0&&this.emit("error",O)}s(p,"error",B),s(f,"error",B);function q(){p.removeListener("data",I),f.removeListener("drain",A),p.removeListener("end",F),p.removeListener("close",m),p.removeListener("error",B),f.removeListener("error",B),p.removeListener("end",q),p.removeListener("close",q),f.removeListener("close",q)}return p.on("end",q),p.on("close",q),f.on("close",q),f.emit("pipe",p),f};function s(f,o,p){if(typeof f.prependListener=="function")return f.prependListener(o,p);!f._events||!f._events[o]?f.on(o,p):r(f._events[o])?f._events[o].unshift(p):f._events[o]=[p,f._events[o]]}return Gr={Stream:n,prependListener:s},Gr}var zr={exports:{}},Zn;function hr(){return Zn||(Zn=1,function(r){const{SymbolDispose:e}=Te(),{AbortError:t,codes:n}=Me(),{isNodeStream:s,isWebStream:f,kControllerErrorFunction:o}=nt(),p=lt(),{ERR_INVALID_ARG_TYPE:I}=n;let A;const D=(F,m)=>{if(typeof F!="object"||!("aborted"in F))throw new I(m,"AbortSignal",F)};r.exports.addAbortSignal=function(m,B){if(D(m,"signal"),!s(B)&&!f(B))throw new I("stream",["ReadableStream","WritableStream","Stream"],B);return r.exports.addAbortSignalNoValidate(m,B)},r.exports.addAbortSignalNoValidate=function(F,m){if(typeof F!="object"||!("aborted"in F))return m;const B=s(m)?()=>{m.destroy(new t(void 0,{cause:F.reason}))}:()=>{m[o](new t(void 0,{cause:F.reason}))};if(F.aborted)B();else{A=A||We().addAbortListener;const q=A(F,B);p(m,q[e])}return m}}(zr)),zr.exports}var Kr,ei;function ns(){if(ei)return Kr;ei=1;const{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:n}=Te(),{Buffer:s}=bt(),{inspect:f}=We();return Kr=class{constructor(){this.head=null,this.tail=null,this.length=0}push(p){const I={data:p,next:null};this.length>0?this.tail.next=I:this.head=I,this.tail=I,++this.length}unshift(p){const I={data:p,next:this.head};this.length===0&&(this.tail=I),this.head=I,++this.length}shift(){if(this.length===0)return;const p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}clear(){this.head=this.tail=null,this.length=0}join(p){if(this.length===0)return"";let I=this.head,A=""+I.data;for(;(I=I.next)!==null;)A+=p+I.data;return A}concat(p){if(this.length===0)return s.alloc(0);const I=s.allocUnsafe(p>>>0);let A=this.head,D=0;for(;A;)t(I,A.data,D),D+=A.data.length,A=A.next;return I}consume(p,I){const A=this.head.data;if(p<A.length){const D=A.slice(0,p);return this.head.data=A.slice(p),D}return p===A.length?this.shift():I?this._getString(p):this._getBuffer(p)}first(){return this.head.data}*[e](){for(let p=this.head;p;p=p.next)yield p.data}_getString(p){let I="",A=this.head,D=0;do{const F=A.data;if(p>F.length)I+=F,p-=F.length;else{p===F.length?(I+=F,++D,A.next?this.head=A.next:this.head=this.tail=null):(I+=r(F,0,p),this.head=A,A.data=r(F,p));break}++D}while((A=A.next)!==null);return this.length-=D,I}_getBuffer(p){const I=s.allocUnsafe(p),A=p;let D=this.head,F=0;do{const m=D.data;if(p>m.length)t(I,m,A-p),p-=m.length;else{p===m.length?(t(I,m,A-p),++F,D.next?this.head=D.next:this.head=this.tail=null):(t(I,new n(m.buffer,m.byteOffset,p),A-p),this.head=D,D.data=m.slice(p));break}++F}while((D=D.next)!==null);return this.length-=F,I}[Symbol.for("nodejs.util.inspect.custom")](p,I){return f(this,{...I,depth:0,customInspect:!1})}},Kr}var Vr,ti;function pr(){if(ti)return Vr;ti=1;const{MathFloor:r,NumberIsInteger:e}=Te(),{validateInteger:t}=Wt(),{ERR_INVALID_ARG_VALUE:n}=Me().codes;let s=16*1024,f=16;function o(D,F,m){return D.highWaterMark!=null?D.highWaterMark:F?D[m]:null}function p(D){return D?f:s}function I(D,F){t(F,"value",0),D?f=F:s=F}function A(D,F,m,B){const q=o(F,B,m);if(q!=null){if(!e(q)||q<0){const O=B?`options.${m}`:"options.highWaterMark";throw new n(O,q)}return r(q)}return p(D.objectMode)}return Vr={getHighWaterMark:A,getDefaultHighWaterMark:p,setDefaultHighWaterMark:I},Vr}var Jr,ri;function Zi(){if(ri)return Jr;ri=1;const r=wt(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:n}=Te(),{Buffer:s}=bt(),{ERR_INVALID_ARG_TYPE:f,ERR_STREAM_NULL_VALUES:o}=Me().codes;function p(I,A,D){let F;if(typeof A=="string"||A instanceof s)return new I({objectMode:!0,...D,read(){this.push(A),this.push(null)}});let m;if(A&&A[t])m=!0,F=A[t]();else if(A&&A[n])m=!1,F=A[n]();else throw new f("iterable",["Iterable"],A);const B=new I({objectMode:!0,highWaterMark:1,...D});let q=!1;B._read=function(){q||(q=!0,E())},B._destroy=function(P,_){e(O(P),()=>r.nextTick(_,P),R=>r.nextTick(_,R||P))};async function O(P){const _=P!=null,R=typeof F.throw=="function";if(_&&R){const{value:te,done:J}=await F.throw(P);if(await te,J)return}if(typeof F.return=="function"){const{value:te}=await F.return();await te}}async function E(){for(;;){try{const{value:P,done:_}=m?await F.next():F.next();if(_)B.push(null);else{const R=P&&typeof P.then=="function"?await P:P;if(R===null)throw q=!1,new o;if(B.push(R))continue;q=!1}}catch(P){B.destroy(P)}break}}return B}return Jr=p,Jr}var Yr,ni;function gr(){if(ni)return Yr;ni=1;const r=wt(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:n,NumberParseInt:s,ObjectDefineProperties:f,ObjectKeys:o,ObjectSetPrototypeOf:p,Promise:I,SafeSet:A,SymbolAsyncDispose:D,SymbolAsyncIterator:F,Symbol:m}=Te();Yr=G,G.ReadableState=X;const{EventEmitter:B}=dr(),{Stream:q,prependListener:O}=vn(),{Buffer:E}=bt(),{addAbortSignal:P}=hr(),_=lt();let R=We().debuglog("stream",h=>{R=h});const te=ns(),J=St(),{getHighWaterMark:ae,getDefaultHighWaterMark:he}=pr(),{aggregateTwoErrors:i,codes:{ERR_INVALID_ARG_TYPE:d,ERR_METHOD_NOT_IMPLEMENTED:a,ERR_OUT_OF_RANGE:u,ERR_STREAM_PUSH_AFTER_EOF:c,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:l},AbortError:T}=Me(),{validateObject:y}=Wt(),v=m("kPaused"),{StringDecoder:M}=es(),b=Zi();p(G.prototype,q.prototype),p(G,q);const k=()=>{},{errorOrDestroy:g}=J,W=1,V=2,j=4,re=8,Q=16,se=32,le=64,H=128,z=256,oe=512,ue=1024,ce=2048,N=4096,L=8192,U=16384,ne=32768,ee=65536,Z=1<<17,C=1<<18;function K(h){return{enumerable:!1,get(){return(this.state&h)!==0},set(S){S?this.state|=h:this.state&=~h}}}f(X.prototype,{objectMode:K(W),ended:K(V),endEmitted:K(j),reading:K(re),constructed:K(Q),sync:K(se),needReadable:K(le),emittedReadable:K(H),readableListening:K(z),resumeScheduled:K(oe),errorEmitted:K(ue),emitClose:K(ce),autoDestroy:K(N),destroyed:K(L),closed:K(U),closeEmitted:K(ne),multiAwaitDrain:K(ee),readingMore:K(Z),dataEmitted:K(C)});function X(h,S,Y){typeof Y!="boolean"&&(Y=S instanceof rt()),this.state=ce|N|Q|se,h&&h.objectMode&&(this.state|=W),Y&&h&&h.readableObjectMode&&(this.state|=W),this.highWaterMark=h?ae(this,h,"readableHighWaterMark",Y):he(!1),this.buffer=new te,this.length=0,this.pipes=[],this.flowing=null,this[v]=null,h&&h.emitClose===!1&&(this.state&=~ce),h&&h.autoDestroy===!1&&(this.state&=~N),this.errored=null,this.defaultEncoding=h&&h.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,h&&h.encoding&&(this.decoder=new M(h.encoding),this.encoding=h.encoding)}function G(h){if(!(this instanceof G))return new G(h);const S=this instanceof rt();this._readableState=new X(h,this,S),h&&(typeof h.read=="function"&&(this._read=h.read),typeof h.destroy=="function"&&(this._destroy=h.destroy),typeof h.construct=="function"&&(this._construct=h.construct),h.signal&&!S&&P(h.signal,this)),q.call(this,h),J.construct(this,()=>{this._readableState.needReadable&&Le(this,this._readableState)})}G.prototype.destroy=J.destroy,G.prototype._undestroy=J.undestroy,G.prototype._destroy=function(h,S){S(h)},G.prototype[B.captureRejectionSymbol]=function(h){this.destroy(h)},G.prototype[D]=function(){let h;return this.destroyed||(h=this.readableEnded?null:new T,this.destroy(h)),new I((S,Y)=>_(this,ie=>ie&&ie!==h?Y(ie):S(null)))},G.prototype.push=function(h,S){return be(this,h,S,!1)},G.prototype.unshift=function(h,S){return be(this,h,S,!0)};function be(h,S,Y,ie){R("readableAddChunk",S);const fe=h._readableState;let Oe;if((fe.state&W)===0&&(typeof S=="string"?(Y=Y||fe.defaultEncoding,fe.encoding!==Y&&(ie&&fe.encoding?S=E.from(S,Y).toString(fe.encoding):(S=E.from(S,Y),Y=""))):S instanceof E?Y="":q._isUint8Array(S)?(S=q._uint8ArrayToBuffer(S),Y=""):S!=null&&(Oe=new d("chunk",["string","Buffer","Uint8Array"],S))),Oe)g(h,Oe);else if(S===null)fe.state&=~re,Ce(h,fe);else if((fe.state&W)!==0||S&&S.length>0)if(ie)if((fe.state&j)!==0)g(h,new l);else{if(fe.destroyed||fe.errored)return!1;Ne(h,fe,S,!0)}else if(fe.ended)g(h,new c);else{if(fe.destroyed||fe.errored)return!1;fe.state&=~re,fe.decoder&&!Y?(S=fe.decoder.write(S),fe.objectMode||S.length!==0?Ne(h,fe,S,!1):Le(h,fe)):Ne(h,fe,S,!1)}else ie||(fe.state&=~re,Le(h,fe));return!fe.ended&&(fe.length<fe.highWaterMark||fe.length===0)}function Ne(h,S,Y,ie){S.flowing&&S.length===0&&!S.sync&&h.listenerCount("data")>0?((S.state&ee)!==0?S.awaitDrainWriters.clear():S.awaitDrainWriters=null,S.dataEmitted=!0,h.emit("data",Y)):(S.length+=S.objectMode?1:Y.length,ie?S.buffer.unshift(Y):S.buffer.push(Y),(S.state&le)!==0&&He(h)),Le(h,S)}G.prototype.isPaused=function(){const h=this._readableState;return h[v]===!0||h.flowing===!1},G.prototype.setEncoding=function(h){const S=new M(h);this._readableState.decoder=S,this._readableState.encoding=this._readableState.decoder.encoding;const Y=this._readableState.buffer;let ie="";for(const fe of Y)ie+=S.write(fe);return Y.clear(),ie!==""&&Y.push(ie),this._readableState.length=ie.length,this};const _e=1073741824;function xe(h){if(h>_e)throw new u("size","<= 1GiB",h);return h--,h|=h>>>1,h|=h>>>2,h|=h>>>4,h|=h>>>8,h|=h>>>16,h++,h}function Ie(h,S){return h<=0||S.length===0&&S.ended?0:(S.state&W)!==0?1:n(h)?S.flowing&&S.length?S.buffer.first().length:S.length:h<=S.length?h:S.ended?S.length:0}G.prototype.read=function(h){R("read",h),h===void 0?h=NaN:t(h)||(h=s(h,10));const S=this._readableState,Y=h;if(h>S.highWaterMark&&(S.highWaterMark=xe(h)),h!==0&&(S.state&=~H),h===0&&S.needReadable&&((S.highWaterMark!==0?S.length>=S.highWaterMark:S.length>0)||S.ended))return R("read: emitReadable",S.length,S.ended),S.length===0&&S.ended?vt(this):He(this),null;if(h=Ie(h,S),h===0&&S.ended)return S.length===0&&vt(this),null;let ie=(S.state&le)!==0;if(R("need readable",ie),(S.length===0||S.length-h<S.highWaterMark)&&(ie=!0,R("length less than watermark",ie)),S.ended||S.reading||S.destroyed||S.errored||!S.constructed)ie=!1,R("reading, ended or constructing",ie);else if(ie){R("do read"),S.state|=re|se,S.length===0&&(S.state|=le);try{this._read(S.highWaterMark)}catch(Oe){g(this,Oe)}S.state&=~se,S.reading||(h=Ie(Y,S))}let fe;return h>0?fe=it(h,S):fe=null,fe===null?(S.needReadable=S.length<=S.highWaterMark,h=0):(S.length-=h,S.multiAwaitDrain?S.awaitDrainWriters.clear():S.awaitDrainWriters=null),S.length===0&&(S.ended||(S.needReadable=!0),Y!==h&&S.ended&&vt(this)),fe!==null&&!S.errorEmitted&&!S.closeEmitted&&(S.dataEmitted=!0,this.emit("data",fe)),fe};function Ce(h,S){if(R("onEofChunk"),!S.ended){if(S.decoder){const Y=S.decoder.end();Y&&Y.length&&(S.buffer.push(Y),S.length+=S.objectMode?1:Y.length)}S.ended=!0,S.sync?He(h):(S.needReadable=!1,S.emittedReadable=!0,ut(h))}}function He(h){const S=h._readableState;R("emitReadable",S.needReadable,S.emittedReadable),S.needReadable=!1,S.emittedReadable||(R("emitReadable",S.flowing),S.emittedReadable=!0,r.nextTick(ut,h))}function ut(h){const S=h._readableState;R("emitReadable_",S.destroyed,S.length,S.ended),!S.destroyed&&!S.errored&&(S.length||S.ended)&&(h.emit("readable"),S.emittedReadable=!1),S.needReadable=!S.flowing&&!S.ended&&S.length<=S.highWaterMark,Et(h)}function Le(h,S){!S.readingMore&&S.constructed&&(S.readingMore=!0,r.nextTick(Ut,h,S))}function Ut(h,S){for(;!S.reading&&!S.ended&&(S.length<S.highWaterMark||S.flowing&&S.length===0);){const Y=S.length;if(R("maybeReadMore read 0"),h.read(0),Y===S.length)break}S.readingMore=!1}G.prototype._read=function(h){throw new a("_read()")},G.prototype.pipe=function(h,S){const Y=this,ie=this._readableState;ie.pipes.length===1&&(ie.multiAwaitDrain||(ie.multiAwaitDrain=!0,ie.awaitDrainWriters=new A(ie.awaitDrainWriters?[ie.awaitDrainWriters]:[]))),ie.pipes.push(h),R("pipe count=%d opts=%j",ie.pipes.length,S);const Oe=(!S||S.end!==!1)&&h!==r.stdout&&h!==r.stderr?Gt:ft;ie.endEmitted?r.nextTick(Oe):Y.once("end",Oe),h.on("unpipe",De);function De(Qe,Ge){R("onunpipe"),Qe===Y&&Ge&&Ge.hasUnpiped===!1&&(Ge.hasUnpiped=!0,Ar())}function Gt(){R("onend"),h.end()}let ke,zt=!1;function Ar(){R("cleanup"),h.removeListener("close",Ve),h.removeListener("finish",Tt),ke&&h.removeListener("drain",ke),h.removeListener("error",Rt),h.removeListener("unpipe",De),Y.removeListener("end",Gt),Y.removeListener("end",ft),Y.removeListener("data",Vt),zt=!0,ke&&ie.awaitDrainWriters&&(!h._writableState||h._writableState.needDrain)&&ke()}function Kt(){zt||(ie.pipes.length===1&&ie.pipes[0]===h?(R("false write response, pause",0),ie.awaitDrainWriters=h,ie.multiAwaitDrain=!1):ie.pipes.length>1&&ie.pipes.includes(h)&&(R("false write response, pause",ie.awaitDrainWriters.size),ie.awaitDrainWriters.add(h)),Y.pause()),ke||(ke=Sr(Y,h),h.on("drain",ke))}Y.on("data",Vt);function Vt(Qe){R("ondata");const Ge=h.write(Qe);R("dest.write",Ge),Ge===!1&&Kt()}function Rt(Qe){if(R("onerror",Qe),ft(),h.removeListener("error",Rt),h.listenerCount("error")===0){const Ge=h._writableState||h._readableState;Ge&&!Ge.errorEmitted?g(h,Qe):h.emit("error",Qe)}}O(h,"error",Rt);function Ve(){h.removeListener("finish",Tt),ft()}h.once("close",Ve);function Tt(){R("onfinish"),h.removeListener("close",Ve),ft()}h.once("finish",Tt);function ft(){R("unpipe"),Y.unpipe(h)}return h.emit("pipe",Y),h.writableNeedDrain===!0?Kt():ie.flowing||(R("pipe resume"),Y.resume()),h};function Sr(h,S){return function(){const ie=h._readableState;ie.awaitDrainWriters===S?(R("pipeOnDrain",1),ie.awaitDrainWriters=null):ie.multiAwaitDrain&&(R("pipeOnDrain",ie.awaitDrainWriters.size),ie.awaitDrainWriters.delete(S)),(!ie.awaitDrainWriters||ie.awaitDrainWriters.size===0)&&h.listenerCount("data")&&h.resume()}}G.prototype.unpipe=function(h){const S=this._readableState,Y={hasUnpiped:!1};if(S.pipes.length===0)return this;if(!h){const fe=S.pipes;S.pipes=[],this.pause();for(let Oe=0;Oe<fe.length;Oe++)fe[Oe].emit("unpipe",this,{hasUnpiped:!1});return this}const ie=e(S.pipes,h);return ie===-1?this:(S.pipes.splice(ie,1),S.pipes.length===0&&this.pause(),h.emit("unpipe",this,Y),this)},G.prototype.on=function(h,S){const Y=q.prototype.on.call(this,h,S),ie=this._readableState;return h==="data"?(ie.readableListening=this.listenerCount("readable")>0,ie.flowing!==!1&&this.resume()):h==="readable"&&!ie.endEmitted&&!ie.readableListening&&(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,R("on readable",ie.length,ie.reading),ie.length?He(this):ie.reading||r.nextTick(Ye,this)),Y},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(h,S){const Y=q.prototype.removeListener.call(this,h,S);return h==="readable"&&r.nextTick(Bt,this),Y},G.prototype.off=G.prototype.removeListener,G.prototype.removeAllListeners=function(h){const S=q.prototype.removeAllListeners.apply(this,arguments);return(h==="readable"||h===void 0)&&r.nextTick(Bt,this),S};function Bt(h){const S=h._readableState;S.readableListening=h.listenerCount("readable")>0,S.resumeScheduled&&S[v]===!1?S.flowing=!0:h.listenerCount("data")>0?h.resume():S.readableListening||(S.flowing=null)}function Ye(h){R("readable nexttick read 0"),h.read(0)}G.prototype.resume=function(){const h=this._readableState;return h.flowing||(R("resume"),h.flowing=!h.readableListening,_t(this,h)),h[v]=!1,this};function _t(h,S){S.resumeScheduled||(S.resumeScheduled=!0,r.nextTick(Er,h,S))}function Er(h,S){R("resume",S.reading),S.reading||h.read(0),S.resumeScheduled=!1,h.emit("resume"),Et(h),S.flowing&&!S.reading&&h.read(0)}G.prototype.pause=function(){return R("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(R("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[v]=!0,this};function Et(h){const S=h._readableState;for(R("flow",S.flowing);S.flowing&&h.read()!==null;);}G.prototype.wrap=function(h){let S=!1;h.on("data",ie=>{!this.push(ie)&&h.pause&&(S=!0,h.pause())}),h.on("end",()=>{this.push(null)}),h.on("error",ie=>{g(this,ie)}),h.on("close",()=>{this.destroy()}),h.on("destroy",()=>{this.destroy()}),this._read=()=>{S&&h.resume&&(S=!1,h.resume())};const Y=o(h);for(let ie=1;ie<Y.length;ie++){const fe=Y[ie];this[fe]===void 0&&typeof h[fe]=="function"&&(this[fe]=h[fe].bind(h))}return this},G.prototype[F]=function(){return qt(this)},G.prototype.iterator=function(h){return h!==void 0&&y(h,"options"),qt(this,h)};function qt(h,S){typeof h.read!="function"&&(h=G.wrap(h,{objectMode:!0}));const Y=$t(h,S);return Y.stream=h,Y}async function*$t(h,S){let Y=k;function ie(De){this===h?(Y(),Y=k):Y=De}h.on("readable",ie);let fe;const Oe=_(h,{writable:!1},De=>{fe=De?i(fe,De):null,Y(),Y=k});try{for(;;){const De=h.destroyed?null:h.read();if(De!==null)yield De;else{if(fe)throw fe;if(fe===null)return;await new I(ie)}}}catch(De){throw fe=i(fe,De),fe}finally{(fe||S?.destroyOnReturn!==!1)&&(fe===void 0||h._readableState.autoDestroy)?J.destroyer(h,null):(h.off("readable",ie),Oe())}}f(G.prototype,{readable:{__proto__:null,get(){const h=this._readableState;return!!h&&h.readable!==!1&&!h.destroyed&&!h.errorEmitted&&!h.endEmitted},set(h){this._readableState&&(this._readableState.readable=!!h)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(h){this._readableState&&(this._readableState.flowing=h)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(h){this._readableState&&(this._readableState.destroyed=h)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),f(X.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[v]!==!1},set(h){this[v]=!!h}}}),G._fromList=it;function it(h,S){if(S.length===0)return null;let Y;return S.objectMode?Y=S.buffer.shift():!h||h>=S.length?(S.decoder?Y=S.buffer.join(""):S.buffer.length===1?Y=S.buffer.first():Y=S.buffer.concat(S.length),S.buffer.clear()):Y=S.buffer.consume(h,S.decoder),Y}function vt(h){const S=h._readableState;R("endReadable",S.endEmitted),S.endEmitted||(S.ended=!0,r.nextTick(Xe,S,h))}function Xe(h,S){if(R("endReadableNT",h.endEmitted,h.length),!h.errored&&!h.closeEmitted&&!h.endEmitted&&h.length===0){if(h.endEmitted=!0,S.emit("end"),S.writable&&S.allowHalfOpen===!1)r.nextTick(vr,S);else if(h.autoDestroy){const Y=S._writableState;(!Y||Y.autoDestroy&&(Y.finished||Y.writable===!1))&&S.destroy()}}}function vr(h){h.writable&&!h.writableEnded&&!h.destroyed&&h.end()}G.from=function(h,S){return b(G,h,S)};let At;function Ht(){return At===void 0&&(At={}),At}return G.fromWeb=function(h,S){return Ht().newStreamReadableFromReadableStream(h,S)},G.toWeb=function(h,S){return Ht().newReadableStreamFromStreamReadable(h,S)},G.wrap=function(h,S){var Y,ie;return new G({objectMode:(Y=(ie=h.readableObjectMode)!==null&&ie!==void 0?ie:h.objectMode)!==null&&Y!==void 0?Y:!0,...S,destroy(fe,Oe){J.destroyer(h,fe),Oe(fe)}}).wrap(h)},Yr}var Xr,ii;function An(){if(ii)return Xr;ii=1;const r=wt(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:s,ObjectDefineProperties:f,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:p,Symbol:I,SymbolHasInstance:A}=Te();Xr=y,y.WritableState=l;const{EventEmitter:D}=dr(),F=vn().Stream,{Buffer:m}=bt(),B=St(),{addAbortSignal:q}=hr(),{getHighWaterMark:O,getDefaultHighWaterMark:E}=pr(),{ERR_INVALID_ARG_TYPE:P,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:R,ERR_STREAM_CANNOT_PIPE:te,ERR_STREAM_DESTROYED:J,ERR_STREAM_ALREADY_FINISHED:ae,ERR_STREAM_NULL_VALUES:he,ERR_STREAM_WRITE_AFTER_END:i,ERR_UNKNOWN_ENCODING:d}=Me().codes,{errorOrDestroy:a}=B;o(y.prototype,F.prototype),o(y,F);function u(){}const c=I("kOnFinished");function l(N,L,U){typeof U!="boolean"&&(U=L instanceof rt()),this.objectMode=!!(N&&N.objectMode),U&&(this.objectMode=this.objectMode||!!(N&&N.writableObjectMode)),this.highWaterMark=N?O(this,N,"writableHighWaterMark",U):E(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ne=!!(N&&N.decodeStrings===!1);this.decodeStrings=!ne,this.defaultEncoding=N&&N.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=g.bind(void 0,L),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,T(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!N||N.emitClose!==!1,this.autoDestroy=!N||N.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[c]=[]}function T(N){N.buffered=[],N.bufferedIndex=0,N.allBuffers=!0,N.allNoop=!0}l.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},s(l.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function y(N){const L=this instanceof rt();if(!L&&!n(y,this))return new y(N);this._writableState=new l(N,this,L),N&&(typeof N.write=="function"&&(this._write=N.write),typeof N.writev=="function"&&(this._writev=N.writev),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.final=="function"&&(this._final=N.final),typeof N.construct=="function"&&(this._construct=N.construct),N.signal&&q(N.signal,this)),F.call(this,N),B.construct(this,()=>{const U=this._writableState;U.writing||re(this,U),H(this,U)})}s(y,A,{__proto__:null,value:function(N){return n(this,N)?!0:this!==y?!1:N&&N._writableState instanceof l}}),y.prototype.pipe=function(){a(this,new te)};function v(N,L,U,ne){const ee=N._writableState;if(typeof U=="function")ne=U,U=ee.defaultEncoding;else{if(!U)U=ee.defaultEncoding;else if(U!=="buffer"&&!m.isEncoding(U))throw new d(U);typeof ne!="function"&&(ne=u)}if(L===null)throw new he;if(!ee.objectMode)if(typeof L=="string")ee.decodeStrings!==!1&&(L=m.from(L,U),U="buffer");else if(L instanceof m)U="buffer";else if(F._isUint8Array(L))L=F._uint8ArrayToBuffer(L),U="buffer";else throw new P("chunk",["string","Buffer","Uint8Array"],L);let Z;return ee.ending?Z=new i:ee.destroyed&&(Z=new J("write")),Z?(r.nextTick(ne,Z),a(N,Z,!0),Z):(ee.pendingcb++,M(N,ee,L,U,ne))}y.prototype.write=function(N,L,U){return v(this,N,L,U)===!0},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){const N=this._writableState;N.corked&&(N.corked--,N.writing||re(this,N))},y.prototype.setDefaultEncoding=function(L){if(typeof L=="string"&&(L=p(L)),!m.isEncoding(L))throw new d(L);return this._writableState.defaultEncoding=L,this};function M(N,L,U,ne,ee){const Z=L.objectMode?1:U.length;L.length+=Z;const C=L.length<L.highWaterMark;return C||(L.needDrain=!0),L.writing||L.corked||L.errored||!L.constructed?(L.buffered.push({chunk:U,encoding:ne,callback:ee}),L.allBuffers&&ne!=="buffer"&&(L.allBuffers=!1),L.allNoop&&ee!==u&&(L.allNoop=!1)):(L.writelen=Z,L.writecb=ee,L.writing=!0,L.sync=!0,N._write(U,ne,L.onwrite),L.sync=!1),C&&!L.errored&&!L.destroyed}function b(N,L,U,ne,ee,Z,C){L.writelen=ne,L.writecb=C,L.writing=!0,L.sync=!0,L.destroyed?L.onwrite(new J("write")):U?N._writev(ee,L.onwrite):N._write(ee,Z,L.onwrite),L.sync=!1}function k(N,L,U,ne){--L.pendingcb,ne(U),j(L),a(N,U)}function g(N,L){const U=N._writableState,ne=U.sync,ee=U.writecb;if(typeof ee!="function"){a(N,new R);return}U.writing=!1,U.writecb=null,U.length-=U.writelen,U.writelen=0,L?(L.stack,U.errored||(U.errored=L),N._readableState&&!N._readableState.errored&&(N._readableState.errored=L),ne?r.nextTick(k,N,U,L,ee):k(N,U,L,ee)):(U.buffered.length>U.bufferedIndex&&re(N,U),ne?U.afterWriteTickInfo!==null&&U.afterWriteTickInfo.cb===ee?U.afterWriteTickInfo.count++:(U.afterWriteTickInfo={count:1,cb:ee,stream:N,state:U},r.nextTick(W,U.afterWriteTickInfo)):V(N,U,1,ee))}function W({stream:N,state:L,count:U,cb:ne}){return L.afterWriteTickInfo=null,V(N,L,U,ne)}function V(N,L,U,ne){for(!L.ending&&!N.destroyed&&L.length===0&&L.needDrain&&(L.needDrain=!1,N.emit("drain"));U-- >0;)L.pendingcb--,ne();L.destroyed&&j(L),H(N,L)}function j(N){if(N.writing)return;for(let ee=N.bufferedIndex;ee<N.buffered.length;++ee){var L;const{chunk:Z,callback:C}=N.buffered[ee],K=N.objectMode?1:Z.length;N.length-=K,C((L=N.errored)!==null&&L!==void 0?L:new J("write"))}const U=N[c].splice(0);for(let ee=0;ee<U.length;ee++){var ne;U[ee]((ne=N.errored)!==null&&ne!==void 0?ne:new J("end"))}T(N)}function re(N,L){if(L.corked||L.bufferProcessing||L.destroyed||!L.constructed)return;const{buffered:U,bufferedIndex:ne,objectMode:ee}=L,Z=U.length-ne;if(!Z)return;let C=ne;if(L.bufferProcessing=!0,Z>1&&N._writev){L.pendingcb-=Z-1;const K=L.allNoop?u:G=>{for(let be=C;be<U.length;++be)U[be].callback(G)},X=L.allNoop&&C===0?U:e(U,C);X.allBuffers=L.allBuffers,b(N,L,!0,L.length,X,"",K),T(L)}else{do{const{chunk:K,encoding:X,callback:G}=U[C];U[C++]=null;const be=ee?1:K.length;b(N,L,!1,be,K,X,G)}while(C<U.length&&!L.writing);C===U.length?T(L):C>256?(U.splice(0,C),L.bufferedIndex=0):L.bufferedIndex=C}L.bufferProcessing=!1}y.prototype._write=function(N,L,U){if(this._writev)this._writev([{chunk:N,encoding:L}],U);else throw new _("_write()")},y.prototype._writev=null,y.prototype.end=function(N,L,U){const ne=this._writableState;typeof N=="function"?(U=N,N=null,L=null):typeof L=="function"&&(U=L,L=null);let ee;if(N!=null){const Z=v(this,N,L);Z instanceof t&&(ee=Z)}return ne.corked&&(ne.corked=1,this.uncork()),ee||(!ne.errored&&!ne.ending?(ne.ending=!0,H(this,ne,!0),ne.ended=!0):ne.finished?ee=new ae("end"):ne.destroyed&&(ee=new J("end"))),typeof U=="function"&&(ee||ne.finished?r.nextTick(U,ee):ne[c].push(U)),this};function Q(N){return N.ending&&!N.destroyed&&N.constructed&&N.length===0&&!N.errored&&N.buffered.length===0&&!N.finished&&!N.writing&&!N.errorEmitted&&!N.closeEmitted}function se(N,L){let U=!1;function ne(ee){if(U){a(N,ee??R());return}if(U=!0,L.pendingcb--,ee){const Z=L[c].splice(0);for(let C=0;C<Z.length;C++)Z[C](ee);a(N,ee,L.sync)}else Q(L)&&(L.prefinished=!0,N.emit("prefinish"),L.pendingcb++,r.nextTick(z,N,L))}L.sync=!0,L.pendingcb++;try{N._final(ne)}catch(ee){ne(ee)}L.sync=!1}function le(N,L){!L.prefinished&&!L.finalCalled&&(typeof N._final=="function"&&!L.destroyed?(L.finalCalled=!0,se(N,L)):(L.prefinished=!0,N.emit("prefinish")))}function H(N,L,U){Q(L)&&(le(N,L),L.pendingcb===0&&(U?(L.pendingcb++,r.nextTick((ne,ee)=>{Q(ee)?z(ne,ee):ee.pendingcb--},N,L)):Q(L)&&(L.pendingcb++,z(N,L))))}function z(N,L){L.pendingcb--,L.finished=!0;const U=L[c].splice(0);for(let ne=0;ne<U.length;ne++)U[ne]();if(N.emit("finish"),L.autoDestroy){const ne=N._readableState;(!ne||ne.autoDestroy&&(ne.endEmitted||ne.readable===!1))&&N.destroy()}}f(y.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(N){this._writableState&&(this._writableState.destroyed=N)}},writable:{__proto__:null,get(){const N=this._writableState;return!!N&&N.writable!==!1&&!N.destroyed&&!N.errored&&!N.ending&&!N.ended},set(N){this._writableState&&(this._writableState.writable=!!N)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const N=this._writableState;return N?!N.destroyed&&!N.ending&&N.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const oe=B.destroy;y.prototype.destroy=function(N,L){const U=this._writableState;return!U.destroyed&&(U.bufferedIndex<U.buffered.length||U[c].length)&&r.nextTick(j,U),oe.call(this,N,L),this},y.prototype._undestroy=B.undestroy,y.prototype._destroy=function(N,L){L(N)},y.prototype[D.captureRejectionSymbol]=function(N){this.destroy(N)};let ue;function ce(){return ue===void 0&&(ue={}),ue}return y.fromWeb=function(N,L){return ce().newStreamWritableFromWritableStream(N,L)},y.toWeb=function(N){return ce().newWritableStreamFromStreamWritable(N)},Xr}var Qr,oi;function is(){if(oi)return Qr;oi=1;const r=wt(),e=bt(),{isReadable:t,isWritable:n,isIterable:s,isNodeStream:f,isReadableNodeStream:o,isWritableNodeStream:p,isDuplexNodeStream:I,isReadableStream:A,isWritableStream:D}=nt(),F=lt(),{AbortError:m,codes:{ERR_INVALID_ARG_TYPE:B,ERR_INVALID_RETURN_VALUE:q}}=Me(),{destroyer:O}=St(),E=rt(),P=gr(),_=An(),{createDeferredPromise:R}=We(),te=Zi(),J=globalThis.Blob||e.Blob,ae=typeof J<"u"?function(l){return l instanceof J}:function(l){return!1},he=globalThis.AbortController||jt().AbortController,{FunctionPrototypeCall:i}=Te();class d extends E{constructor(l){super(l),l?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),l?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Qr=function c(l,T){if(I(l))return l;if(o(l))return u({readable:l});if(p(l))return u({writable:l});if(f(l))return u({writable:!1,readable:!1});if(A(l))return u({readable:P.fromWeb(l)});if(D(l))return u({writable:_.fromWeb(l)});if(typeof l=="function"){const{value:v,write:M,final:b,destroy:k}=a(l);if(s(v))return te(d,v,{objectMode:!0,write:M,final:b,destroy:k});const g=v?.then;if(typeof g=="function"){let W;const V=i(g,v,j=>{if(j!=null)throw new q("nully","body",j)},j=>{O(W,j)});return W=new d({objectMode:!0,readable:!1,write:M,final(j){b(async()=>{try{await V,r.nextTick(j,null)}catch(re){r.nextTick(j,re)}})},destroy:k})}throw new q("Iterable, AsyncIterable or AsyncFunction",T,v)}if(ae(l))return c(l.arrayBuffer());if(s(l))return te(d,l,{objectMode:!0,writable:!1});if(A(l?.readable)&&D(l?.writable))return d.fromWeb(l);if(typeof l?.writable=="object"||typeof l?.readable=="object"){const v=l!=null&&l.readable?o(l?.readable)?l?.readable:c(l.readable):void 0,M=l!=null&&l.writable?p(l?.writable)?l?.writable:c(l.writable):void 0;return u({readable:v,writable:M})}const y=l?.then;if(typeof y=="function"){let v;return i(y,l,M=>{M!=null&&v.push(M),v.push(null)},M=>{O(v,M)}),v=new d({objectMode:!0,writable:!1,read(){}})}throw new B(T,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],l)};function a(c){let{promise:l,resolve:T}=R();const y=new he,v=y.signal;return{value:c(async function*(){for(;;){const b=l;l=null;const{chunk:k,done:g,cb:W}=await b;if(r.nextTick(W),g)return;if(v.aborted)throw new m(void 0,{cause:v.reason});({promise:l,resolve:T}=R()),yield k}}(),{signal:v}),write(b,k,g){const W=T;T=null,W({chunk:b,done:!1,cb:g})},final(b){const k=T;T=null,k({done:!0,cb:b})},destroy(b,k){y.abort(),k(b)}}}function u(c){const l=c.readable&&typeof c.readable.read!="function"?P.wrap(c.readable):c.readable,T=c.writable;let y=!!t(l),v=!!n(T),M,b,k,g,W;function V(j){const re=g;g=null,re?re(j):j&&W.destroy(j)}return W=new d({readableObjectMode:!!(l!=null&&l.readableObjectMode),writableObjectMode:!!(T!=null&&T.writableObjectMode),readable:y,writable:v}),v&&(F(T,j=>{v=!1,j&&O(l,j),V(j)}),W._write=function(j,re,Q){T.write(j,re)?Q():M=Q},W._final=function(j){T.end(),b=j},T.on("drain",function(){if(M){const j=M;M=null,j()}}),T.on("finish",function(){if(b){const j=b;b=null,j()}})),y&&(F(l,j=>{y=!1,j&&O(l,j),V(j)}),l.on("readable",function(){if(k){const j=k;k=null,j()}}),l.on("end",function(){W.push(null)}),W._read=function(){for(;;){const j=l.read();if(j===null){k=W._read;return}if(!W.push(j))return}}),W._destroy=function(j,re){!j&&g!==null&&(j=new m),k=null,M=null,b=null,g===null?re(j):(g=re,O(T,j),O(l,j))},W}return Qr}var Zr,si;function rt(){if(si)return Zr;si=1;const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:n}=Te();Zr=o;const s=gr(),f=An();n(o.prototype,s.prototype),n(o,s);{const D=t(f.prototype);for(let F=0;F<D.length;F++){const m=D[F];o.prototype[m]||(o.prototype[m]=f.prototype[m])}}function o(D){if(!(this instanceof o))return new o(D);s.call(this,D),f.call(this,D),D?(this.allowHalfOpen=D.allowHalfOpen!==!1,D.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),D.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(o.prototype,{writable:{__proto__:null,...e(f.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(f.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(f.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(f.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(f.prototype,"writableLength")},writableFinished:{__proto__:null,...e(f.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(f.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(f.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(f.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(D){this._readableState&&this._writableState&&(this._readableState.destroyed=D,this._writableState.destroyed=D)}}});let p;function I(){return p===void 0&&(p={}),p}o.fromWeb=function(D,F){return I().newStreamDuplexFromReadableWritablePair(D,F)},o.toWeb=function(D){return I().newReadableWritablePairFromDuplex(D)};let A;return o.from=function(D){return A||(A=is()),A(D,"body")},Zr}var en,ai;function eo(){if(ai)return en;ai=1;const{ObjectSetPrototypeOf:r,Symbol:e}=Te();en=o;const{ERR_METHOD_NOT_IMPLEMENTED:t}=Me().codes,n=rt(),{getHighWaterMark:s}=pr();r(o.prototype,n.prototype),r(o,n);const f=e("kCallback");function o(A){if(!(this instanceof o))return new o(A);const D=A?s(this,A,"readableHighWaterMark",!0):null;D===0&&(A={...A,highWaterMark:null,readableHighWaterMark:D,writableHighWaterMark:A.writableHighWaterMark||0}),n.call(this,A),this._readableState.sync=!1,this[f]=null,A&&(typeof A.transform=="function"&&(this._transform=A.transform),typeof A.flush=="function"&&(this._flush=A.flush)),this.on("prefinish",I)}function p(A){typeof this._flush=="function"&&!this.destroyed?this._flush((D,F)=>{if(D){A?A(D):this.destroy(D);return}F!=null&&this.push(F),this.push(null),A&&A()}):(this.push(null),A&&A())}function I(){this._final!==p&&p.call(this)}return o.prototype._final=p,o.prototype._transform=function(A,D,F){throw new t("_transform()")},o.prototype._write=function(A,D,F){const m=this._readableState,B=this._writableState,q=m.length;this._transform(A,D,(O,E)=>{if(O){F(O);return}E!=null&&this.push(E),B.ended||q===m.length||m.length<m.highWaterMark?F():this[f]=F})},o.prototype._read=function(){if(this[f]){const A=this[f];this[f]=null,A()}},en}var tn,li;function to(){if(li)return tn;li=1;const{ObjectSetPrototypeOf:r}=Te();tn=t;const e=eo();r(t.prototype,e.prototype),r(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,s,f){f(null,n)},tn}var rn,ui;function Rn(){if(ui)return rn;ui=1;const r=wt(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:n,SymbolDispose:s}=Te(),f=lt(),{once:o}=We(),p=St(),I=rt(),{aggregateTwoErrors:A,codes:{ERR_INVALID_ARG_TYPE:D,ERR_INVALID_RETURN_VALUE:F,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:B,ERR_STREAM_PREMATURE_CLOSE:q},AbortError:O}=Me(),{validateFunction:E,validateAbortSignal:P}=Wt(),{isIterable:_,isReadable:R,isReadableNodeStream:te,isNodeStream:J,isTransformStream:ae,isWebStream:he,isReadableStream:i,isReadableFinished:d}=nt(),a=globalThis.AbortController||jt().AbortController;let u,c,l;function T(j,re,Q){let se=!1;j.on("close",()=>{se=!0});const le=f(j,{readable:re,writable:Q},H=>{se=!H});return{destroy:H=>{se||(se=!0,p.destroyer(j,H||new B("pipe")))},cleanup:le}}function y(j){return E(j[j.length-1],"streams[stream.length - 1]"),j.pop()}function v(j){if(_(j))return j;if(te(j))return M(j);throw new D("val",["Readable","Iterable","AsyncIterable"],j)}async function*M(j){c||(c=gr()),yield*c.prototype[n].call(j)}async function b(j,re,Q,{end:se}){let le,H=null;const z=ce=>{if(ce&&(le=ce),H){const N=H;H=null,N()}},oe=()=>new t((ce,N)=>{le?N(le):H=()=>{le?N(le):ce()}});re.on("drain",z);const ue=f(re,{readable:!1},z);try{re.writableNeedDrain&&await oe();for await(const ce of j)re.write(ce)||await oe();se&&(re.end(),await oe()),Q()}catch(ce){Q(le!==ce?A(le,ce):ce)}finally{ue(),re.off("drain",z)}}async function k(j,re,Q,{end:se}){ae(re)&&(re=re.writable);const le=re.getWriter();try{for await(const H of j)await le.ready,le.write(H).catch(()=>{});await le.ready,se&&await le.close(),Q()}catch(H){try{await le.abort(H),Q(H)}catch(z){Q(z)}}}function g(...j){return W(j,o(y(j)))}function W(j,re,Q){if(j.length===1&&e(j[0])&&(j=j[0]),j.length<2)throw new m("streams");const se=new a,le=se.signal,H=Q?.signal,z=[];P(H,"options.signal");function oe(){ee(new O)}l=l||We().addAbortListener;let ue;H&&(ue=l(H,oe));let ce,N;const L=[];let U=0;function ne(X){ee(X,--U===0)}function ee(X,G){var be;if(X&&(!ce||ce.code==="ERR_STREAM_PREMATURE_CLOSE")&&(ce=X),!(!ce&&!G)){for(;L.length;)L.shift()(ce);(be=ue)===null||be===void 0||be[s](),se.abort(),G&&(ce||z.forEach(Ne=>Ne()),r.nextTick(re,ce,N))}}let Z;for(let X=0;X<j.length;X++){const G=j[X],be=X<j.length-1,Ne=X>0,_e=be||Q?.end!==!1,xe=X===j.length-1;if(J(G)){let Ie=function(Ce){Ce&&Ce.name!=="AbortError"&&Ce.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ne(Ce)};if(_e){const{destroy:Ce,cleanup:He}=T(G,be,Ne);L.push(Ce),R(G)&&xe&&z.push(He)}G.on("error",Ie),R(G)&&xe&&z.push(()=>{G.removeListener("error",Ie)})}if(X===0)if(typeof G=="function"){if(Z=G({signal:le}),!_(Z))throw new F("Iterable, AsyncIterable or Stream","source",Z)}else _(G)||te(G)||ae(G)?Z=G:Z=I.from(G);else if(typeof G=="function"){if(ae(Z)){var C;Z=v((C=Z)===null||C===void 0?void 0:C.readable)}else Z=v(Z);if(Z=G(Z,{signal:le}),be){if(!_(Z,!0))throw new F("AsyncIterable",`transform[${X-1}]`,Z)}else{var K;u||(u=to());const Ie=new u({objectMode:!0}),Ce=(K=Z)===null||K===void 0?void 0:K.then;if(typeof Ce=="function")U++,Ce.call(Z,Le=>{N=Le,Le!=null&&Ie.write(Le),_e&&Ie.end(),r.nextTick(ne)},Le=>{Ie.destroy(Le),r.nextTick(ne,Le)});else if(_(Z,!0))U++,b(Z,Ie,ne,{end:_e});else if(i(Z)||ae(Z)){const Le=Z.readable||Z;U++,b(Le,Ie,ne,{end:_e})}else throw new F("AsyncIterable or Promise","destination",Z);Z=Ie;const{destroy:He,cleanup:ut}=T(Z,!1,!0);L.push(He),xe&&z.push(ut)}}else if(J(G)){if(te(Z)){U+=2;const Ie=V(Z,G,ne,{end:_e});R(G)&&xe&&z.push(Ie)}else if(ae(Z)||i(Z)){const Ie=Z.readable||Z;U++,b(Ie,G,ne,{end:_e})}else if(_(Z))U++,b(Z,G,ne,{end:_e});else throw new D("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Z);Z=G}else if(he(G)){if(te(Z))U++,k(v(Z),G,ne,{end:_e});else if(i(Z)||_(Z))U++,k(Z,G,ne,{end:_e});else if(ae(Z))U++,k(Z.readable,G,ne,{end:_e});else throw new D("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Z);Z=G}else Z=I.from(G)}return(le!=null&&le.aborted||H!=null&&H.aborted)&&r.nextTick(oe),Z}function V(j,re,Q,{end:se}){let le=!1;if(re.on("close",()=>{le||Q(new q)}),j.pipe(re,{end:!1}),se){let H=function(){le=!0,re.end()};d(j)?r.nextTick(H):j.once("end",H)}else Q();return f(j,{readable:!0,writable:!1},H=>{const z=j._readableState;H&&H.code==="ERR_STREAM_PREMATURE_CLOSE"&&z&&z.ended&&!z.errored&&!z.errorEmitted?j.once("end",Q).once("error",Q):Q(H)}),f(re,{readable:!1,writable:!0},Q)}return rn={pipelineImpl:W,pipeline:g},rn}var nn,fi;function ro(){if(fi)return nn;fi=1;const{pipeline:r}=Rn(),e=rt(),{destroyer:t}=St(),{isNodeStream:n,isReadable:s,isWritable:f,isWebStream:o,isTransformStream:p,isWritableStream:I,isReadableStream:A}=nt(),{AbortError:D,codes:{ERR_INVALID_ARG_VALUE:F,ERR_MISSING_ARGS:m}}=Me(),B=lt();return nn=function(...O){if(O.length===0)throw new m("streams");if(O.length===1)return e.from(O[0]);const E=[...O];if(typeof O[0]=="function"&&(O[0]=e.from(O[0])),typeof O[O.length-1]=="function"){const u=O.length-1;O[u]=e.from(O[u])}for(let u=0;u<O.length;++u)if(!(!n(O[u])&&!o(O[u]))){if(u<O.length-1&&!(s(O[u])||A(O[u])||p(O[u])))throw new F(`streams[${u}]`,E[u],"must be readable");if(u>0&&!(f(O[u])||I(O[u])||p(O[u])))throw new F(`streams[${u}]`,E[u],"must be writable")}let P,_,R,te,J;function ae(u){const c=te;te=null,c?c(u):u?J.destroy(u):!a&&!d&&J.destroy()}const he=O[0],i=r(O,ae),d=!!(f(he)||I(he)||p(he)),a=!!(s(i)||A(i)||p(i));if(J=new e({writableObjectMode:!!(he!=null&&he.writableObjectMode),readableObjectMode:!!(i!=null&&i.readableObjectMode),writable:d,readable:a}),d){if(n(he))J._write=function(c,l,T){he.write(c,l)?T():P=T},J._final=function(c){he.end(),_=c},he.on("drain",function(){if(P){const c=P;P=null,c()}});else if(o(he)){const l=(p(he)?he.writable:he).getWriter();J._write=async function(T,y,v){try{await l.ready,l.write(T).catch(()=>{}),v()}catch(M){v(M)}},J._final=async function(T){try{await l.ready,l.close().catch(()=>{}),_=T}catch(y){T(y)}}}const u=p(i)?i.readable:i;B(u,()=>{if(_){const c=_;_=null,c()}})}if(a){if(n(i))i.on("readable",function(){if(R){const u=R;R=null,u()}}),i.on("end",function(){J.push(null)}),J._read=function(){for(;;){const u=i.read();if(u===null){R=J._read;return}if(!J.push(u))return}};else if(o(i)){const c=(p(i)?i.readable:i).getReader();J._read=async function(){for(;;)try{const{value:l,done:T}=await c.read();if(!J.push(l))return;if(T){J.push(null);return}}catch{return}}}}return J._destroy=function(u,c){!u&&te!==null&&(u=new D),R=null,P=null,_=null,te===null?c(u):(te=c,n(i)&&t(i,u))},J},nn}var ci;function os(){if(ci)return Zt;ci=1;const r=globalThis.AbortController||jt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:s},AbortError:f}=Me(),{validateAbortSignal:o,validateInteger:p,validateObject:I}=Wt(),A=Te().Symbol("kWeak"),D=Te().Symbol("kResistStopPropagation"),{finished:F}=lt(),m=ro(),{addAbortSignalNoValidate:B}=hr(),{isWritable:q,isNodeStream:O}=nt(),{deprecate:E}=We(),{ArrayPrototypePush:P,Boolean:_,MathFloor:R,Number:te,NumberIsNaN:J,Promise:ae,PromiseReject:he,PromiseResolve:i,PromisePrototypeThen:d,Symbol:a}=Te(),u=a("kEmpty"),c=a("kEof");function l(H,z){if(z!=null&&I(z,"options"),z?.signal!=null&&o(z.signal,"options.signal"),O(H)&&!q(H))throw new e("stream",H,"must be writable");const oe=m(this,H);return z!=null&&z.signal&&B(z.signal,oe),oe}function T(H,z){if(typeof H!="function")throw new t("fn",["Function","AsyncFunction"],H);z!=null&&I(z,"options"),z?.signal!=null&&o(z.signal,"options.signal");let oe=1;z?.concurrency!=null&&(oe=R(z.concurrency));let ue=oe-1;return z?.highWaterMark!=null&&(ue=R(z.highWaterMark)),p(oe,"options.concurrency",1),p(ue,"options.highWaterMark",0),ue+=oe,(async function*(){const N=We().AbortSignalAny([z?.signal].filter(_)),L=this,U=[],ne={signal:N};let ee,Z,C=!1,K=0;function X(){C=!0,G()}function G(){K-=1,be()}function be(){Z&&!C&&K<oe&&U.length<ue&&(Z(),Z=null)}async function Ne(){try{for await(let _e of L){if(C)return;if(N.aborted)throw new f;try{if(_e=H(_e,ne),_e===u)continue;_e=i(_e)}catch(xe){_e=he(xe)}K+=1,d(_e,G,X),U.push(_e),ee&&(ee(),ee=null),!C&&(U.length>=ue||K>=oe)&&await new ae(xe=>{Z=xe})}U.push(c)}catch(_e){const xe=he(_e);d(xe,G,X),U.push(xe)}finally{C=!0,ee&&(ee(),ee=null)}}Ne();try{for(;;){for(;U.length>0;){const _e=await U[0];if(_e===c)return;if(N.aborted)throw new f;_e!==u&&(yield _e),U.shift(),be()}await new ae(_e=>{ee=_e})}}finally{C=!0,Z&&(Z(),Z=null)}}).call(this)}function y(H=void 0){return H!=null&&I(H,"options"),H?.signal!=null&&o(H.signal,"options.signal"),(async function*(){let oe=0;for await(const ce of this){var ue;if(H!=null&&(ue=H.signal)!==null&&ue!==void 0&&ue.aborted)throw new f({cause:H.signal.reason});yield[oe++,ce]}}).call(this)}async function v(H,z=void 0){for await(const oe of g.call(this,H,z))return!0;return!1}async function M(H,z=void 0){if(typeof H!="function")throw new t("fn",["Function","AsyncFunction"],H);return!await v.call(this,async(...oe)=>!await H(...oe),z)}async function b(H,z){for await(const oe of g.call(this,H,z))return oe}async function k(H,z){if(typeof H!="function")throw new t("fn",["Function","AsyncFunction"],H);async function oe(ue,ce){return await H(ue,ce),u}for await(const ue of T.call(this,oe,z));}function g(H,z){if(typeof H!="function")throw new t("fn",["Function","AsyncFunction"],H);async function oe(ue,ce){return await H(ue,ce)?ue:u}return T.call(this,oe,z)}class W extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function V(H,z,oe){var ue;if(typeof H!="function")throw new t("reducer",["Function","AsyncFunction"],H);oe!=null&&I(oe,"options"),oe?.signal!=null&&o(oe.signal,"options.signal");let ce=arguments.length>1;if(oe!=null&&(ue=oe.signal)!==null&&ue!==void 0&&ue.aborted){const ee=new f(void 0,{cause:oe.signal.reason});throw this.once("error",()=>{}),await F(this.destroy(ee)),ee}const N=new r,L=N.signal;if(oe!=null&&oe.signal){const ee={once:!0,[A]:this,[D]:!0};oe.signal.addEventListener("abort",()=>N.abort(),ee)}let U=!1;try{for await(const ee of this){var ne;if(U=!0,oe!=null&&(ne=oe.signal)!==null&&ne!==void 0&&ne.aborted)throw new f;ce?z=await H(z,ee,{signal:L}):(z=ee,ce=!0)}if(!U&&!ce)throw new W}finally{N.abort()}return z}async function j(H){H!=null&&I(H,"options"),H?.signal!=null&&o(H.signal,"options.signal");const z=[];for await(const ue of this){var oe;if(H!=null&&(oe=H.signal)!==null&&oe!==void 0&&oe.aborted)throw new f(void 0,{cause:H.signal.reason});P(z,ue)}return z}function re(H,z){const oe=T.call(this,H,z);return(async function*(){for await(const ce of oe)yield*ce}).call(this)}function Q(H){if(H=te(H),J(H))return 0;if(H<0)throw new s("number",">= 0",H);return H}function se(H,z=void 0){return z!=null&&I(z,"options"),z?.signal!=null&&o(z.signal,"options.signal"),H=Q(H),(async function*(){var ue;if(z!=null&&(ue=z.signal)!==null&&ue!==void 0&&ue.aborted)throw new f;for await(const N of this){var ce;if(z!=null&&(ce=z.signal)!==null&&ce!==void 0&&ce.aborted)throw new f;H--<=0&&(yield N)}}).call(this)}function le(H,z=void 0){return z!=null&&I(z,"options"),z?.signal!=null&&o(z.signal,"options.signal"),H=Q(H),(async function*(){var ue;if(z!=null&&(ue=z.signal)!==null&&ue!==void 0&&ue.aborted)throw new f;for await(const N of this){var ce;if(z!=null&&(ce=z.signal)!==null&&ce!==void 0&&ce.aborted)throw new f;if(H-- >0&&(yield N),H<=0)return}}).call(this)}return Zt.streamReturningOperators={asIndexedPairs:E(y,"readable.asIndexedPairs will be removed in a future version."),drop:se,filter:g,flatMap:re,map:T,take:le,compose:l},Zt.promiseReturningOperators={every:M,forEach:k,reduce:V,toArray:j,some:v,find:b},Zt}var on,di;function no(){if(di)return on;di=1;const{ArrayPrototypePop:r,Promise:e}=Te(),{isIterable:t,isNodeStream:n,isWebStream:s}=nt(),{pipelineImpl:f}=Rn(),{finished:o}=lt();io();function p(...I){return new e((A,D)=>{let F,m;const B=I[I.length-1];if(B&&typeof B=="object"&&!n(B)&&!t(B)&&!s(B)){const q=r(I);F=q.signal,m=q.end}f(I,(q,O)=>{q?D(q):A(O)},{signal:F,end:m})})}return on={finished:o,pipeline:p},on}var hi;function io(){if(hi)return kr.exports;hi=1;const{Buffer:r}=bt(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:n}=Te(),{promisify:{custom:s}}=We(),{streamReturningOperators:f,promiseReturningOperators:o}=os(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:p}}=Me(),I=ro(),{setDefaultHighWaterMark:A,getDefaultHighWaterMark:D}=pr(),{pipeline:F}=Rn(),{destroyer:m}=St(),B=lt(),q=no(),O=nt(),E=kr.exports=vn().Stream;E.isDestroyed=O.isDestroyed,E.isDisturbed=O.isDisturbed,E.isErrored=O.isErrored,E.isReadable=O.isReadable,E.isWritable=O.isWritable,E.Readable=gr();for(const _ of t(f)){let te=function(...J){if(new.target)throw p();return E.Readable.from(n(R,this,J))};const R=f[_];e(te,"name",{__proto__:null,value:R.name}),e(te,"length",{__proto__:null,value:R.length}),e(E.Readable.prototype,_,{__proto__:null,value:te,enumerable:!1,configurable:!0,writable:!0})}for(const _ of t(o)){let te=function(...J){if(new.target)throw p();return n(R,this,J)};const R=o[_];e(te,"name",{__proto__:null,value:R.name}),e(te,"length",{__proto__:null,value:R.length}),e(E.Readable.prototype,_,{__proto__:null,value:te,enumerable:!1,configurable:!0,writable:!0})}E.Writable=An(),E.Duplex=rt(),E.Transform=eo(),E.PassThrough=to(),E.pipeline=F;const{addAbortSignal:P}=hr();return E.addAbortSignal=P,E.finished=B,E.destroy=m,E.compose=I,E.setDefaultHighWaterMark=A,E.getDefaultHighWaterMark=D,e(E,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return q}}),e(F,s,{__proto__:null,enumerable:!0,get(){return q.pipeline}}),e(B,s,{__proto__:null,enumerable:!0,get(){return q.finished}}),E.Stream=E,E._isUint8Array=function(R){return R instanceof Uint8Array},E._uint8ArrayToBuffer=function(R){return r.from(R.buffer,R.byteOffset,R.byteLength)},kr.exports}var pi;function ss(){return pi||(pi=1,function(r){const e=io(),t=no(),n=e.Readable.destroy;r.exports=e.Readable,r.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,r.exports._isUint8Array=e._isUint8Array,r.exports.isDisturbed=e.isDisturbed,r.exports.isErrored=e.isErrored,r.exports.isReadable=e.isReadable,r.exports.Readable=e.Readable,r.exports.Writable=e.Writable,r.exports.Duplex=e.Duplex,r.exports.Transform=e.Transform,r.exports.PassThrough=e.PassThrough,r.exports.addAbortSignal=e.addAbortSignal,r.exports.finished=e.finished,r.exports.destroy=e.destroy,r.exports.destroy=n,r.exports.pipeline=e.pipeline,r.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),r.exports.Stream=e.Stream,r.exports.default=r.exports}(Dr)),Dr.exports}var br=ss(),sn,gi;function oo(){if(gi)return sn;gi=1,sn=f,f.default=f,f.stable=A,f.stableStringify=A;var r="[...]",e="[Circular]",t=[],n=[];function s(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function f(m,B,q,O){typeof O>"u"&&(O=s()),p(m,"",0,[],void 0,0,O);var E;try{n.length===0?E=JSON.stringify(m,B,q):E=JSON.stringify(m,F(B),q)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var P=t.pop();P.length===4?Object.defineProperty(P[0],P[1],P[3]):P[0][P[1]]=P[2]}}return E}function o(m,B,q,O){var E=Object.getOwnPropertyDescriptor(O,q);E.get!==void 0?E.configurable?(Object.defineProperty(O,q,{value:m}),t.push([O,q,B,E])):n.push([B,q,m]):(O[q]=m,t.push([O,q,B]))}function p(m,B,q,O,E,P,_){P+=1;var R;if(typeof m=="object"&&m!==null){for(R=0;R<O.length;R++)if(O[R]===m){o(e,m,B,E);return}if(typeof _.depthLimit<"u"&&P>_.depthLimit){o(r,m,B,E);return}if(typeof _.edgesLimit<"u"&&q+1>_.edgesLimit){o(r,m,B,E);return}if(O.push(m),Array.isArray(m))for(R=0;R<m.length;R++)p(m[R],R,R,O,m,P,_);else{var te=Object.keys(m);for(R=0;R<te.length;R++){var J=te[R];p(m[J],J,R,O,m,P,_)}}O.pop()}}function I(m,B){return m<B?-1:m>B?1:0}function A(m,B,q,O){typeof O>"u"&&(O=s());var E=D(m,"",0,[],void 0,0,O)||m,P;try{n.length===0?P=JSON.stringify(E,B,q):P=JSON.stringify(E,F(B),q)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var _=t.pop();_.length===4?Object.defineProperty(_[0],_[1],_[3]):_[0][_[1]]=_[2]}}return P}function D(m,B,q,O,E,P,_){P+=1;var R;if(typeof m=="object"&&m!==null){for(R=0;R<O.length;R++)if(O[R]===m){o(e,m,B,E);return}try{if(typeof m.toJSON=="function")return}catch{return}if(typeof _.depthLimit<"u"&&P>_.depthLimit){o(r,m,B,E);return}if(typeof _.edgesLimit<"u"&&q+1>_.edgesLimit){o(r,m,B,E);return}if(O.push(m),Array.isArray(m))for(R=0;R<m.length;R++)D(m[R],R,R,O,m,P,_);else{var te={},J=Object.keys(m).sort(I);for(R=0;R<J.length;R++){var ae=J[R];D(m[ae],ae,R,O,m,P,_),te[ae]=m[ae]}if(typeof E<"u")t.push([E,B,m]),E[B]=te;else return te}O.pop()}}function F(m){return m=typeof m<"u"?m:function(B,q){return q},function(B,q){if(n.length>0)for(var O=0;O<n.length;O++){var E=n[O];if(E[1]===B&&E[0]===q){q=E[2],n.splice(O,1);break}}return m.call(this,B,q)}}return sn}var as=oo();const ls=mt(as);var tr={exports:{}},an,bi;function us(){if(bi)return an;bi=1,an=r;function r(e,t){if(e&&t)return r(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(s){n[s]=e[s]}),n;function n(){for(var s=new Array(arguments.length),f=0;f<s.length;f++)s[f]=arguments[f];var o=e.apply(this,s),p=s[s.length-1];return typeof o=="function"&&o!==p&&Object.keys(p).forEach(function(I){o[I]=p[I]}),o}}return an}var wi;function Tn(){if(wi)return tr.exports;wi=1;var r=us();tr.exports=r(e),tr.exports.strict=r(t),e.proto=e(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return e(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return t(this)},configurable:!0})});function e(n){var s=function(){return s.called?s.value:(s.called=!0,s.value=n.apply(this,arguments))};return s.called=!1,s}function t(n){var s=function(){if(s.called)throw new Error(s.onceError);return s.called=!0,s.value=n.apply(this,arguments)},f=n.name||"Function wrapped with `once`";return s.onceError=f+" shouldn't be called more than once",s.called=!1,s}return tr.exports}var ln,_i;function so(){if(_i)return ln;_i=1;var r=Tn(),e=function(){},t=Lt.Bare?queueMicrotask:process.nextTick.bind(process),n=function(o){return o.setHeader&&typeof o.abort=="function"},s=function(o){return o.stdio&&Array.isArray(o.stdio)&&o.stdio.length===3},f=function(o,p,I){if(typeof p=="function")return f(o,null,p);p||(p={}),I=r(I||e);var A=o._writableState,D=o._readableState,F=p.readable||p.readable!==!1&&o.readable,m=p.writable||p.writable!==!1&&o.writable,B=!1,q=function(){o.writable||O()},O=function(){m=!1,F||I.call(o)},E=function(){F=!1,m||I.call(o)},P=function(ae){I.call(o,ae?new Error("exited with error code: "+ae):null)},_=function(ae){I.call(o,ae)},R=function(){t(te)},te=function(){if(!B){if(F&&!(D&&D.ended&&!D.destroyed))return I.call(o,new Error("premature close"));if(m&&!(A&&A.ended&&!A.destroyed))return I.call(o,new Error("premature close"))}},J=function(){o.req.on("finish",O)};return n(o)?(o.on("complete",O),o.on("abort",R),o.req?J():o.on("request",J)):m&&!A&&(o.on("end",q),o.on("close",q)),s(o)&&o.on("exit",P),o.on("end",E),o.on("finish",O),p.error!==!1&&o.on("error",_),o.on("close",R),function(){B=!0,o.removeListener("complete",O),o.removeListener("abort",R),o.removeListener("request",J),o.req&&o.req.removeListener("finish",O),o.removeListener("end",q),o.removeListener("close",q),o.removeListener("finish",O),o.removeListener("exit",P),o.removeListener("end",E),o.removeListener("error",_),o.removeListener("close",R)}};return ln=f,ln}var fs=so();const yi=mt(fs);var cs=Tn();const ds=mt(cs);var un,mi;function hs(){if(mi)return un;mi=1;var r=Tn(),e=so(),t;try{t=Qo}catch{}var n=function(){},s=typeof process>"u"?!1:/^v?\.0/.test(process.version),f=function(m){return typeof m=="function"},o=function(m){return!s||!t?!1:(m instanceof(t.ReadStream||n)||m instanceof(t.WriteStream||n))&&f(m.close)},p=function(m){return m.setHeader&&f(m.abort)},I=function(m,B,q,O){O=r(O);var E=!1;m.on("close",function(){E=!0}),e(m,{readable:B,writable:q},function(_){if(_)return O(_);E=!0,O()});var P=!1;return function(_){if(!E&&!P){if(P=!0,o(m))return m.close(n);if(p(m))return m.abort();if(f(m.destroy))return m.destroy();O(_||new Error("stream was destroyed"))}}},A=function(m){m()},D=function(m,B){return m.pipe(B)},F=function(){var m=Array.prototype.slice.call(arguments),B=f(m[m.length-1]||n)&&m.pop()||n;if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new Error("pump requires two streams per minimum");var q,O=m.map(function(E,P){var _=P<m.length-1,R=P>0;return I(E,_,R,function(te){q||(q=te),te&&O.forEach(A),!_&&(O.forEach(A),B(q))})});return m.reduce(D)};return un=F,un}var ps=hs();const Si=mt(ps);function rr(){}const Ei="SYN",fn="ACK",vi="BRK";class Ai extends br.Duplex{constructor(e){let{name:t,target:n,targetWindow:s=window,targetOrigin:f="*"}=e;if(super({objectMode:!0}),pe(this,"_init",void 0),pe(this,"_haveSyn",void 0),pe(this,"_name",void 0),pe(this,"_target",void 0),pe(this,"_targetWindow",void 0),pe(this,"_targetOrigin",void 0),pe(this,"_onMessage",void 0),pe(this,"_synIntervalId",void 0),!t||!n)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=t,this._target=n,this._targetWindow=s,this._targetOrigin=f,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write(vi,null,rr),this._haveSyn=!1,this._init=!1}_handShake(){this._write(Ei,null,rr),this.cork()}_onData(e){if(!this._init)e===Ei?(this._haveSyn=!0,this._write(fn,null,rr)):e===fn&&(this._init=!0,this._haveSyn||this._write(fn,null,rr),this.uncork());else if(e===vi)this._break();else try{this.push(e)}catch(t){this.emit("error",t)}}_postMessage(e){const t=this._targetOrigin;this._targetWindow.postMessage({target:this._target,data:e},t)}onMessage(e){const t=e.data;this._targetOrigin!=="*"&&e.origin!==this._targetOrigin||e.source!==this._targetWindow||typeof t!="object"||t.target!==this._name||!t.data||this._onData(t.data)}_read(){}_write(e,t,n){this._postMessage(e),n()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}const gs={rpc:{internal:-32603}},Ri={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},Ti=gs.rpc.internal,bs="Unspecified error message. This is a bug, please report it.";function ao(r){return Number.isInteger(r)}function Ii(r){return typeof r=="string"&&r.length>0}function Oi(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}function lo(r){const e=r;return!(!e||!ao(e.code)||!Ii(e.message)||e.stack&&!Ii(e.stack))}function ws(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bs;if(ao(r)){const t=r.toString();if(Object.hasOwn(Ri,t))return Ri[t].message}return e}const _s={code:Ti,message:ws(Ti)};function yn(r){try{JSON.parse(JSON.stringify(r,(e,t)=>{if(e==="__proto__"||e==="constructor")throw new Error("Not valid json");if(typeof t=="function"||typeof t=="symbol")throw new Error("Not valid json");return t}),(e,t)=>{if(!(e==="__proto__"||e==="constructor"))return t})}catch{return!1}return!0}function Pi(r){return Object.getOwnPropertyNames(r).reduce((e,t)=>{const n=r[t];return yn(n)&&(e[t]=n),e},{})}function ys(r){return Array.isArray(r)?r.map(e=>yn(e)?e:Oi(e)?Pi(e):null):Oi(r)?Pi(r):yn(r)?r:null}function ms(r,e){if(r&&typeof r=="object"&&"serialize"in r&&typeof r.serialize=="function")return r.serialize();if(lo(r))return r;const t=ys(r);return $e($e({},e),{},{data:{cause:t}})}function Ni(r){let{fallbackError:e=_s,shouldIncludeStack:t=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!lo(e))throw new Error("Must provide fallback error with integer number code and string message.");const n=ms(r,e);return t||delete n.stack,n}function Ci(r,e,t){try{Reflect.apply(r,e,t)}catch(n){setTimeout(()=>{throw n})}}function Ss(r){const e=r.length,t=new Array(e);for(let n=0;n<e;n+=1)t[n]=r[n];return t}class wr extends Zo.EventEmitter{emit(e){let t=e==="error";const n=this._events;if(n!==void 0)t=t&&n.error===void 0;else if(!t)return!1;for(var s=arguments.length,f=new Array(s>1?s-1:0),o=1;o<s;o++)f[o-1]=arguments[o];if(t){let I;if(f.length>0&&([I]=f),I instanceof Error)throw I;const A=new Error(`Unhandled error.${I?` (${I.message})`:""}`);throw A.context=I,A}const p=n[e];if(p===void 0)return!1;if(typeof p=="function")Ci(p,this,f);else{const I=p.length,A=Ss(p);for(let D=0;D<I;D+=1)Ci(A[D],this,f)}return!0}}class Nt extends Error{constructor(e){let{code:t,message:n,data:s}=e;if(!Number.isInteger(t))throw new Error("code must be an integer");if(!n||typeof n!="string")throw new Error("message must be string");super(n),pe(this,"code",void 0),pe(this,"data",void 0),this.code=t,s!==void 0&&(this.data=s)}toString(){return ls({code:this.code,message:this.message,data:this.data,stack:this.stack})}}const mn=function(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return(n,s)=>{n||s.error?e(n||s.error):!t||Array.isArray(s)?r(s):r(s.result)}};function Es(){const r={};function e(){return!1}const t=new wr;function n(I){const A=r[I.id];if(!A)throw new Error(`StreamMiddleware - Unknown response id "${I.id}"`);delete r[I.id],Object.assign(A.res,I),setTimeout(A.end)}function s(I){t.emit("notification",I)}function f(I,A,D){let F;try{!I.id?s(I):n(I)}catch(m){F=m}D(F)}const o=new br.Duplex({objectMode:!0,read:e,write:f});return{events:t,middleware:(I,A,D,F)=>{o.push(I),r[I.id]={req:I,res:A,next:D,end:F}},stream:o}}function vs(){return(r,e,t,n)=>{const s=r.id,f=Math.random().toString(36).slice(2);r.id=f,e.id=f,t(o=>{r.id=s,e.id=s,o()})}}class et extends wr{constructor(){super(),pe(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(e,t,n){const s=[];let f=null,o=!1;for(const p of n)if([f,o]=await et._runMiddleware(e,t,p,s),o)break;return[f,o,s.reverse()]}static _runMiddleware(e,t,n,s){return new Promise(f=>{const o=I=>{const A=I||t.error;A&&(typeof A=="object"&&Object.keys(A).includes("stack")===!1&&(A.stack="Stack trace is not available."),t.error=Ni(A,{shouldIncludeStack:!0,fallbackError:{message:A?.message||A?.toString(),code:A?.code||-32603,stack:A?.stack||"Stack trace is not available.",data:A?.data||A?.message||A?.toString()}})),f([A,!0])},p=I=>{t.error?o(t.error):(I&&(typeof I!="function"&&o(new Nt({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),s.push(I)),f([null,!1]))};try{n(e,t,p,o)}catch(I){o(I)}})}static async _runReturnHandlers(e){for(const t of e)await new Promise((n,s)=>{t(f=>f?s(f):n())})}static _checkForCompletion(e,t,n){if(!("result"in t)&&!("error"in t))throw new Nt({code:-32603,message:"Response has no error or result for request"});if(!n)throw new Nt({code:-32603,message:"Nothing ended request"})}push(e){this._middleware.push(e)}handle(e,t){if(t&&typeof t!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,n,s)=>{try{const[f,o,p]=await et._runAllMiddleware(e,t,this._middleware);return o?(await et._runReturnHandlers(p),s(f)):n(async I=>{try{await et._runReturnHandlers(p)}catch(A){return I(A)}return I()})}catch(f){return s(f)}}}async _handleBatch(e,t){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,n):n}catch(n){if(t)return t(n);throw n}}_promiseHandle(e){return new Promise((t,n)=>{this._handle(e,(s,f)=>{s&&f===void 0?n(s):t(f)}).catch(n)})}async _handle(e,t){if(!e||Array.isArray(e)||typeof e!="object"){const B=new Nt({code:-32603,message:"request must be plain object"});return t(B,{id:void 0,jsonrpc:"2.0",error:B})}if(typeof e.method!="string"){const B=new Nt({code:-32603,message:"method must be string"});return t(B,{id:e.id,jsonrpc:"2.0",error:B})}const n=$e({},e),s={id:n.id,jsonrpc:n.jsonrpc};let f=null;try{await this._processRequest(n,s)}catch(B){f=B}if(f&&(delete s.result,!s.error)){var o,p,I,A,D,F,m;typeof f=="object"&&Object.keys(f).includes("stack")===!1&&(f.stack="Stack trace is not available."),s.error=Ni(f,{shouldIncludeStack:!0,fallbackError:{message:((o=f)===null||o===void 0?void 0:o.message)||((p=f)===null||p===void 0?void 0:p.toString()),code:((I=f)===null||I===void 0?void 0:I.code)||-32603,stack:((A=f)===null||A===void 0?void 0:A.stack)||"Stack trace is not available.",data:((D=f)===null||D===void 0?void 0:D.data)||((F=f)===null||F===void 0?void 0:F.message)||((m=f)===null||m===void 0?void 0:m.toString())}})}return t(f,s)}async _processRequest(e,t){const[n,s,f]=await et._runAllMiddleware(e,t,this._middleware);if(et._checkForCompletion(e,t,s),await et._runReturnHandlers(f),n)throw n}}class As extends br.Duplex{constructor(e){let{parent:t,name:n}=e;super({objectMode:!0}),pe(this,"_parent",void 0),pe(this,"_name",void 0),this._parent=t,this._name=n}_read(){}_write(e,t,n){this._parent.push({name:this._name,data:e}),n()}}const Li=Symbol("IGNORE_SUBSTREAM");class Rs extends br.Duplex{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super($e($e({},e),{},{objectMode:!0})),pe(this,"_substreams",void 0),pe(this,"getStream",void 0),this._substreams={}}createStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);const t=new As({parent:this,name:e});return this._substreams[e]=t,Ts(this,n=>t.destroy(n||void 0)),t}ignoreStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);this._substreams[e]=Li}_read(){}_write(e,t,n){const{name:s,data:f}=e;if(!s)return window.console.warn(`ObjectMultiplex - malformed chunk without name "${e}"`),n();const o=this._substreams[s];return o?(o!==Li&&o.push(f),n()):(window.console.warn(`ObjectMultiplex - orphaned data for stream "${s}"`),n())}}function Ts(r,e){const t=ds(e);yi(r,{readable:!1},t),yi(r,{writable:!1},t)}var xt={exports:{}};xt.exports;var xi;function Is(){return xi||(xi=1,function(r,e){var t=200,n="__lodash_hash_undefined__",s=800,f=16,o=9007199254740991,p="[object Arguments]",I="[object Array]",A="[object AsyncFunction]",D="[object Boolean]",F="[object Date]",m="[object Error]",B="[object Function]",q="[object GeneratorFunction]",O="[object Map]",E="[object Number]",P="[object Null]",_="[object Object]",R="[object Proxy]",te="[object RegExp]",J="[object Set]",ae="[object String]",he="[object Undefined]",i="[object WeakMap]",d="[object ArrayBuffer]",a="[object DataView]",u="[object Float32Array]",c="[object Float64Array]",l="[object Int8Array]",T="[object Int16Array]",y="[object Int32Array]",v="[object Uint8Array]",M="[object Uint8ClampedArray]",b="[object Uint16Array]",k="[object Uint32Array]",g=/[\\^$.*+?()[\]{}|]/g,W=/^\[object .+?Constructor\]$/,V=/^(?:0|[1-9]\d*)$/,j={};j[u]=j[c]=j[l]=j[T]=j[y]=j[v]=j[M]=j[b]=j[k]=!0,j[p]=j[I]=j[d]=j[D]=j[a]=j[F]=j[m]=j[B]=j[O]=j[E]=j[_]=j[te]=j[J]=j[ae]=j[i]=!1;var re=typeof Lt=="object"&&Lt&&Lt.Object===Object&&Lt,Q=typeof self=="object"&&self&&self.Object===Object&&self,se=re||Q||Function("return this")(),le=e&&!e.nodeType&&e,H=le&&!0&&r&&!r.nodeType&&r,z=H&&H.exports===le,oe=z&&re.process,ue=function(){try{var w=H&&H.require&&H.require("util").types;return w||oe&&oe.binding&&oe.binding("util")}catch{}}(),ce=ue&&ue.isTypedArray;function N(w,x,$){switch($.length){case 0:return w.call(x);case 1:return w.call(x,$[0]);case 2:return w.call(x,$[0],$[1]);case 3:return w.call(x,$[0],$[1],$[2])}return w.apply(x,$)}function L(w,x){for(var $=-1,de=Array(w);++$<w;)de[$]=x($);return de}function U(w){return function(x){return w(x)}}function ne(w,x){return w?.[x]}function ee(w,x){return function($){return w(x($))}}var Z=Array.prototype,C=Function.prototype,K=Object.prototype,X=se["__core-js_shared__"],G=C.toString,be=K.hasOwnProperty,Ne=function(){var w=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),_e=K.toString,xe=G.call(Object),Ie=RegExp("^"+G.call(be).replace(g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ce=z?se.Buffer:void 0,He=se.Symbol,ut=se.Uint8Array;Ce&&Ce.allocUnsafe;var Le=ee(Object.getPrototypeOf,Object),Ut=Object.create,Sr=K.propertyIsEnumerable,Bt=Z.splice,Ye=He?He.toStringTag:void 0,_t=function(){try{var w=Ir(Object,"defineProperty");return w({},"",{}),w}catch{}}(),Er=Ce?Ce.isBuffer:void 0,Et=Math.max,qt=Date.now,$t=Ir(se,"Map"),it=Ir(Object,"create"),vt=function(){function w(){}return function(x){if(!ct(x))return{};if(Ut)return Ut(x);w.prototype=x;var $=new w;return w.prototype=void 0,$}}();function Xe(w){var x=-1,$=w==null?0:w.length;for(this.clear();++x<$;){var de=w[x];this.set(de[0],de[1])}}function vr(){this.__data__=it?it(null):{},this.size=0}function At(w){var x=this.has(w)&&delete this.__data__[w];return this.size-=x?1:0,x}function Ht(w){var x=this.__data__;if(it){var $=x[w];return $===n?void 0:$}return be.call(x,w)?x[w]:void 0}function h(w){var x=this.__data__;return it?x[w]!==void 0:be.call(x,w)}function S(w,x){var $=this.__data__;return this.size+=this.has(w)?0:1,$[w]=it&&x===void 0?n:x,this}Xe.prototype.clear=vr,Xe.prototype.delete=At,Xe.prototype.get=Ht,Xe.prototype.has=h,Xe.prototype.set=S;function Y(w){var x=-1,$=w==null?0:w.length;for(this.clear();++x<$;){var de=w[x];this.set(de[0],de[1])}}function ie(){this.__data__=[],this.size=0}function fe(w){var x=this.__data__,$=Jt(x,w);if($<0)return!1;var de=x.length-1;return $==de?x.pop():Bt.call(x,$,1),--this.size,!0}function Oe(w){var x=this.__data__,$=Jt(x,w);return $<0?void 0:x[$][1]}function De(w){return Jt(this.__data__,w)>-1}function Gt(w,x){var $=this.__data__,de=Jt($,w);return de<0?(++this.size,$.push([w,x])):$[de][1]=x,this}Y.prototype.clear=ie,Y.prototype.delete=fe,Y.prototype.get=Oe,Y.prototype.has=De,Y.prototype.set=Gt;function ke(w){var x=-1,$=w==null?0:w.length;for(this.clear();++x<$;){var de=w[x];this.set(de[0],de[1])}}function zt(){this.size=0,this.__data__={hash:new Xe,map:new($t||Y),string:new Xe}}function Ar(w){var x=Xt(this,w).delete(w);return this.size-=x?1:0,x}function Kt(w){return Xt(this,w).get(w)}function Vt(w){return Xt(this,w).has(w)}function Rt(w,x){var $=Xt(this,w),de=$.size;return $.set(w,x),this.size+=$.size==de?0:1,this}ke.prototype.clear=zt,ke.prototype.delete=Ar,ke.prototype.get=Kt,ke.prototype.has=Vt,ke.prototype.set=Rt;function Ve(w){var x=this.__data__=new Y(w);this.size=x.size}function Tt(){this.__data__=new Y,this.size=0}function ft(w){var x=this.__data__,$=x.delete(w);return this.size=x.size,$}function Qe(w){return this.__data__.get(w)}function Ge(w){return this.__data__.has(w)}function _o(w,x){var $=this.__data__;if($ instanceof Y){var de=$.__data__;if(!$t||de.length<t-1)return de.push([w,x]),this.size=++$.size,this;$=this.__data__=new ke(de)}return $.set(w,x),this.size=$.size,this}Ve.prototype.clear=Tt,Ve.prototype.delete=ft,Ve.prototype.get=Qe,Ve.prototype.has=Ge,Ve.prototype.set=_o;function yo(w,x){var $=Nr(w),de=!$&&Pr(w),we=!$&&!de&&Mn(w),me=!$&&!de&&!we&&kn(w),ve=$||de||we||me,ye=ve?L(w.length,String):[],Ae=ye.length;for(var ze in w)ve&&(ze=="length"||we&&(ze=="offset"||ze=="parent")||me&&(ze=="buffer"||ze=="byteLength"||ze=="byteOffset")||Ln(ze,Ae))||ye.push(ze);return ye}function Rr(w,x,$){($!==void 0&&!Qt(w[x],$)||$===void 0&&!(x in w))&&Tr(w,x,$)}function mo(w,x,$){var de=w[x];(!(be.call(w,x)&&Qt(de,$))||$===void 0&&!(x in w))&&Tr(w,x,$)}function Jt(w,x){for(var $=w.length;$--;)if(Qt(w[$][0],x))return $;return-1}function Tr(w,x,$){x=="__proto__"&&_t?_t(w,x,{configurable:!0,enumerable:!0,value:$,writable:!0}):w[x]=$}var So=Mo();function Yt(w){return w==null?w===void 0?he:P:Ye&&Ye in Object(w)?Do(w):Bo(w)}function Nn(w){return It(w)&&Yt(w)==p}function Eo(w){if(!ct(w)||Fo(w))return!1;var x=Lr(w)?Ie:W;return x.test(Go(w))}function vo(w){return It(w)&&Dn(w.length)&&!!j[Yt(w)]}function Ao(w){if(!ct(w))return Uo(w);var x=xn(w),$=[];for(var de in w)de=="constructor"&&(x||!be.call(w,de))||$.push(de);return $}function Cn(w,x,$,de,we){w!==x&&So(x,function(me,ve){if(we||(we=new Ve),ct(me))Ro(w,x,ve,$,Cn,de,we);else{var ye=de?de(Or(w,ve),me,ve+"",w,x,we):void 0;ye===void 0&&(ye=me),Rr(w,ve,ye)}},jn)}function Ro(w,x,$,de,we,me,ve){var ye=Or(w,$),Ae=Or(x,$),ze=ve.get(Ae);if(ze){Rr(w,$,ze);return}var Fe=me?me(ye,Ae,$+"",w,x,ve):void 0,Ot=Fe===void 0;if(Ot){var xr=Nr(Ae),Mr=!xr&&Mn(Ae),Fn=!xr&&!Mr&&kn(Ae);Fe=Ae,xr||Mr||Fn?Nr(ye)?Fe=ye:zo(ye)?Fe=Co(ye):Mr?(Ot=!1,Fe=Oo(Ae)):Fn?(Ot=!1,Fe=No(Ae)):Fe=[]:Ko(Ae)||Pr(Ae)?(Fe=ye,Pr(ye)?Fe=Vo(ye):(!ct(ye)||Lr(ye))&&(Fe=ko(Ae))):Ot=!1}Ot&&(ve.set(Ae,Fe),we(Fe,Ae,de,me,ve),ve.delete(Ae)),Rr(w,$,Fe)}function To(w,x){return $o(qo(w,x,Wn),w+"")}var Io=_t?function(w,x){return _t(w,"toString",{configurable:!0,enumerable:!1,value:Yo(x),writable:!0})}:Wn;function Oo(w,x){return w.slice()}function Po(w){var x=new w.constructor(w.byteLength);return new ut(x).set(new ut(w)),x}function No(w,x){var $=Po(w.buffer);return new w.constructor($,w.byteOffset,w.length)}function Co(w,x){var $=-1,de=w.length;for(x||(x=Array(de));++$<de;)x[$]=w[$];return x}function Lo(w,x,$,de){var we=!$;$||($={});for(var me=-1,ve=x.length;++me<ve;){var ye=x[me],Ae=void 0;Ae===void 0&&(Ae=w[ye]),we?Tr($,ye,Ae):mo($,ye,Ae)}return $}function xo(w){return To(function(x,$){var de=-1,we=$.length,me=we>1?$[we-1]:void 0,ve=we>2?$[2]:void 0;for(me=w.length>3&&typeof me=="function"?(we--,me):void 0,ve&&jo($[0],$[1],ve)&&(me=we<3?void 0:me,we=1),x=Object(x);++de<we;){var ye=$[de];ye&&w(x,ye,de,me)}return x})}function Mo(w){return function(x,$,de){for(var we=-1,me=Object(x),ve=de(x),ye=ve.length;ye--;){var Ae=ve[++we];if($(me[Ae],Ae,me)===!1)break}return x}}function Xt(w,x){var $=w.__data__;return Wo(x)?$[typeof x=="string"?"string":"hash"]:$.map}function Ir(w,x){var $=ne(w,x);return Eo($)?$:void 0}function Do(w){var x=be.call(w,Ye),$=w[Ye];try{w[Ye]=void 0;var de=!0}catch{}var we=_e.call(w);return de&&(x?w[Ye]=$:delete w[Ye]),we}function ko(w){return typeof w.constructor=="function"&&!xn(w)?vt(Le(w)):{}}function Ln(w,x){var $=typeof w;return x=x??o,!!x&&($=="number"||$!="symbol"&&V.test(w))&&w>-1&&w%1==0&&w<x}function jo(w,x,$){if(!ct($))return!1;var de=typeof x;return(de=="number"?Cr($)&&Ln(x,$.length):de=="string"&&x in $)?Qt($[x],w):!1}function Wo(w){var x=typeof w;return x=="string"||x=="number"||x=="symbol"||x=="boolean"?w!=="__proto__":w===null}function Fo(w){return!!Ne&&Ne in w}function xn(w){var x=w&&w.constructor,$=typeof x=="function"&&x.prototype||K;return w===$}function Uo(w){var x=[];if(w!=null)for(var $ in Object(w))x.push($);return x}function Bo(w){return _e.call(w)}function qo(w,x,$){return x=Et(x===void 0?w.length-1:x,0),function(){for(var de=arguments,we=-1,me=Et(de.length-x,0),ve=Array(me);++we<me;)ve[we]=de[x+we];we=-1;for(var ye=Array(x+1);++we<x;)ye[we]=de[we];return ye[x]=$(ve),N(w,this,ye)}}function Or(w,x){if(!(x==="constructor"&&typeof w[x]=="function")&&x!="__proto__")return w[x]}var $o=Ho(Io);function Ho(w){var x=0,$=0;return function(){var de=qt(),we=f-(de-$);if($=de,we>0){if(++x>=s)return arguments[0]}else x=0;return w.apply(void 0,arguments)}}function Go(w){if(w!=null){try{return G.call(w)}catch{}try{return w+""}catch{}}return""}function Qt(w,x){return w===x||w!==w&&x!==x}var Pr=Nn(function(){return arguments}())?Nn:function(w){return It(w)&&be.call(w,"callee")&&!Sr.call(w,"callee")},Nr=Array.isArray;function Cr(w){return w!=null&&Dn(w.length)&&!Lr(w)}function zo(w){return It(w)&&Cr(w)}var Mn=Er||Xo;function Lr(w){if(!ct(w))return!1;var x=Yt(w);return x==B||x==q||x==A||x==R}function Dn(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=o}function ct(w){var x=typeof w;return w!=null&&(x=="object"||x=="function")}function It(w){return w!=null&&typeof w=="object"}function Ko(w){if(!It(w)||Yt(w)!=_)return!1;var x=Le(w);if(x===null)return!0;var $=be.call(x,"constructor")&&x.constructor;return typeof $=="function"&&$ instanceof $&&G.call($)==xe}var kn=ce?U(ce):vo;function Vo(w){return Lo(w,jn(w))}function jn(w){return Cr(w)?yo(w):Ao(w)}var Jo=xo(function(w,x,$){Cn(w,x,$)});function Yo(w){return function(){return w}}function Wn(w){return w}function Xo(){return!1}r.exports=Jo}(xt,xt.exports)),xt.exports}Is();var fr={exports:{}},Os=fr.exports,Mi;function Ps(){return Mi||(Mi=1,function(r){(function(e,t){r.exports?r.exports=t():e.log=t()})(Os,function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],f={},o=null;function p(O,E){var P=O[E];if(typeof P.bind=="function")return P.bind(O);try{return Function.prototype.bind.call(P,O)}catch{return function(){return Function.prototype.apply.apply(P,[O,arguments])}}}function I(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function A(O){return O==="debug"&&(O="log"),typeof console===t?!1:O==="trace"&&n?I:console[O]!==void 0?p(console,O):console.log!==void 0?p(console,"log"):e}function D(){for(var O=this.getLevel(),E=0;E<s.length;E++){var P=s[E];this[P]=E<O?e:this.methodFactory(P,O,this.name)}if(this.log=this.debug,typeof console===t&&O<this.levels.SILENT)return"No console available for logging"}function F(O){return function(){typeof console!==t&&(D.call(this),this[O].apply(this,arguments))}}function m(O,E,P){return A(O)||F.apply(this,arguments)}function B(O,E){var P=this,_,R,te,J="loglevel";typeof O=="string"?J+=":"+O:typeof O=="symbol"&&(J=void 0);function ae(u){var c=(s[u]||"silent").toUpperCase();if(!(typeof window===t||!J)){try{window.localStorage[J]=c;return}catch{}try{window.document.cookie=encodeURIComponent(J)+"="+c+";"}catch{}}}function he(){var u;if(!(typeof window===t||!J)){try{u=window.localStorage[J]}catch{}if(typeof u===t)try{var c=window.document.cookie,l=encodeURIComponent(J),T=c.indexOf(l+"=");T!==-1&&(u=/^([^;]+)/.exec(c.slice(T+l.length+1))[1])}catch{}return P.levels[u]===void 0&&(u=void 0),u}}function i(){if(!(typeof window===t||!J)){try{window.localStorage.removeItem(J)}catch{}try{window.document.cookie=encodeURIComponent(J)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function d(u){var c=u;if(typeof c=="string"&&P.levels[c.toUpperCase()]!==void 0&&(c=P.levels[c.toUpperCase()]),typeof c=="number"&&c>=0&&c<=P.levels.SILENT)return c;throw new TypeError("log.setLevel() called with invalid level: "+u)}P.name=O,P.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},P.methodFactory=E||m,P.getLevel=function(){return te??R??_},P.setLevel=function(u,c){return te=d(u),c!==!1&&ae(te),D.call(P)},P.setDefaultLevel=function(u){R=d(u),he()||P.setLevel(u,!1)},P.resetLevel=function(){te=null,i(),D.call(P)},P.enableAll=function(u){P.setLevel(P.levels.TRACE,u)},P.disableAll=function(u){P.setLevel(P.levels.SILENT,u)},P.rebuild=function(){if(o!==P&&(_=d(o.getLevel())),D.call(P),o===P)for(var u in f)f[u].rebuild()},_=d(o?o.getLevel():"WARN");var a=he();a!=null&&(te=d(a)),D.call(P)}o=new B,o.getLogger=function(E){if(typeof E!="symbol"&&typeof E!="string"||E==="")throw new TypeError("You must supply a name when creating a logger.");var P=f[E];return P||(P=f[E]=new B(E,o.methodFactory)),P};var q=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=q),o},o.getLoggers=function(){return f},o.default=o,o})}(fr)),fr.exports}var uo=Ps();const cr=mt(uo),Ns=cr.getLogger("http-helpers");Ns.setLevel(uo.levels.INFO);function Cs(r){let e=r;if(typeof e!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof e}`);return e.length%2&&(e=`0${e}`),e}BigInt(0);const Sn={},En={};for(let r=0;r<16;r++){const e=r,t=r*16,n=r.toString(16).toLowerCase();En[n]=e,En[n.toUpperCase()]=e,Sn[n]=t,Sn[n.toUpperCase()]=t}function Ls(r){const e=r.length,t=new Uint8Array(e/2);for(let n=0;n<e;n+=2)t[n/2]=Sn[r[n]]+En[r[n+1]];return t}Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));for(let r=0;r<=256*256-1;r++)BigInt(r);const _r=r=>{if(typeof r!="string")throw new Error(`hex argument type ${typeof r} must be of type string`);if(!/^0x[0-9a-fA-F]*$/.test(r))throw new Error(`Input must be a 0x-prefixed hexadecimal string, got ${r}`);const e=r.slice(2);return Ls(e.length%2===0?e:Cs(e))},xs=r=>{if(!Number.isSafeInteger(r)||r<0)throw new Error(`Received an invalid integer type: ${r}`);return`0x${r.toString(16)}`},Ft=r=>{const e=xs(r);return _r(e)};BigInt("0xffffffffffffffff");BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935");Xi.CURVE.n;Xi.CURVE.n/BigInt(2);BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");const Ms="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470";_r(Ms);const Ds="0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347";_r(Ds);const ks="0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421";_r(ks);Uint8Array.from([128]);BigInt(-1);BigInt(0);BigInt(1);BigInt(2);BigInt(3);BigInt(7);BigInt(8);BigInt(27);BigInt(28);BigInt(31);BigInt(32);BigInt(64);BigInt(128);BigInt(255);BigInt(256);BigInt(96);BigInt(100);BigInt(160);BigInt(224);BigInt(7922816251426434e13);BigInt(1461501637330903e33);BigInt(2695994666715064e52);BigInt(1e9);Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));var Di;(function(r){r.String="string",r.Bytes="view",r.Number="number"})(Di||(Di={}));var ki;(function(r){r.String="string",r.Bytes="view",r.JSON="json"})(ki||(ki={}));var ji;(function(r){r[r.Number=0]="Number",r[r.BigInt=1]="BigInt",r[r.Uint8Array=2]="Uint8Array",r[r.PrefixedHexString=3]="PrefixedHexString"})(ji||(ji={}));var Wi;(function(r){r[r.Deposit=0]="Deposit",r[r.Withdrawal=1]="Withdrawal",r[r.Consolidation=2]="Consolidation"})(Wi||(Wi={}));var gt;(function(r){r[r.Version=0]="Version",r[r.Balance=1]="Balance",r[r.Nonce=2]="Nonce",r[r.CodeHash=3]="CodeHash",r[r.CodeSize=4]="CodeSize"})(gt||(gt={}));Ft(gt.Version);Ft(gt.Balance);Ft(gt.Nonce);Ft(gt.CodeHash);Ft(gt.CodeSize);BigInt(256)**BigInt(31);var cn={exports:{}},nr={},ir={},Fi;function js(){if(Fi)return ir;Fi=1,Object.defineProperty(ir,"__esModule",{value:!0});function r(e){var t=4,n=e.length,s=n%t;if(!s)return e;var f=n,o=t-s,p=n+o,I=Buffer.alloc(p);for(I.write(e);o--;)I.write("=",f++);return I.toString()}return ir.default=r,ir}var Ui;function Ws(){if(Ui)return nr;Ui=1,Object.defineProperty(nr,"__esModule",{value:!0});var r=js();function e(p,I){return I===void 0&&(I="utf8"),Buffer.isBuffer(p)?s(p.toString("base64")):s(Buffer.from(p,I).toString("base64"))}function t(p,I){return I===void 0&&(I="utf8"),Buffer.from(n(p),"base64").toString(I)}function n(p){return p=p.toString(),r.default(p).replace(/\-/g,"+").replace(/_/g,"/")}function s(p){return p.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function f(p){return Buffer.from(n(p),"base64")}var o=e;return o.encode=e,o.decode=t,o.toBase64=n,o.fromBase64=s,o.toBuffer=f,nr.default=o,nr}var Bi;function Fs(){return Bi||(Bi=1,function(r){r.exports=Ws().default,r.exports.default=r.exports}(cn)),cn.exports}Fs();const Ee={MAINNET:"mainnet",TESTNET:"testnet",CYAN:"cyan",AQUA:"aqua",CELESTE:"celeste"},st={SAPPHIRE_DEVNET:"sapphire_devnet",SAPPHIRE_MAINNET:"sapphire_mainnet"};Ee.MAINNET+"",Ee.TESTNET+"",Ee.CYAN+"",Ee.AQUA+"",Ee.CELESTE+"";Ee.AQUA+"",st.SAPPHIRE_MAINNET,Ee.CELESTE+"",st.SAPPHIRE_MAINNET,Ee.CYAN+"",st.SAPPHIRE_MAINNET,Ee.MAINNET+"",st.SAPPHIRE_MAINNET,Ee.TESTNET+"",st.SAPPHIRE_DEVNET;Ee.MAINNET+"",Ee.TESTNET+"",Ee.CYAN+"",Ee.AQUA+"",Ee.CELESTE+"";st.SAPPHIRE_MAINNET+"",st.SAPPHIRE_DEVNET+"",Ee.MAINNET+"",Ee.TESTNET+"",Ee.CYAN+"",Ee.AQUA+"",Ee.CELESTE+"";Ee.MAINNET+"",Ee.TESTNET+"",Ee.CYAN+"",Ee.AQUA+"",Ee.CELESTE+"";function qi(r){let e=!1,t=0,n;try{n=window[r],e=!0,t=n.length;const s="__storage_test__";return n.setItem(s,s),n.removeItem(s),!0}catch(s){const f=s;return f&&(f.code===22||f.code===1014||f.name==="QuotaExceededError"||f.name==="NS_ERROR_DOM_QUOTA_REACHED")&&e&&t!==0}}class Us{constructor(){pe(this,"store",new Map)}getItem(e){return this.store.get(e)||null}setItem(e,t){this.store.set(e,t)}removeItem(e){this.store.delete(e)}}class Bs{constructor(e,t){pe(this,"storage",void 0),pe(this,"_storeKey",void 0),this.storage=t,this._storeKey=e;try{t.getItem(e)||this.resetStore()}catch{}}static getInstance(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"local";if(!this.instanceMap.has(e)){let n;t==="local"&&qi("localStorage")?n=window.localStorage:t==="session"&&qi("sessionStorage")?n=window.sessionStorage:n=new Us,this.instanceMap.set(e,new this(e,n))}return this.instanceMap.get(e)}toJSON(){return this.storage.getItem(this._storeKey)}resetStore(){const e=this.getStore();return this.storage.removeItem(this._storeKey),e}getStore(){return JSON.parse(this.storage.getItem(this._storeKey)||"{}")}get(e){return JSON.parse(this.storage.getItem(this._storeKey)||"{}")[e]}set(e,t){const n=JSON.parse(this.storage.getItem(this._storeKey)||"{}");n[e]=t,this.storage.setItem(this._storeKey,JSON.stringify(n))}}pe(Bs,"instanceMap",new Map);$e($e({},st),Ee);var qs=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,dn=Math.ceil,Be=Math.floor,je="[BigNumber Error] ",$i=je+"Number primitive has more than 15 significant digits: ",Ke=1e14,ge=14,hn=9007199254740991,pn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ot=1e7,Pe=1e9;function fo(r){var e,t,n,s=_.prototype={constructor:_,toString:null,valueOf:null},f=new _(1),o=20,p=4,I=-7,A=21,D=-1e7,F=1e7,m=!1,B=1,q=0,O={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",P=!0;function _(i,d){var a,u,c,l,T,y,v,M,b=this;if(!(b instanceof _))return new _(i,d);if(d==null){if(i&&i._isBigNumber===!0){b.s=i.s,!i.c||i.e>F?b.c=b.e=null:i.e<D?b.c=[b.e=0]:(b.e=i.e,b.c=i.c.slice());return}if((y=typeof i=="number")&&i*0==0){if(b.s=1/i<0?(i=-i,-1):1,i===~~i){for(l=0,T=i;T>=10;T/=10,l++);l>F?b.c=b.e=null:(b.e=l,b.c=[i]);return}M=String(i)}else{if(!qs.test(M=String(i)))return n(b,M,y);b.s=M.charCodeAt(0)==45?(M=M.slice(1),-1):1}(l=M.indexOf("."))>-1&&(M=M.replace(".","")),(T=M.search(/e/i))>0?(l<0&&(l=T),l+=+M.slice(T+1),M=M.substring(0,T)):l<0&&(l=M.length)}else{if(Re(d,2,E.length,"Base"),d==10&&P)return b=new _(i),ae(b,o+b.e+1,p);if(M=String(i),y=typeof i=="number"){if(i*0!=0)return n(b,M,y,d);if(b.s=1/i<0?(M=M.slice(1),-1):1,_.DEBUG&&M.replace(/^0\.0*|\./,"").length>15)throw Error($i+i)}else b.s=M.charCodeAt(0)===45?(M=M.slice(1),-1):1;for(a=E.slice(0,d),l=T=0,v=M.length;T<v;T++)if(a.indexOf(u=M.charAt(T))<0){if(u=="."){if(T>l){l=v;continue}}else if(!c&&(M==M.toUpperCase()&&(M=M.toLowerCase())||M==M.toLowerCase()&&(M=M.toUpperCase()))){c=!0,T=-1,l=0;continue}return n(b,String(i),y,d)}y=!1,M=t(M,d,10,b.s),(l=M.indexOf("."))>-1?M=M.replace(".",""):l=M.length}for(T=0;M.charCodeAt(T)===48;T++);for(v=M.length;M.charCodeAt(--v)===48;);if(M=M.slice(T,++v)){if(v-=T,y&&_.DEBUG&&v>15&&(i>hn||i!==Be(i)))throw Error($i+b.s*i);if((l=l-T-1)>F)b.c=b.e=null;else if(l<D)b.c=[b.e=0];else{if(b.e=l,b.c=[],T=(l+1)%ge,l<0&&(T+=ge),T<v){for(T&&b.c.push(+M.slice(0,T)),v-=ge;T<v;)b.c.push(+M.slice(T,T+=ge));T=ge-(M=M.slice(T)).length}else T-=v;for(;T--;M+="0");b.c.push(+M)}}else b.c=[b.e=0]}_.clone=fo,_.ROUND_UP=0,_.ROUND_DOWN=1,_.ROUND_CEIL=2,_.ROUND_FLOOR=3,_.ROUND_HALF_UP=4,_.ROUND_HALF_DOWN=5,_.ROUND_HALF_EVEN=6,_.ROUND_HALF_CEIL=7,_.ROUND_HALF_FLOOR=8,_.EUCLID=9,_.config=_.set=function(i){var d,a;if(i!=null)if(typeof i=="object"){if(i.hasOwnProperty(d="DECIMAL_PLACES")&&(a=i[d],Re(a,0,Pe,d),o=a),i.hasOwnProperty(d="ROUNDING_MODE")&&(a=i[d],Re(a,0,8,d),p=a),i.hasOwnProperty(d="EXPONENTIAL_AT")&&(a=i[d],a&&a.pop?(Re(a[0],-Pe,0,d),Re(a[1],0,Pe,d),I=a[0],A=a[1]):(Re(a,-Pe,Pe,d),I=-(A=a<0?-a:a))),i.hasOwnProperty(d="RANGE"))if(a=i[d],a&&a.pop)Re(a[0],-Pe,-1,d),Re(a[1],1,Pe,d),D=a[0],F=a[1];else if(Re(a,-Pe,Pe,d),a)D=-(F=a<0?-a:a);else throw Error(je+d+" cannot be zero: "+a);if(i.hasOwnProperty(d="CRYPTO"))if(a=i[d],a===!!a)if(a)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))m=a;else throw m=!a,Error(je+"crypto unavailable");else m=a;else throw Error(je+d+" not true or false: "+a);if(i.hasOwnProperty(d="MODULO_MODE")&&(a=i[d],Re(a,0,9,d),B=a),i.hasOwnProperty(d="POW_PRECISION")&&(a=i[d],Re(a,0,Pe,d),q=a),i.hasOwnProperty(d="FORMAT"))if(a=i[d],typeof a=="object")O=a;else throw Error(je+d+" not an object: "+a);if(i.hasOwnProperty(d="ALPHABET"))if(a=i[d],typeof a=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(a))P=a.slice(0,10)=="0123456789",E=a;else throw Error(je+d+" invalid: "+a)}else throw Error(je+"Object expected: "+i);return{DECIMAL_PLACES:o,ROUNDING_MODE:p,EXPONENTIAL_AT:[I,A],RANGE:[D,F],CRYPTO:m,MODULO_MODE:B,POW_PRECISION:q,FORMAT:O,ALPHABET:E}},_.isBigNumber=function(i){if(!i||i._isBigNumber!==!0)return!1;if(!_.DEBUG)return!0;var d,a,u=i.c,c=i.e,l=i.s;e:if({}.toString.call(u)=="[object Array]"){if((l===1||l===-1)&&c>=-Pe&&c<=Pe&&c===Be(c)){if(u[0]===0){if(c===0&&u.length===1)return!0;break e}if(d=(c+1)%ge,d<1&&(d+=ge),String(u[0]).length==d){for(d=0;d<u.length;d++)if(a=u[d],a<0||a>=Ke||a!==Be(a))break e;if(a!==0)return!0}}}else if(u===null&&c===null&&(l===null||l===1||l===-1))return!0;throw Error(je+"Invalid BigNumber: "+i)},_.maximum=_.max=function(){return te(arguments,-1)},_.minimum=_.min=function(){return te(arguments,1)},_.random=function(){var i=9007199254740992,d=Math.random()*i&2097151?function(){return Be(Math.random()*i)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(a){var u,c,l,T,y,v=0,M=[],b=new _(f);if(a==null?a=o:Re(a,0,Pe),T=dn(a/ge),m)if(crypto.getRandomValues){for(u=crypto.getRandomValues(new Uint32Array(T*=2));v<T;)y=u[v]*131072+(u[v+1]>>>11),y>=9e15?(c=crypto.getRandomValues(new Uint32Array(2)),u[v]=c[0],u[v+1]=c[1]):(M.push(y%1e14),v+=2);v=T/2}else if(crypto.randomBytes){for(u=crypto.randomBytes(T*=7);v<T;)y=(u[v]&31)*281474976710656+u[v+1]*1099511627776+u[v+2]*4294967296+u[v+3]*16777216+(u[v+4]<<16)+(u[v+5]<<8)+u[v+6],y>=9e15?crypto.randomBytes(7).copy(u,v):(M.push(y%1e14),v+=7);v=T/7}else throw m=!1,Error(je+"crypto unavailable");if(!m)for(;v<T;)y=d(),y<9e15&&(M[v++]=y%1e14);for(T=M[--v],a%=ge,T&&a&&(y=pn[ge-a],M[v]=Be(T/y)*y);M[v]===0;M.pop(),v--);if(v<0)M=[l=0];else{for(l=-1;M[0]===0;M.splice(0,1),l-=ge);for(v=1,y=M[0];y>=10;y/=10,v++);v<ge&&(l-=ge-v)}return b.e=l,b.c=M,b}}(),_.sum=function(){for(var i=1,d=arguments,a=new _(d[0]);i<d.length;)a=a.plus(d[i++]);return a},t=function(){var i="0123456789";function d(a,u,c,l){for(var T,y=[0],v,M=0,b=a.length;M<b;){for(v=y.length;v--;y[v]*=u);for(y[0]+=l.indexOf(a.charAt(M++)),T=0;T<y.length;T++)y[T]>c-1&&(y[T+1]==null&&(y[T+1]=0),y[T+1]+=y[T]/c|0,y[T]%=c)}return y.reverse()}return function(a,u,c,l,T){var y,v,M,b,k,g,W,V,j=a.indexOf("."),re=o,Q=p;for(j>=0&&(b=q,q=0,a=a.replace(".",""),V=new _(u),g=V.pow(a.length-j),q=b,V.c=d(Ze(Ue(g.c),g.e,"0"),10,c,i),V.e=V.c.length),W=d(a,u,c,T?(y=E,i):(y=i,E)),M=b=W.length;W[--b]==0;W.pop());if(!W[0])return y.charAt(0);if(j<0?--M:(g.c=W,g.e=M,g.s=l,g=e(g,V,re,Q,c),W=g.c,k=g.r,M=g.e),v=M+re+1,j=W[v],b=c/2,k=k||v<0||W[v+1]!=null,k=Q<4?(j!=null||k)&&(Q==0||Q==(g.s<0?3:2)):j>b||j==b&&(Q==4||k||Q==6&&W[v-1]&1||Q==(g.s<0?8:7)),v<1||!W[0])a=k?Ze(y.charAt(1),-re,y.charAt(0)):y.charAt(0);else{if(W.length=v,k)for(--c;++W[--v]>c;)W[v]=0,v||(++M,W=[1].concat(W));for(b=W.length;!W[--b];);for(j=0,a="";j<=b;a+=y.charAt(W[j++]));a=Ze(a,M,y.charAt(0))}return a}}(),e=function(){function i(u,c,l){var T,y,v,M,b=0,k=u.length,g=c%ot,W=c/ot|0;for(u=u.slice();k--;)v=u[k]%ot,M=u[k]/ot|0,T=W*v+M*g,y=g*v+T%ot*ot+b,b=(y/l|0)+(T/ot|0)+W*M,u[k]=y%l;return b&&(u=[b].concat(u)),u}function d(u,c,l,T){var y,v;if(l!=T)v=l>T?1:-1;else for(y=v=0;y<l;y++)if(u[y]!=c[y]){v=u[y]>c[y]?1:-1;break}return v}function a(u,c,l,T){for(var y=0;l--;)u[l]-=y,y=u[l]<c[l]?1:0,u[l]=y*T+u[l]-c[l];for(;!u[0]&&u.length>1;u.splice(0,1));}return function(u,c,l,T,y){var v,M,b,k,g,W,V,j,re,Q,se,le,H,z,oe,ue,ce,N=u.s==c.s?1:-1,L=u.c,U=c.c;if(!L||!L[0]||!U||!U[0])return new _(!u.s||!c.s||(L?U&&L[0]==U[0]:!U)?NaN:L&&L[0]==0||!U?N*0:N/0);for(j=new _(N),re=j.c=[],M=u.e-c.e,N=l+M+1,y||(y=Ke,M=qe(u.e/ge)-qe(c.e/ge),N=N/ge|0),b=0;U[b]==(L[b]||0);b++);if(U[b]>(L[b]||0)&&M--,N<0)re.push(1),k=!0;else{for(z=L.length,ue=U.length,b=0,N+=2,g=Be(y/(U[0]+1)),g>1&&(U=i(U,g,y),L=i(L,g,y),ue=U.length,z=L.length),H=ue,Q=L.slice(0,ue),se=Q.length;se<ue;Q[se++]=0);ce=U.slice(),ce=[0].concat(ce),oe=U[0],U[1]>=y/2&&oe++;do{if(g=0,v=d(U,Q,ue,se),v<0){if(le=Q[0],ue!=se&&(le=le*y+(Q[1]||0)),g=Be(le/oe),g>1)for(g>=y&&(g=y-1),W=i(U,g,y),V=W.length,se=Q.length;d(W,Q,V,se)==1;)g--,a(W,ue<V?ce:U,V,y),V=W.length,v=1;else g==0&&(v=g=1),W=U.slice(),V=W.length;if(V<se&&(W=[0].concat(W)),a(Q,W,se,y),se=Q.length,v==-1)for(;d(U,Q,ue,se)<1;)g++,a(Q,ue<se?ce:U,se,y),se=Q.length}else v===0&&(g++,Q=[0]);re[b++]=g,Q[0]?Q[se++]=L[H]||0:(Q=[L[H]],se=1)}while((H++<z||Q[0]!=null)&&N--);k=Q[0]!=null,re[0]||re.splice(0,1)}if(y==Ke){for(b=1,N=re[0];N>=10;N/=10,b++);ae(j,l+(j.e=b+M*ge-1)+1,T,k)}else j.e=M,j.r=+k;return j}}();function R(i,d,a,u){var c,l,T,y,v;if(a==null?a=p:Re(a,0,8),!i.c)return i.toString();if(c=i.c[0],T=i.e,d==null)v=Ue(i.c),v=u==1||u==2&&(T<=I||T>=A)?sr(v,T):Ze(v,T,"0");else if(i=ae(new _(i),d,a),l=i.e,v=Ue(i.c),y=v.length,u==1||u==2&&(d<=l||l<=I)){for(;y<d;v+="0",y++);v=sr(v,l)}else if(d-=T+(u===2&&l>T),v=Ze(v,l,"0"),l+1>y){if(--d>0)for(v+=".";d--;v+="0");}else if(d+=l-y,d>0)for(l+1==y&&(v+=".");d--;v+="0");return i.s<0&&c?"-"+v:v}function te(i,d){for(var a,u,c=1,l=new _(i[0]);c<i.length;c++)u=new _(i[c]),(!u.s||(a=dt(l,u))===d||a===0&&l.s===d)&&(l=u);return l}function J(i,d,a){for(var u=1,c=d.length;!d[--c];d.pop());for(c=d[0];c>=10;c/=10,u++);return(a=u+a*ge-1)>F?i.c=i.e=null:a<D?i.c=[i.e=0]:(i.e=a,i.c=d),i}n=function(){var i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,d=/^([^.]+)\.$/,a=/^\.([^.]+)$/,u=/^-?(Infinity|NaN)$/,c=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(l,T,y,v){var M,b=y?T:T.replace(c,"");if(u.test(b))l.s=isNaN(b)?null:b<0?-1:1;else{if(!y&&(b=b.replace(i,function(k,g,W){return M=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,!v||v==M?g:k}),v&&(M=v,b=b.replace(d,"$1").replace(a,"0.$1")),T!=b))return new _(b,M);if(_.DEBUG)throw Error(je+"Not a"+(v?" base "+v:"")+" number: "+T);l.s=null}l.c=l.e=null}}();function ae(i,d,a,u){var c,l,T,y,v,M,b,k=i.c,g=pn;if(k){e:{for(c=1,y=k[0];y>=10;y/=10,c++);if(l=d-c,l<0)l+=ge,T=d,v=k[M=0],b=Be(v/g[c-T-1]%10);else if(M=dn((l+1)/ge),M>=k.length)if(u){for(;k.length<=M;k.push(0));v=b=0,c=1,l%=ge,T=l-ge+1}else break e;else{for(v=y=k[M],c=1;y>=10;y/=10,c++);l%=ge,T=l-ge+c,b=T<0?0:Be(v/g[c-T-1]%10)}if(u=u||d<0||k[M+1]!=null||(T<0?v:v%g[c-T-1]),u=a<4?(b||u)&&(a==0||a==(i.s<0?3:2)):b>5||b==5&&(a==4||u||a==6&&(l>0?T>0?v/g[c-T]:0:k[M-1])%10&1||a==(i.s<0?8:7)),d<1||!k[0])return k.length=0,u?(d-=i.e+1,k[0]=g[(ge-d%ge)%ge],i.e=-d||0):k[0]=i.e=0,i;if(l==0?(k.length=M,y=1,M--):(k.length=M+1,y=g[ge-l],k[M]=T>0?Be(v/g[c-T]%g[T])*y:0),u)for(;;)if(M==0){for(l=1,T=k[0];T>=10;T/=10,l++);for(T=k[0]+=y,y=1;T>=10;T/=10,y++);l!=y&&(i.e++,k[0]==Ke&&(k[0]=1));break}else{if(k[M]+=y,k[M]!=Ke)break;k[M--]=0,y=1}for(l=k.length;k[--l]===0;k.pop());}i.e>F?i.c=i.e=null:i.e<D&&(i.c=[i.e=0])}return i}function he(i){var d,a=i.e;return a===null?i.toString():(d=Ue(i.c),d=a<=I||a>=A?sr(d,a):Ze(d,a,"0"),i.s<0?"-"+d:d)}return s.absoluteValue=s.abs=function(){var i=new _(this);return i.s<0&&(i.s=1),i},s.comparedTo=function(i,d){return dt(this,new _(i,d))},s.decimalPlaces=s.dp=function(i,d){var a,u,c,l=this;if(i!=null)return Re(i,0,Pe),d==null?d=p:Re(d,0,8),ae(new _(l),i+l.e+1,d);if(!(a=l.c))return null;if(u=((c=a.length-1)-qe(this.e/ge))*ge,c=a[c])for(;c%10==0;c/=10,u--);return u<0&&(u=0),u},s.dividedBy=s.div=function(i,d){return e(this,new _(i,d),o,p)},s.dividedToIntegerBy=s.idiv=function(i,d){return e(this,new _(i,d),0,1)},s.exponentiatedBy=s.pow=function(i,d){var a,u,c,l,T,y,v,M,b,k=this;if(i=new _(i),i.c&&!i.isInteger())throw Error(je+"Exponent not an integer: "+he(i));if(d!=null&&(d=new _(d)),y=i.e>14,!k.c||!k.c[0]||k.c[0]==1&&!k.e&&k.c.length==1||!i.c||!i.c[0])return b=new _(Math.pow(+he(k),y?i.s*(2-or(i)):+he(i))),d?b.mod(d):b;if(v=i.s<0,d){if(d.c?!d.c[0]:!d.s)return new _(NaN);u=!v&&k.isInteger()&&d.isInteger(),u&&(k=k.mod(d))}else{if(i.e>9&&(k.e>0||k.e<-1||(k.e==0?k.c[0]>1||y&&k.c[1]>=24e7:k.c[0]<8e13||y&&k.c[0]<=9999975e7)))return l=k.s<0&&or(i)?-0:0,k.e>-1&&(l=1/l),new _(v?1/l:l);q&&(l=dn(q/ge+2))}for(y?(a=new _(.5),v&&(i.s=1),M=or(i)):(c=Math.abs(+he(i)),M=c%2),b=new _(f);;){if(M){if(b=b.times(k),!b.c)break;l?b.c.length>l&&(b.c.length=l):u&&(b=b.mod(d))}if(c){if(c=Be(c/2),c===0)break;M=c%2}else if(i=i.times(a),ae(i,i.e+1,1),i.e>14)M=or(i);else{if(c=+he(i),c===0)break;M=c%2}k=k.times(k),l?k.c&&k.c.length>l&&(k.c.length=l):u&&(k=k.mod(d))}return u?b:(v&&(b=f.div(b)),d?b.mod(d):l?ae(b,q,p,T):b)},s.integerValue=function(i){var d=new _(this);return i==null?i=p:Re(i,0,8),ae(d,d.e+1,i)},s.isEqualTo=s.eq=function(i,d){return dt(this,new _(i,d))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(i,d){return dt(this,new _(i,d))>0},s.isGreaterThanOrEqualTo=s.gte=function(i,d){return(d=dt(this,new _(i,d)))===1||d===0},s.isInteger=function(){return!!this.c&&qe(this.e/ge)>this.c.length-2},s.isLessThan=s.lt=function(i,d){return dt(this,new _(i,d))<0},s.isLessThanOrEqualTo=s.lte=function(i,d){return(d=dt(this,new _(i,d)))===-1||d===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(i,d){var a,u,c,l,T=this,y=T.s;if(i=new _(i,d),d=i.s,!y||!d)return new _(NaN);if(y!=d)return i.s=-d,T.plus(i);var v=T.e/ge,M=i.e/ge,b=T.c,k=i.c;if(!v||!M){if(!b||!k)return b?(i.s=-d,i):new _(k?T:NaN);if(!b[0]||!k[0])return k[0]?(i.s=-d,i):new _(b[0]?T:p==3?-0:0)}if(v=qe(v),M=qe(M),b=b.slice(),y=v-M){for((l=y<0)?(y=-y,c=b):(M=v,c=k),c.reverse(),d=y;d--;c.push(0));c.reverse()}else for(u=(l=(y=b.length)<(d=k.length))?y:d,y=d=0;d<u;d++)if(b[d]!=k[d]){l=b[d]<k[d];break}if(l&&(c=b,b=k,k=c,i.s=-i.s),d=(u=k.length)-(a=b.length),d>0)for(;d--;b[a++]=0);for(d=Ke-1;u>y;){if(b[--u]<k[u]){for(a=u;a&&!b[--a];b[a]=d);--b[a],b[u]+=Ke}b[u]-=k[u]}for(;b[0]==0;b.splice(0,1),--M);return b[0]?J(i,b,M):(i.s=p==3?-1:1,i.c=[i.e=0],i)},s.modulo=s.mod=function(i,d){var a,u,c=this;return i=new _(i,d),!c.c||!i.s||i.c&&!i.c[0]?new _(NaN):!i.c||c.c&&!c.c[0]?new _(c):(B==9?(u=i.s,i.s=1,a=e(c,i,0,3),i.s=u,a.s*=u):a=e(c,i,0,B),i=c.minus(a.times(i)),!i.c[0]&&B==1&&(i.s=c.s),i)},s.multipliedBy=s.times=function(i,d){var a,u,c,l,T,y,v,M,b,k,g,W,V,j,re,Q=this,se=Q.c,le=(i=new _(i,d)).c;if(!se||!le||!se[0]||!le[0])return!Q.s||!i.s||se&&!se[0]&&!le||le&&!le[0]&&!se?i.c=i.e=i.s=null:(i.s*=Q.s,!se||!le?i.c=i.e=null:(i.c=[0],i.e=0)),i;for(u=qe(Q.e/ge)+qe(i.e/ge),i.s*=Q.s,v=se.length,k=le.length,v<k&&(V=se,se=le,le=V,c=v,v=k,k=c),c=v+k,V=[];c--;V.push(0));for(j=Ke,re=ot,c=k;--c>=0;){for(a=0,g=le[c]%re,W=le[c]/re|0,T=v,l=c+T;l>c;)M=se[--T]%re,b=se[T]/re|0,y=W*M+b*g,M=g*M+y%re*re+V[l]+a,a=(M/j|0)+(y/re|0)+W*b,V[l--]=M%j;V[l]=a}return a?++u:V.splice(0,1),J(i,V,u)},s.negated=function(){var i=new _(this);return i.s=-i.s||null,i},s.plus=function(i,d){var a,u=this,c=u.s;if(i=new _(i,d),d=i.s,!c||!d)return new _(NaN);if(c!=d)return i.s=-d,u.minus(i);var l=u.e/ge,T=i.e/ge,y=u.c,v=i.c;if(!l||!T){if(!y||!v)return new _(c/0);if(!y[0]||!v[0])return v[0]?i:new _(y[0]?u:c*0)}if(l=qe(l),T=qe(T),y=y.slice(),c=l-T){for(c>0?(T=l,a=v):(c=-c,a=y),a.reverse();c--;a.push(0));a.reverse()}for(c=y.length,d=v.length,c-d<0&&(a=v,v=y,y=a,d=c),c=0;d;)c=(y[--d]=y[d]+v[d]+c)/Ke|0,y[d]=Ke===y[d]?0:y[d]%Ke;return c&&(y=[c].concat(y),++T),J(i,y,T)},s.precision=s.sd=function(i,d){var a,u,c,l=this;if(i!=null&&i!==!!i)return Re(i,1,Pe),d==null?d=p:Re(d,0,8),ae(new _(l),i,d);if(!(a=l.c))return null;if(c=a.length-1,u=c*ge+1,c=a[c]){for(;c%10==0;c/=10,u--);for(c=a[0];c>=10;c/=10,u++);}return i&&l.e+1>u&&(u=l.e+1),u},s.shiftedBy=function(i){return Re(i,-hn,hn),this.times("1e"+i)},s.squareRoot=s.sqrt=function(){var i,d,a,u,c,l=this,T=l.c,y=l.s,v=l.e,M=o+4,b=new _("0.5");if(y!==1||!T||!T[0])return new _(!y||y<0&&(!T||T[0])?NaN:T?l:1/0);if(y=Math.sqrt(+he(l)),y==0||y==1/0?(d=Ue(T),(d.length+v)%2==0&&(d+="0"),y=Math.sqrt(+d),v=qe((v+1)/2)-(v<0||v%2),y==1/0?d="5e"+v:(d=y.toExponential(),d=d.slice(0,d.indexOf("e")+1)+v),a=new _(d)):a=new _(y+""),a.c[0]){for(v=a.e,y=v+M,y<3&&(y=0);;)if(c=a,a=b.times(c.plus(e(l,c,M,1))),Ue(c.c).slice(0,y)===(d=Ue(a.c)).slice(0,y))if(a.e<v&&--y,d=d.slice(y-3,y+1),d=="9999"||!u&&d=="4999"){if(!u&&(ae(c,c.e+o+2,0),c.times(c).eq(l))){a=c;break}M+=4,y+=4,u=1}else{(!+d||!+d.slice(1)&&d.charAt(0)=="5")&&(ae(a,a.e+o+2,1),i=!a.times(a).eq(l));break}}return ae(a,a.e+o+1,p,i)},s.toExponential=function(i,d){return i!=null&&(Re(i,0,Pe),i++),R(this,i,d,1)},s.toFixed=function(i,d){return i!=null&&(Re(i,0,Pe),i=i+this.e+1),R(this,i,d)},s.toFormat=function(i,d,a){var u,c=this;if(a==null)i!=null&&d&&typeof d=="object"?(a=d,d=null):i&&typeof i=="object"?(a=i,i=d=null):a=O;else if(typeof a!="object")throw Error(je+"Argument not an object: "+a);if(u=c.toFixed(i,d),c.c){var l,T=u.split("."),y=+a.groupSize,v=+a.secondaryGroupSize,M=a.groupSeparator||"",b=T[0],k=T[1],g=c.s<0,W=g?b.slice(1):b,V=W.length;if(v&&(l=y,y=v,v=l,V-=l),y>0&&V>0){for(l=V%y||y,b=W.substr(0,l);l<V;l+=y)b+=M+W.substr(l,y);v>0&&(b+=M+W.slice(l)),g&&(b="-"+b)}u=k?b+(a.decimalSeparator||"")+((v=+a.fractionGroupSize)?k.replace(new RegExp("\\d{"+v+"}\\B","g"),"$&"+(a.fractionGroupSeparator||"")):k):b}return(a.prefix||"")+u+(a.suffix||"")},s.toFraction=function(i){var d,a,u,c,l,T,y,v,M,b,k,g,W=this,V=W.c;if(i!=null&&(y=new _(i),!y.isInteger()&&(y.c||y.s!==1)||y.lt(f)))throw Error(je+"Argument "+(y.isInteger()?"out of range: ":"not an integer: ")+he(y));if(!V)return new _(W);for(d=new _(f),M=a=new _(f),u=v=new _(f),g=Ue(V),l=d.e=g.length-W.e-1,d.c[0]=pn[(T=l%ge)<0?ge+T:T],i=!i||y.comparedTo(d)>0?l>0?d:M:y,T=F,F=1/0,y=new _(g),v.c[0]=0;b=e(y,d,0,1),c=a.plus(b.times(u)),c.comparedTo(i)!=1;)a=u,u=c,M=v.plus(b.times(c=M)),v=c,d=y.minus(b.times(c=d)),y=c;return c=e(i.minus(a),u,0,1),v=v.plus(c.times(M)),a=a.plus(c.times(u)),v.s=M.s=W.s,l=l*2,k=e(M,u,l,p).minus(W).abs().comparedTo(e(v,a,l,p).minus(W).abs())<1?[M,u]:[v,a],F=T,k},s.toNumber=function(){return+he(this)},s.toPrecision=function(i,d){return i!=null&&Re(i,1,Pe),R(this,i,d,2)},s.toString=function(i){var d,a=this,u=a.s,c=a.e;return c===null?u?(d="Infinity",u<0&&(d="-"+d)):d="NaN":(i==null?d=c<=I||c>=A?sr(Ue(a.c),c):Ze(Ue(a.c),c,"0"):i===10&&P?(a=ae(new _(a),o+c+1,p),d=Ze(Ue(a.c),a.e,"0")):(Re(i,2,E.length,"Base"),d=t(Ze(Ue(a.c),c,"0"),10,i,u,!0)),u<0&&a.c[0]&&(d="-"+d)),d},s.valueOf=s.toJSON=function(){return he(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,r!=null&&_.set(r),_}function qe(r){var e=r|0;return r>0||r===e?e:e-1}function Ue(r){for(var e,t,n=1,s=r.length,f=r[0]+"";n<s;){for(e=r[n++]+"",t=ge-e.length;t--;e="0"+e);f+=e}for(s=f.length;f.charCodeAt(--s)===48;);return f.slice(0,s+1||1)}function dt(r,e){var t,n,s=r.c,f=e.c,o=r.s,p=e.s,I=r.e,A=e.e;if(!o||!p)return null;if(t=s&&!s[0],n=f&&!f[0],t||n)return t?n?0:-p:o;if(o!=p)return o;if(t=o<0,n=I==A,!s||!f)return n?0:!s^t?1:-1;if(!n)return I>A^t?1:-1;for(p=(I=s.length)<(A=f.length)?I:A,o=0;o<p;o++)if(s[o]!=f[o])return s[o]>f[o]^t?1:-1;return I==A?0:I>A^t?1:-1}function Re(r,e,t,n){if(r<e||r>t||r!==Be(r))throw Error(je+(n||"Argument")+(typeof r=="number"?r<e||r>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(r))}function or(r){var e=r.c.length-1;return qe(r.e/ge)==e&&r.c[e]%2!=0}function sr(r,e){return(r.length>1?r.charAt(0)+"."+r.slice(1):r)+(e<0?"e":"e+")+e}function Ze(r,e,t){var n,s;if(e<0){for(s=t+".";++e;s+=t);r=s+r}else if(n=r.length,++e>n){for(s=t,e-=n;--e;s+=t);r+=s}else e<n&&(r=r.slice(0,e)+"."+r.slice(e));return r}fo();class $s extends Error{}$s.prototype.name="InvalidTokenError";const ar={IFRAME_STATUS:"iframe_status",CLOSE_WINDOW:"close_window",USER_LOGGED_IN:"user_logged_in",USER_LOGGED_OUT:"user_logged_out"},tt={LOGOUT:"logout",WALLET_INSTANCE_ID:"wallet_instance_id",USER_INFO:"user_info",SET_PROVIDER:"set_provider",TOPUP:"topup",IFRAME_STATUS:"iframe_status",CLOSED_WINDOW:"closed_window",WINDOW_BLOCKED:"window_blocked",GET_PROVIDER_STATE:"get_provider_state",LOGIN_WITH_PRIVATE_KEY:"login_with_private_key",SHOW_WALLET_CONNECT:"show_wallet_connect",SHOW_CHECKOUT:"show_checkout",SHOW_WALLET_UI:"show_wallet_ui",LOGIN_WITH_SESSION_ID:"login_with_session_id"},Hs={GET_PROVIDER_STATE:"wallet_get_provider_state"},gn={ACCOUNTS_CHANGED:"wallet_accounts_changed",CHAIN_CHANGED:"wallet_chain_changed",UNLOCK_STATE_CHANGED:"wallet_unlock_state_changed"};function Gs(r){return function(t,n,s){s(f=>{n.error&&cr.warn(`Error in RPC response:
3
+ `,n),!t.isTorusInternal&&(cr.info(`RPC (${r.origin}):`,t,"->",n),f())})}}var bn={},ht={},Hi;function In(){if(Hi)return ht;Hi=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.EthereumProviderError=ht.EthereumRpcError=void 0;const r=oo();class e extends Error{constructor(o,p,I){if(!Number.isInteger(o))throw new Error('"code" must be an integer.');if(!p||typeof p!="string")throw new Error('"message" must be a nonempty string.');super(p),this.code=o,I!==void 0&&(this.data=I)}serialize(){const o={code:this.code,message:this.message};return this.data!==void 0&&(o.data=this.data),this.stack&&(o.stack=this.stack),o}toString(){return r.default(this.serialize(),s,2)}}ht.EthereumRpcError=e;class t extends e{constructor(o,p,I){if(!n(o))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(o,p,I)}}ht.EthereumProviderError=t;function n(f){return Number.isInteger(f)&&f>=1e3&&f<=4999}function s(f,o){if(o!=="[Circular]")return o}return ht}var wn={},pt={},Gi;function On(){return Gi||(Gi=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.errorValues=pt.errorCodes=void 0,pt.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},pt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}),pt}var zi;function co(){return zi||(zi=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.serializeError=r.isValidCode=r.getMessageFromCode=r.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=On(),t=In(),n=e.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",f={code:n,message:o(n)};r.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(m,B=s){if(Number.isInteger(m)){const q=m.toString();if(F(e.errorValues,q))return e.errorValues[q].message;if(A(m))return r.JSON_RPC_SERVER_ERROR_MESSAGE}return B}r.getMessageFromCode=o;function p(m){if(!Number.isInteger(m))return!1;const B=m.toString();return!!(e.errorValues[B]||A(m))}r.isValidCode=p;function I(m,{fallbackError:B=f,shouldIncludeStack:q=!1}={}){var O,E;if(!B||!Number.isInteger(B.code)||typeof B.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(m instanceof t.EthereumRpcError)return m.serialize();const P={};if(m&&typeof m=="object"&&!Array.isArray(m)&&F(m,"code")&&p(m.code)){const R=m;P.code=R.code,R.message&&typeof R.message=="string"?(P.message=R.message,F(R,"data")&&(P.data=R.data)):(P.message=o(P.code),P.data={originalError:D(m)})}else{P.code=B.code;const R=(O=m)===null||O===void 0?void 0:O.message;P.message=R&&typeof R=="string"?R:B.message,P.data={originalError:D(m)}}const _=(E=m)===null||E===void 0?void 0:E.stack;return q&&m&&_&&typeof _=="string"&&(P.stack=_),P}r.serializeError=I;function A(m){return m>=-32099&&m<=-32e3}function D(m){return m&&typeof m=="object"&&!Array.isArray(m)?Object.assign({},m):m}function F(m,B){return Object.prototype.hasOwnProperty.call(m,B)}}(wn)),wn}var Ct={},Ki;function zs(){if(Ki)return Ct;Ki=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.ethErrors=void 0;const r=In(),e=co(),t=On();Ct.ethErrors={rpc:{parse:o=>n(t.errorCodes.rpc.parse,o),invalidRequest:o=>n(t.errorCodes.rpc.invalidRequest,o),invalidParams:o=>n(t.errorCodes.rpc.invalidParams,o),methodNotFound:o=>n(t.errorCodes.rpc.methodNotFound,o),internal:o=>n(t.errorCodes.rpc.internal,o),server:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:p}=o;if(!Number.isInteger(p)||p>-32005||p<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return n(p,o)},invalidInput:o=>n(t.errorCodes.rpc.invalidInput,o),resourceNotFound:o=>n(t.errorCodes.rpc.resourceNotFound,o),resourceUnavailable:o=>n(t.errorCodes.rpc.resourceUnavailable,o),transactionRejected:o=>n(t.errorCodes.rpc.transactionRejected,o),methodNotSupported:o=>n(t.errorCodes.rpc.methodNotSupported,o),limitExceeded:o=>n(t.errorCodes.rpc.limitExceeded,o)},provider:{userRejectedRequest:o=>s(t.errorCodes.provider.userRejectedRequest,o),unauthorized:o=>s(t.errorCodes.provider.unauthorized,o),unsupportedMethod:o=>s(t.errorCodes.provider.unsupportedMethod,o),disconnected:o=>s(t.errorCodes.provider.disconnected,o),chainDisconnected:o=>s(t.errorCodes.provider.chainDisconnected,o),custom:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:p,message:I,data:A}=o;if(!I||typeof I!="string")throw new Error('"message" must be a nonempty string');return new r.EthereumProviderError(p,I,A)}}};function n(o,p){const[I,A]=f(p);return new r.EthereumRpcError(o,I||e.getMessageFromCode(o),A)}function s(o,p){const[I,A]=f(p);return new r.EthereumProviderError(o,I||e.getMessageFromCode(o),A)}function f(o){if(o){if(typeof o=="string")return[o];if(typeof o=="object"&&!Array.isArray(o)){const{message:p,data:I}=o;if(p&&typeof p!="string")throw new Error("Must specify string message.");return[p||void 0,I]}}return[]}return Ct}var Vi;function Ks(){return Vi||(Vi=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.getMessageFromCode=r.serializeError=r.EthereumProviderError=r.EthereumRpcError=r.ethErrors=r.errorCodes=void 0;const e=In();Object.defineProperty(r,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(r,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const t=co();Object.defineProperty(r,"serializeError",{enumerable:!0,get:function(){return t.serializeError}}),Object.defineProperty(r,"getMessageFromCode",{enumerable:!0,get:function(){return t.getMessageFromCode}});const n=zs();Object.defineProperty(r,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const s=On();Object.defineProperty(r,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})}(bn)),bn}var at=Ks(),_n,Ji;function Vs(){return Ji||(Ji=1,_n=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,s,f;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!r(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(f=Object.keys(e),n=f.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,f[s]))return!1;for(s=n;s--!==0;){var o=f[s];if(!r(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}),_n}var Js=Vs();const Ys=mt(Js);var Xs="2.1.0";function ho(r){return r!==null&&typeof r=="object"&&typeof r.pipe=="function"}function Qs(r){return ho(r)&&r.writable!==!1&&typeof r._write=="function"&&typeof r._writableState=="object"}function Zs(r){return ho(r)&&r.readable!==!1&&typeof r._read=="function"&&typeof r._readableState=="object"}function ea(r){return Qs(r)&&Zs(r)}var Je={errors:{disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",unsupportedSync:r=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${r} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:r=>`Invalid options. Received: { maxEventListeners: ${r}}`,invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:r=>`'args.logger' must include required method '${r}'.`},info:{connected:r=>`Torus: Connected to chain with ID "${r}".`}};const ta={PRODUCTION:"production"},Mt={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},ra={en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies benötigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"継続する",actionRequired:"認証が必要です",pendingAction:"続行をクリックして、ポップアップでリクエストを続行します",cookiesRequired:"必要なクッキー",enableCookies:"Torusにアクセスするには、ブラウザの設定でCookieを有効にしてください。",clickHere:"詳しくは"}},ko:{embed:{continue:"계속하다",actionRequired:"승인 필요",pendingAction:"팝업에서 요청을 진행하려면 계속을 클릭하십시오.",cookiesRequired:"쿠키 필요",enableCookies:"브라우저 환경 설정에서 쿠키를 활성화하여 Torus에 액세스하십시오.",clickHere:"더 많은 정보"}},zh:{embed:{continue:"继续",actionRequired:"需要授权",pendingAction:"单击继续以在弹出窗口中继续您的请求",cookiesRequired:"必填Cookie",enableCookies:"请在您的浏览器首选项中启用cookie以访问Torus。",clickHere:"更多信息"}}};var Pn={translations:ra,localStorageKeyPrefix:"torus-"},Se=cr.getLogger("solana-embed");function na(){return(r,e,t)=>{(typeof r.method!="string"||!r.method)&&(e.error=at.ethErrors.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:r})),t(n=>{const{error:s}=e;return s&&Se.error(`Torus - RPC Error: ${s.message}`,s),n()})}}function ia(r,e,t){let n=`Torus: Lost connection to "${r}".`;e?.stack&&(n+=`
4
+ ${e.stack}`),Se.warn(n),t&&t.listenerCount("error")>0&&t.emit("error",n)}const lr=()=>Math.random().toString(36).slice(2),po=async r=>{let e,t;switch(r){case"testing":e="https://solana-testing.tor.us",t="debug";break;case"development":e="http://localhost:8080",t="debug";break;default:e="https://solana.tor.us",t="error";break}return{torusUrl:e,logLevel:t}},oa=()=>{let r=window.navigator.language||"en-US";const e=r.split("-");return r=Object.prototype.hasOwnProperty.call(Pn.translations,e[0])?e[0]:"en",r},sa={height:660,width:375},aa={height:740,width:1315},la={height:700,width:1200},go={height:600,width:400};function ua(r){let e;try{e=window[r];const t="__storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(t){const n=t;return n&&(n.code===22||n.code===1014||n.name==="QuotaExceededError"||n.name==="NS_ERROR_DOM_QUOTA_REACHED")&&e&&e.length!==0}}function Dt(r){let{width:e,height:t}=r;const n=window.screenLeft!==void 0?window.screenLeft:window.screenX,s=window.screenTop!==void 0?window.screenTop:window.screenY,f=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,o=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,p=1,I=Math.abs((f-e)/2/p+n),A=Math.abs((o-t)/2/p+s);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=${t/p},width=${e/p},top=${A},left=${I}`}class bo extends wr{constructor(e,t){let{maxEventListeners:n=100,jsonRpcStreamName:s="provider"}=t;if(super(),pe(this,"isTorus",void 0),pe(this,"_rpcEngine",void 0),pe(this,"jsonRpcConnectionEvents",void 0),pe(this,"_state",void 0),!ea(e))throw new Error(Je.errors.invalidDuplexStream());this.isTorus=!0,this.setMaxListeners(n),this._handleConnect=this._handleConnect.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this._initializeState=this._initializeState.bind(this),this.request=this.request.bind(this),this.sendAsync=this.sendAsync.bind(this);const f=new Rs;Si(e,f,e,this._handleStreamDisconnect.bind(this,"Torus")),f.ignoreStream("phishing");const o=Es();Si(o.stream,f.createStream(s),o.stream,this._handleStreamDisconnect.bind(this,"Torus RpcProvider"));const p=new et;p.push(vs()),p.push(na()),p.push(Gs({origin:location.origin})),p.push(o.middleware),this._rpcEngine=p,this.jsonRpcConnectionEvents=o.events}async request(e){if(!e||typeof e!="object"||Array.isArray(e))throw at.ethErrors.rpc.invalidRequest({message:Je.errors.invalidRequestArgs(),data:e});const{method:t,params:n}=e;if(typeof t!="string"||t.length===0)throw at.ethErrors.rpc.invalidRequest({message:Je.errors.invalidRequestMethod(),data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw at.ethErrors.rpc.invalidRequest({message:Je.errors.invalidRequestParams(),data:e});return new Promise((s,f)=>{this._rpcRequest({method:t,params:n},mn(s,f))})}send(e,t){this._rpcRequest(e,t)}sendAsync(e){return new Promise((t,n)=>{this._rpcRequest(e,mn(t,n))})}_handleStreamDisconnect(e,t){ia(e,t,this),this._handleDisconnect(!1,t?t.message:void 0)}}const yt=r=>{const e=window.document.createElement("template"),t=r.trim();return e.innerHTML=t,e.content.firstChild};function ur(r){return r.version===void 0}class wo extends wr{constructor(e){let{url:t,target:n,features:s,timeout:f=3e4}=e;super(),pe(this,"url",void 0),pe(this,"target",void 0),pe(this,"features",void 0),pe(this,"window",void 0),pe(this,"windowTimer",void 0),pe(this,"iClosedWindow",void 0),pe(this,"timeout",void 0),this.url=t,this.target=n||"_blank",this.features=s||Dt(la),this.window=void 0,this.windowTimer=void 0,this.iClosedWindow=!1,this.timeout=f,this._setupTimer()}_setupTimer(){this.windowTimer=Number(setInterval(()=>{this.window&&this.window.closed&&(clearInterval(this.windowTimer),setTimeout(()=>{this.iClosedWindow||this.emit("close"),this.iClosedWindow=!1,this.window=void 0},this.timeout)),this.window===void 0&&clearInterval(this.windowTimer)},500))}open(){return this.window=window.open(this.url.href,this.target,this.features),this.window?.focus&&this.window.focus(),Promise.resolve()}close(){this.iClosedWindow=!0,this.window&&this.window.close()}redirect(e){e?window.location.replace(this.url.href):window.location.href=this.url.href}}class yr extends bo{constructor(e,t){let{maxEventListeners:n=100,jsonRpcStreamName:s="provider"}=t;super(e,{maxEventListeners:n,jsonRpcStreamName:s}),pe(this,"embedTranslations",void 0),pe(this,"torusUrl",void 0),pe(this,"dappStorageKey",void 0),pe(this,"windowRefs",void 0),pe(this,"tryWindowHandle",void 0),pe(this,"torusAlertContainer",void 0),pe(this,"torusIframe",void 0),this._state=$e({},yr._defaultState),this.torusUrl="",this.dappStorageKey="";const f=Pn.translations[oa()];this.embedTranslations=f.embed,this.windowRefs={},this.on("connect",()=>{this._state.isConnected=!0});const o=p=>{const{method:I,params:A}=p;if(I===ar.IFRAME_STATUS){const{isFullScreen:D,rid:F}=A;this._displayIframe({isFull:D,rid:F})}else if(I==="create_window"){const{windowId:D,url:F}=A;this._createPopupBlockAlert(D,F)}else if(I===ar.CLOSE_WINDOW)this._handleCloseWindow(A);else if(I===ar.USER_LOGGED_IN){const{currentLoginProvider:D}=A;this._state.isLoggedIn=!0,this._state.currentLoginProvider=D}else I===ar.USER_LOGGED_OUT&&(this._state.isLoggedIn=!1,this._state.currentLoginProvider=null,this._displayIframe())};this.jsonRpcConnectionEvents.on("notification",o)}get isLoggedIn(){return this._state.isLoggedIn}get isIFrameFullScreen(){return this._state.isIFrameFullScreen}isConnected(){return this._state.isConnected}async _initializeState(e){try{const{torusUrl:t,dappStorageKey:n,torusAlertContainer:s,torusIframe:f}=e;this.torusUrl=t,this.dappStorageKey=n,this.torusAlertContainer=s,this.torusIframe=f,this.torusIframe.addEventListener("load",()=>{this._state.isIFrameFullScreen||this._displayIframe()});const{currentLoginProvider:o,isLoggedIn:p}=await this.request({method:tt.GET_PROVIDER_STATE,params:[]});this._handleConnect(o,p)}catch(t){Se.error("Torus: Failed to get initial state. Please report this bug.",t)}finally{Se.info("initialized communication state"),this._state.initialized=!0,this.emit("_initialized")}}_handleWindow(e){let{url:t,target:n,features:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const f=new URL(t||`${this.torusUrl}/redirect?windowId=${e}`);this.dappStorageKey&&(f.hash?f.hash+=`&dappStorageKey=${this.dappStorageKey}`:f.hash=`#dappStorageKey=${this.dappStorageKey}`);const o=new wo({url:f,target:n,features:s});if(o.open(),!o.window){this._createPopupBlockAlert(e,f.href);return}this.windowRefs[e]=o,this.request({method:"opened_window",params:{windowId:e}}),o.once("close",()=>{delete this.windowRefs[e],this.request({method:tt.CLOSED_WINDOW,params:{windowId:e}})})}_displayIframe(){let{isFull:e=!1,rid:t=""}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n={};if(e)n.display="block",n.width="100%",n.height="100%",n.top="0px",n.right="0px",n.left="0px",n.bottom="0px";else switch(n.display=this._state.torusWidgetVisibility?"block":"none",n.height="70px",n.width="70px",this._state.buttonPosition){case Mt.TOP_LEFT:n.top="0px",n.left="0px",n.right="auto",n.bottom="auto";break;case Mt.TOP_RIGHT:n.top="0px",n.right="0px",n.left="auto",n.bottom="auto";break;case Mt.BOTTOM_RIGHT:n.bottom="0px",n.right="0px",n.top="auto",n.left="auto";break;case Mt.BOTTOM_LEFT:default:n.bottom="0px",n.left="0px",n.top="auto",n.right="auto";break}Object.assign(this.torusIframe.style,n),this._state.isIFrameFullScreen=e,this.request({method:tt.IFRAME_STATUS,params:{isIFrameFullScreen:e,rid:t}})}hideTorusButton(){this._state.torusWidgetVisibility=!1,this._displayIframe()}showTorusButton(){this._state.torusWidgetVisibility=!0,this._displayIframe()}_rpcRequest(e,t){const n=t,s=e;Array.isArray(s)||s.jsonrpc||(s.jsonrpc="2.0"),this.tryWindowHandle(s,n)}_handleConnect(e,t){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{currentLoginProvider:e,isLoggedIn:t}),Se.debug(Je.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){this._state.isConnected=!1;let n;e?(n=new at.EthereumRpcError(1013,t||Je.errors.disconnected()),Se.debug(n)):(n=new at.EthereumRpcError(1011,t||Je.errors.permanentlyDisconnected()),Se.error(n),this._state.currentLoginProvider=null,this._state.isLoggedIn=!1,this._state.torusWidgetVisibility=!1,this._state.isIFrameFullScreen=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",n)}}_handleCloseWindow(e){const{windowId:t}=e;this.windowRefs[t]&&(this.windowRefs[t].close(),delete this.windowRefs[t])}async _createPopupBlockAlert(e,t){const n=this.getLogoUrl(),s=yt(`<div id="torusAlert" class="torus-alert--v2"><div id="torusAlert__logo"><img src="${n}" /></div><div><h1 id="torusAlert__title">${this.embedTranslations.actionRequired}</h1><p id="torusAlert__desc">${this.embedTranslations.pendingAction}</p></div></div>`),f=yt(`<div><a id="torusAlert__btn">${this.embedTranslations.continue}</a></div>`),o=yt('<div id="torusAlert__btn-container"></div>');o.appendChild(f),s.appendChild(o);const p=()=>{f.addEventListener("click",()=>{this._handleWindow(e,{url:t,target:"_blank",features:Dt(go)}),s.remove(),this.torusAlertContainer.children.length===0&&(this.torusAlertContainer.style.display="none")})};(()=>{this.torusAlertContainer.appendChild(s)})(),p(),this.torusAlertContainer.style.display="block"}getLogoUrl(){return`${this.torusUrl}/images/torus_icon-blue.svg`}}pe(yr,"_defaultState",{buttonPosition:"bottom-left",currentLoginProvider:null,isIFrameFullScreen:!1,hasEmittedConnection:!1,torusWidgetVisibility:!1,initialized:!1,isLoggedIn:!1,isPermanentlyDisconnected:!1,isConnected:!1});class mr extends bo{constructor(e,t){let{maxEventListeners:n=100,jsonRpcStreamName:s="provider"}=t;super(e,{maxEventListeners:n,jsonRpcStreamName:s}),pe(this,"chainId",void 0),pe(this,"selectedAddress",void 0),pe(this,"tryWindowHandle",void 0),this._state=$e({},mr._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this.on("connect",()=>{this._state.isConnected=!0});const f=o=>{const{method:p,params:I}=o;p===gn.ACCOUNTS_CHANGED?this._handleAccountsChanged(I):p===gn.UNLOCK_STATE_CHANGED?this._handleUnlockStateChanged(I):p===gn.CHAIN_CHANGED&&this._handleChainChanged(I)};this.jsonRpcConnectionEvents.on("notification",f)}isConnected(){return this._state.isConnected}async _initializeState(){try{const{accounts:e,chainId:t,isUnlocked:n}=await this.request({method:Hs.GET_PROVIDER_STATE,params:[]});this.emit("connect",{chainId:t}),this._handleChainChanged({chainId:t}),this._handleUnlockStateChanged({accounts:e,isUnlocked:n}),this._handleAccountsChanged(e)}catch(e){Se.error("Torus: Failed to get initial state. Please report this bug.",e)}finally{Se.info("initialized provider state"),this._state.initialized=!0,this.emit("_initialized")}}_rpcRequest(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=t;const f=e;if(!Array.isArray(f)){if(f.jsonrpc||(f.jsonrpc="2.0"),f.method==="solana_accounts"||f.method==="solana_requestAccounts")s=(o,p)=>{this._handleAccountsChanged(p.result||[],f.method==="solana_accounts",n),t(o,p)};else if(f.method==="wallet_getProviderState"){this._rpcEngine.handle(e,s);return}}this.tryWindowHandle(f,s)}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),Se.debug(Je.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){this._state.isConnected=!1;let n;e?(n=new at.EthereumRpcError(1013,t||Je.errors.disconnected()),Se.debug(n)):(n=new at.EthereumRpcError(1011,t||Je.errors.permanentlyDisconnected()),Se.error(n),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",n)}}_handleAccountsChanged(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=e;Array.isArray(s)||(Se.error("Torus: Received non-array accounts parameter. Please report this bug.",s),s=[]);for(const f of e)if(typeof f!="string"){Se.error("Torus: Received non-string account. Please report this bug.",e),s=[];break}Ys(this._state.accounts,s)||(t&&Array.isArray(this._state.accounts)&&this._state.accounts.length>0&&!n&&Se.error('Torus: "solana_accounts" unexpectedly updated accounts. Please report this bug.',s),this._state.accounts=s,this.emit("accountsChanged",s)),this.selectedAddress!==s[0]&&(this.selectedAddress=s[0]||null)}_handleChainChanged(){let{chainId:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!e){Se.error("Torus: Received invalid network parameters. Please report this bug.",{chainId:e});return}e==="loading"?this._handleDisconnect(!0):(this._handleConnect(e),e!==this.chainId&&(this.chainId=e,this._state.initialized&&this.emit("chainChanged",this.chainId)))}_handleUnlockStateChanged(){let{accounts:e,isUnlocked:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(typeof t!="boolean"){Se.error("Torus: Received invalid isUnlocked parameter. Please report this bug.",{isUnlocked:t});return}t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e||[]))}}pe(mr,"_defaultState",{accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1,hasEmittedConnection:!1});function Yi(r){return new Promise((e,t)=>{try{const n=document.createElement("img");n.onload=()=>e(!0),n.onerror=()=>e(!1),n.src=r}catch(n){t(n)}})}const fa=r=>{const{document:e}=r,t=e.querySelector('head > meta[property="og:site_name"]');if(t)return t.content;const n=e.querySelector('head > meta[name="title"]');return n?n.content:e.title&&e.title.length>0?e.title:r.location.hostname};async function ca(r){try{const{document:e}=r;let t=e.querySelector('head > link[rel="shortcut icon"]');return t&&await Yi(t.href)||(t=Array.from(e.querySelectorAll('head > link[rel="icon"]')).find(n=>!!n.href),t&&await Yi(t.href))?t.href:""}catch{return""}}const da=async()=>({name:fa(window),icon:await ca(window)}),ha=["send_transaction","sign_transaction","sign_all_transactions","sign_message","connect"],pa=[tt.SET_PROVIDER],ga=ua("localStorage");(async function(){try{if(typeof document>"u")return;const e=document.createElement("link"),{torusUrl:t}=await po("production");e.href=`${t}/frame`,e.crossOrigin="anonymous",e.type="text/html",e.rel="prefetch",e.relList&&e.relList.supports&&e.relList.supports("prefetch")&&document.head.appendChild(e)}catch(e){Se.warn(e)}})();class Sa{constructor(){let{modalZIndex:e=99999}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pe(this,"isInitialized",void 0),pe(this,"torusAlert",void 0),pe(this,"modalZIndex",void 0),pe(this,"alertZIndex",void 0),pe(this,"requestedLoginProvider",void 0),pe(this,"provider",void 0),pe(this,"communicationProvider",void 0),pe(this,"dappStorageKey",void 0),pe(this,"isTopupHidden",!1),pe(this,"torusAlertContainer",void 0),pe(this,"torusUrl",void 0),pe(this,"torusIframe",void 0),pe(this,"styleLink",void 0),this.torusUrl="",this.isInitialized=!1,this.requestedLoginProvider=null,this.modalZIndex=e,this.alertZIndex=e+1e3,this.dappStorageKey=""}get isLoggedIn(){return this.communicationProvider?this.communicationProvider.isLoggedIn:!1}async init(){let{buildEnv:e=ta.PRODUCTION,enableLogging:t=!1,network:n,showTorusButton:s=!1,useLocalStorage:f=!1,buttonPosition:o=Mt.BOTTOM_LEFT,apiKey:p="torus-default",extraParams:I={},whiteLabel:A}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.isInitialized)throw new Error("Already initialized");const{torusUrl:D,logLevel:F}=await po(e);Se.enableAll(),Se.info(D,"url loaded"),Se.info(`Solana Embed Version :${Xs}`),this.torusUrl=D,Se.setDefaultLevel(F),t?Se.enableAll():Se.disableAll();const m=this.handleDappStorageKey(f),B=new URL(D);B.pathname.endsWith("/")?B.pathname+="frame":B.pathname+="/frame";const q=new URLSearchParams;return m&&q.append("dappStorageKey",m),q.append("origin",window.location.origin),B.hash=q.toString(),this.torusIframe=yt(`<iframe
5
+ id="torusIframe"
6
+ class="torusIframe"
7
+ src="${B.href}"
8
+ style="display: none; position: fixed; top: 0; right: 0; width: 100%;
9
+ height: 100%; border: none; border-radius: 0; z-index: ${this.modalZIndex.toString()}"
10
+ ></iframe>`),this.torusAlertContainer=yt(`<div id="torusAlertContainer" style="display:none; z-index: ${this.alertZIndex.toString()}"></div>`),this.styleLink=yt(`<link href="${D}/css/widget.css" rel="stylesheet" type="text/css">`),new Promise((O,E)=>{try{this.torusIframe.addEventListener("load",async()=>{const P=await da();this.torusIframe.contentWindow.postMessage({buttonPosition:o,apiKey:p,network:n,dappMetadata:P,extraParams:I,whiteLabel:A},B.origin),await this._setupWeb3({torusUrl:D}),s&&this.showTorusButton(),A?.topupHide?this.isTopupHidden=A.topupHide:this.hideTorusButton(),this.isInitialized=!0,window.torus=this,O()}),window.document.head.appendChild(this.styleLink),window.document.body.appendChild(this.torusIframe),window.document.body.appendChild(this.torusAlertContainer)}catch(P){E(P)}})}async login(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.isInitialized)throw new Error("Call init() first");try{this.requestedLoginProvider=e.loginProvider||null,this.requestedLoginProvider||this.communicationProvider._displayIframe({isFull:!0});const t=await new Promise((n,s)=>{this.provider._rpcRequest({method:"solana_requestAccounts",params:[this.requestedLoginProvider,e.login_hint]},mn(n,s))});if(Array.isArray(t)&&t.length>0)return t;throw new Error("Login failed")}catch(t){throw Se.error("login failed",t),t}finally{this.communicationProvider.isIFrameFullScreen&&this.communicationProvider._displayIframe()}}async loginWithPrivateKey(e){if(!this.isInitialized)throw new Error("Call init() first");const{privateKey:t,userInfo:n}=e,{success:s}=await this.communicationProvider.request({method:"login_with_private_key",params:{privateKey:t,userInfo:n}});if(!s)throw new Error("Login Failed")}async logout(){if(!this.communicationProvider.isLoggedIn)throw new Error("Not logged in");await this.communicationProvider.request({method:tt.LOGOUT,params:[]}),this.requestedLoginProvider=null}async cleanUp(){this.communicationProvider.isLoggedIn&&await this.logout(),this.clearInit()}clearInit(){function e(t){return t instanceof Element||t instanceof Document}e(this.styleLink)&&window.document.body.contains(this.styleLink)&&(this.styleLink.remove(),this.styleLink=void 0),e(this.torusIframe)&&window.document.body.contains(this.torusIframe)&&(this.torusIframe.remove(),this.torusIframe=void 0),e(this.torusAlertContainer)&&window.document.body.contains(this.torusAlertContainer)&&(this.torusAlert=void 0,this.torusAlertContainer.remove(),this.torusAlertContainer=void 0),this.isInitialized=!1}hideTorusButton(){this.communicationProvider.hideTorusButton()}showTorusButton(){this.communicationProvider.showTorusButton()}async setProvider(e){await this.communicationProvider.request({method:tt.SET_PROVIDER,params:$e({},e)})}async showWallet(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=await this.communicationProvider.request({method:tt.WALLET_INSTANCE_ID,params:[]}),s=e?`/${e}`:"",f=new URL(`${this.torusUrl}/wallet${s}`);f.searchParams.append("instanceId",n),Object.keys(t).forEach(p=>{f.searchParams.append(p,t[p])}),this.dappStorageKey&&(f.hash=`#dappStorageKey=${this.dappStorageKey}`),new wo({url:f,features:Dt(aa)}).open()}async getUserInfo(){return await this.communicationProvider.request({method:tt.USER_INFO,params:[]})}async initiateTopup(e,t){if(!this.isInitialized)throw new Error("Torus is not initialized");const n=lr();return this.communicationProvider._handleWindow(n),await this.communicationProvider.request({method:tt.TOPUP,params:{provider:e,params:t,windowId:n}})}async getAccounts(){return await this.provider.request({method:"getAccounts",params:[]})}async sendTransaction(e){const t=ur(e),n=t?e.serialize({requireAllSignatures:!1}).toString("hex"):Buffer.from(e.serialize()).toString("hex");return await this.provider.request({method:"send_transaction",params:{message:n,isLegacyTransaction:t}})}async signAndSendTransaction(e,t){const n=ur(e),s=n?e.serialize({requireAllSignatures:!1}).toString("hex"):Buffer.from(e.serialize()).toString("hex");return{signature:await this.provider.request({method:"send_transaction",params:{message:s,options:t,isLegacyTransaction:n}})}}async signTransaction(e){const t=ur(e),n=t?e.serializeMessage().toString("hex"):Buffer.from(e.message.serialize()).toString("hex"),s=await this.provider.request({method:"sign_transaction",params:{message:n,messageOnly:!0,isLegacyTransaction:t}}),f=JSON.parse(s),o={publicKey:new Un(f.publicKey),signature:Buffer.from(f.signature,"hex")};return e.addSignature(o.publicKey,o.signature),e}async signAllTransactions(e){let t;const n=e.map(o=>(t=ur(o),t?o.serializeMessage().toString("hex"):Buffer.from(o.message.serialize()).toString("hex"))),f=(await this.provider.request({method:"sign_all_transactions",params:{message:n,messageOnly:!0,isLegacyTransaction:t}})).map(o=>{const p=JSON.parse(o);return{publicKey:new Un(p.publicKey),signature:Buffer.from(p.signature,"hex")}});return e.forEach((o,p)=>(o.addSignature(f[p].publicKey,f[p].signature),o)),e}async signMessage(e){return await this.provider.request({method:"sign_message",params:{data:e}})}async getGaslessPublicKey(){return await this.provider.request({method:"get_gasless_public_key",params:[]})}handleDappStorageKey(e){const t=`${Pn.localStorageKeyPrefix}${window.location.hostname}`;let n="";if(ga&&e){const s=window.localStorage.getItem(t);if(s)n=s;else{const f=`torus-app-${lr()}`;window.localStorage.setItem(t,f),n=f}}return this.dappStorageKey=n,n}async _setupWeb3(e){Se.info("setupWeb3 running");const t=new Ai({name:"embed_torus",target:"iframe_torus",targetWindow:this.torusIframe.contentWindow}),n=new Ai({name:"embed_communication",target:"iframe_communication",targetWindow:this.torusIframe.contentWindow}),s=new mr(t,{}),f=new yr(n,{});s.tryWindowHandle=(A,D)=>{const F=A;if(!Array.isArray(F)&&ha.includes(F.method)){if(!this.communicationProvider.isLoggedIn)throw new Error("User Not Logged In");const m=lr();f._handleWindow(m,{target:"_blank",features:Dt(go)}),F.windowId=m}s._rpcEngine.handle(F,D)},f.tryWindowHandle=(A,D)=>{const F=A;if(!Array.isArray(F)&&pa.includes(F.method)){const m=lr();f._handleWindow(m,{target:"_blank",features:Dt(sa)}),F.params.windowId=m}f._rpcEngine.handle(F,D)};const o=A=>{const D=s[A],F=this;s[A]=function(B,q){const{method:O,params:E=[]}=B;if(O==="solana_requestAccounts"){if(!q)return F.login({loginProvider:E[0]});F.login({loginProvider:E[0]}).then(P=>q(null,P)).catch(P=>q(P))}return D.apply(this,[B,q])}};o("request"),o("sendAsync"),o("send");const p=new Proxy(s,{deleteProperty:()=>!0}),I=new Proxy(f,{deleteProperty:()=>!0});this.provider=p,this.communicationProvider=I,await Promise.all([s._initializeState(),f._initializeState($e($e({},e),{},{dappStorageKey:this.dappStorageKey,torusAlertContainer:this.torusAlertContainer,torusIframe:this.torusIframe}))]),Se.debug("Torus - injected provider")}}export{Mt as BUTTON_POSITION,ta as TORUS_BUILD_ENV,mr as TorusInPageProvider,Sa as default};
@@ -0,0 +1 @@
1
+ import{h as y}from"./vendor-web3-BWcfcUXi.js";var h={},c;function m(){if(c)return h;c=1;var n=y().Buffer,o=n.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function d(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function u(t){var e=d(t);if(typeof e!="string"&&(n.isEncoding===o||!o(t)))throw new Error("Unknown encoding: "+t);return e||t}h.StringDecoder=a;function a(t){this.encoding=u(t);var e;switch(this.encoding){case"utf16le":this.text=v,this.end=p,e=4;break;case"utf8":this.fillLast=N,e=4;break;case"base64":this.text=w,this.end=S,e=3;break;default:this.write=T,this.end=E;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}a.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},a.prototype.end=C,a.prototype.text=x,a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function l(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function f(t,e,r){var i=e.length-1;if(i<r)return 0;var s=l(e[i]);return s>=0?(s>0&&(t.lastNeed=s-1),s):--i<r||s===-2?0:(s=l(e[i]),s>=0?(s>0&&(t.lastNeed=s-2),s):--i<r||s===-2?0:(s=l(e[i]),s>=0?(s>0&&(s===2?s=0:t.lastNeed=s-3),s):0))}function g(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"�"}}function N(t){var e=this.lastTotal-this.lastNeed,r=g(this,t);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function x(t,e){var r=f(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function C(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e}function v(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function p(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function w(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function S(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function T(t){return t.toString(this.encoding)}function E(t){return t&&t.length?this.write(t):""}return h}export{m as r};