@skip-go/widget-web-component 3.14.4 → 3.17.1

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 (194) hide show
  1. package/build/1125.index.js +3 -0
  2. package/build/1133.index.js +8 -0
  3. package/build/1136.index.js +9 -0
  4. package/build/1139.index.js +18 -0
  5. package/build/1171.index.js +1 -1
  6. package/build/1189.index.js +1 -1
  7. package/build/1203.index.js +1 -1
  8. package/build/1207.index.js +1 -1
  9. package/build/1211.index.js +8 -0
  10. package/build/1226.index.js +8 -0
  11. package/build/1349.index.js +1 -1
  12. package/build/1361.index.js +1 -1
  13. package/build/1363.index.js +1 -1
  14. package/build/1370.index.js +1 -1
  15. package/build/1415.index.js +8 -0
  16. package/build/1426.index.js +3 -0
  17. package/build/1470.index.js +1 -1
  18. package/build/1572.index.js +11 -0
  19. package/build/1716.index.js +1 -1
  20. package/build/1776.index.js +8 -0
  21. package/build/1852.index.js +1 -1
  22. package/build/1881.index.js +1 -1
  23. package/build/1894.index.js +1 -1
  24. package/build/1911.index.js +1 -1
  25. package/build/1951.index.js +18 -0
  26. package/build/1979.index.js +30 -0
  27. package/build/2034.index.js +1 -1
  28. package/build/2131.index.js +1 -1
  29. package/build/2166.index.js +1 -1
  30. package/build/2202.index.js +61 -0
  31. package/build/2242.index.js +1 -1
  32. package/build/2289.index.js +8 -0
  33. package/build/2301.index.js +1 -1
  34. package/build/2410.index.js +1 -1
  35. package/build/2422.index.js +1 -0
  36. package/build/245.index.js +1 -1
  37. package/build/2496.index.js +1 -1
  38. package/build/2557.index.js +17 -0
  39. package/build/2699.index.js +1 -1
  40. package/build/2715.index.js +8 -0
  41. package/build/283.index.js +8 -0
  42. package/build/2844.index.js +13 -0
  43. package/build/2851.index.js +1 -0
  44. package/build/2902.index.js +15 -0
  45. package/build/3070.index.js +1 -1
  46. package/build/3099.index.js +8 -0
  47. package/build/3105.index.js +8 -0
  48. package/build/3131.index.js +6 -0
  49. package/build/3148.index.js +1 -1
  50. package/build/3472.index.js +1 -1
  51. package/build/3550.index.js +8 -0
  52. package/build/3574.index.js +1 -1
  53. package/build/362.index.js +12 -0
  54. package/build/3646.index.js +32 -0
  55. package/build/3726.index.js +1 -1
  56. package/build/3828.index.js +14 -0
  57. package/build/385.index.js +1 -1
  58. package/build/3857.index.js +14 -0
  59. package/build/3874.index.js +17 -0
  60. package/build/4028.index.js +1 -1
  61. package/build/4150.index.js +620 -0
  62. package/build/4194.index.js +317 -0
  63. package/build/4203.index.js +1 -1
  64. package/build/4226.index.js +14 -0
  65. package/build/4249.index.js +8 -0
  66. package/build/4264.index.js +1 -0
  67. package/build/428.index.js +1 -0
  68. package/build/4289.index.js +1 -1
  69. package/build/4319.index.js +1 -1
  70. package/build/4379.index.js +2069 -0
  71. package/build/4446.index.js +2 -0
  72. package/build/4683.index.js +1 -1
  73. package/build/4693.index.js +2 -2
  74. package/build/4729.index.js +1 -1
  75. package/build/4733.index.js +12 -0
  76. package/build/4857.index.js +12 -0
  77. package/build/4969.index.js +1 -1
  78. package/build/5069.index.js +1 -1
  79. package/build/5090.index.js +8 -0
  80. package/build/5193.index.js +1 -1
  81. package/build/5206.index.js +14 -0
  82. package/build/5218.index.js +6 -0
  83. package/build/5330.index.js +8 -0
  84. package/build/537.index.js +1 -1
  85. package/build/5438.index.js +9 -0
  86. package/build/5526.index.js +1 -1
  87. package/build/5572.index.js +1 -1
  88. package/build/5619.index.js +1 -1
  89. package/build/5642.index.js +2 -0
  90. package/build/5647.index.js +1 -1
  91. package/build/5737.index.js +1 -1
  92. package/build/577.index.js +8 -0
  93. package/build/5880.index.js +1 -1
  94. package/build/590.index.js +1 -1
  95. package/build/5972.index.js +622 -0
  96. package/build/602.index.js +9 -0
  97. package/build/6024.index.js +1 -1
  98. package/build/6036.index.js +8 -0
  99. package/build/6075.index.js +1 -1
  100. package/build/6123.index.js +1 -1
  101. package/build/6127.index.js +1 -1
  102. package/build/6138.index.js +18 -0
  103. package/build/6148.index.js +1 -1
  104. package/build/6151.index.js +1 -1
  105. package/build/6175.index.js +4 -0
  106. package/build/631.index.js +18 -0
  107. package/build/6323.index.js +1 -1
  108. package/build/6442.index.js +1 -1
  109. package/build/6484.index.js +1 -1
  110. package/build/6543.index.js +1 -1
  111. package/build/6553.index.js +8 -0
  112. package/build/6558.index.js +1 -0
  113. package/build/6573.index.js +1 -1
  114. package/build/6611.index.js +12 -0
  115. package/build/6639.index.js +8 -0
  116. package/build/6654.index.js +1 -0
  117. package/build/6705.index.js +12 -0
  118. package/build/6715.index.js +12 -0
  119. package/build/674.index.js +317 -0
  120. package/build/674.index.js.LICENSE.txt +17 -0
  121. package/build/6753.index.js +1 -1
  122. package/build/6811.index.js +8 -0
  123. package/build/6813.index.js +4 -0
  124. package/build/6869.index.js +1 -1
  125. package/build/6969.index.js +12 -0
  126. package/build/7172.index.js +1 -1
  127. package/build/7176.index.js +16 -0
  128. package/build/7201.index.js +878 -0
  129. package/build/7272.index.js +6 -0
  130. package/build/7311.index.js +11 -0
  131. package/build/7409.index.js +1 -0
  132. package/build/7428.index.js +4 -0
  133. package/build/7540.index.js +8 -0
  134. package/build/7618.index.js +1 -1
  135. package/build/7762.index.js +1 -1
  136. package/build/7780.index.js +3 -0
  137. package/build/7981.index.js +1 -1
  138. package/build/8000.index.js +1 -1
  139. package/build/8029.index.js +8 -0
  140. package/build/8036.index.js +1 -1
  141. package/build/8147.index.js +16 -0
  142. package/build/8249.index.js +8 -0
  143. package/build/8318.index.js +1 -1
  144. package/build/8367.index.js +1 -1
  145. package/build/8373.index.js +2082 -0
  146. package/build/8373.index.js.LICENSE.txt +5 -0
  147. package/build/8467.index.js +1 -1
  148. package/build/8483.index.js +1 -1
  149. package/build/8631.index.js +8 -0
  150. package/build/8645.index.js +2 -0
  151. package/build/8645.index.js.LICENSE.txt +11 -0
  152. package/build/8714.index.js +8 -0
  153. package/build/8717.index.js +6 -0
  154. package/build/8904.index.js +1 -1
  155. package/build/896.index.js +1 -1
  156. package/build/8964.index.js +26 -0
  157. package/build/897.index.js +11 -0
  158. package/build/9081.index.js +8 -0
  159. package/build/9120.index.js +8 -0
  160. package/build/913.index.js +15 -0
  161. package/build/9192.index.js +1 -0
  162. package/build/9194.index.js +878 -4
  163. package/build/9309.index.js +15 -0
  164. package/build/9313.index.js +8 -0
  165. package/build/9372.index.js +1 -1
  166. package/build/9396.index.js +12 -0
  167. package/build/9476.index.js +1 -1
  168. package/build/9607.index.js +8 -0
  169. package/build/967.index.js +5 -0
  170. package/build/984.index.js +8 -0
  171. package/build/9850.index.js +14 -0
  172. package/build/9884.index.js +1 -1
  173. package/build/index.js +769 -1633
  174. package/build/index.js.LICENSE.txt +6 -16
  175. package/package.json +1 -1
  176. package/build/1179.index.js +0 -2
  177. package/build/1256.index.js +0 -317
  178. package/build/1934.index.js +0 -2
  179. package/build/1934.index.js.LICENSE.txt +0 -17
  180. package/build/4619.index.js +0 -622
  181. package/build/4833.index.js +0 -2
  182. package/build/5902.index.js +0 -2
  183. package/build/6319.index.js +0 -2069
  184. package/build/6700.index.js +0 -1
  185. package/build/7084.index.js +0 -2
  186. package/build/7544.index.js +0 -1
  187. package/build/7591.index.js +0 -1
  188. package/build/8780.index.js +0 -1
  189. /package/build/{1256.index.js.LICENSE.txt → 4194.index.js.LICENSE.txt} +0 -0
  190. /package/build/{6319.index.js.LICENSE.txt → 4379.index.js.LICENSE.txt} +0 -0
  191. /package/build/{4833.index.js.LICENSE.txt → 4446.index.js.LICENSE.txt} +0 -0
  192. /package/build/{1179.index.js.LICENSE.txt → 5642.index.js.LICENSE.txt} +0 -0
  193. /package/build/{5902.index.js.LICENSE.txt → 7201.index.js.LICENSE.txt} +0 -0
  194. /package/build/{7084.index.js.LICENSE.txt → 9194.index.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- export const __webpack_id__=6700;export const __webpack_ids__=[6700];export const __webpack_modules__={2722:(e,t,r)=>{const n=r(72841),s=r(79543),o=r(24517),i=r(93806),a=r(93955),c=r(28474),l=r(92281),u=r(38868),p=r(73269),h=r(26381),d=r(31353),E=r(96082),f=r(69428),m=r(87851),v=r(87555),I=r(52132),g=r(6106),$=r(34042),R=r(93810),w=r(89761),L=r(51262),T=r(28848),N=r(28220),O=r(72386),S=r(89639),y=r(54004),A=r(56783),x=r(51565),b=r(37476),P=r(27229),C=r(26364),M=r(55039),_=r(55357),D=r(71280),U=r(37403),F=r(58854),j=r(27226),G=r(37183),k=r(18623),X=r(76486),B=r(40583);e.exports={parse:a,valid:c,clean:l,inc:u,diff:p,major:h,minor:d,patch:E,prerelease:f,compare:m,rcompare:v,compareLoose:I,compareBuild:g,sort:$,rsort:R,gt:w,lt:L,eq:T,neq:N,gte:O,lte:S,cmp:y,coerce:A,Comparator:x,Range:b,satisfies:P,toComparators:C,maxSatisfying:M,minSatisfying:_,minVersion:D,validRange:U,outside:F,gtr:j,ltr:G,intersects:k,simplifyRange:X,subset:B,SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:s.SEMVER_SPEC_VERSION,RELEASE_TYPES:s.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},6106:(e,t,r)=>{const n=r(24517);e.exports=(e,t,r)=>{const s=new n(e,r),o=new n(t,r);return s.compare(o)||s.compareBuild(o)}},13990:e=>{const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},18623:(e,t,r)=>{const n=r(37476);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},24517:(e,t,r)=>{const n=r(41361),{MAX_LENGTH:s,MAX_SAFE_INTEGER:o}=r(79543),{safeRe:i,t:a}=r(72841),c=r(13990),{compareIdentifiers:l}=r(93806);class u{constructor(e,t){if(t=c(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>s)throw new TypeError(`version is longer than ${s} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?i[a.LOOSE]:i[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<o)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),l(this.major,e.major)||l(this.minor,e.minor)||l(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],s=e.prerelease[t];if(n("prerelease compare",t,r,s),void 0===r&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===r)return-1;if(r!==s)return l(r,s)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const r=this.build[t],s=e.build[t];if(n("build compare",t,r,s),void 0===r&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===r)return-1;if(r!==s)return l(r,s)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===l(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},26364:(e,t,r)=>{const n=r(37476);e.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},26381:(e,t,r)=>{const n=r(24517);e.exports=(e,t)=>new n(e,t).major},27226:(e,t,r)=>{const n=r(58854);e.exports=(e,t,r)=>n(e,t,">",r)},27229:(e,t,r)=>{const n=r(37476);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},28220:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>0!==n(e,t,r)},28474:(e,t,r)=>{const n=r(93955);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},28848:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>0===n(e,t,r)},31353:(e,t,r)=>{const n=r(24517);e.exports=(e,t)=>new n(e,t).minor},34042:(e,t,r)=>{const n=r(6106);e.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))},37183:(e,t,r)=>{const n=r(58854);e.exports=(e,t,r)=>n(e,t,"<",r)},37403:(e,t,r)=>{const n=r(37476);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},37476:(e,t,r)=>{class n{constructor(e,t){if(t=o(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof i)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!m(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&E)|(this.options.loose&&f))+":"+e,r=s.get(t);if(r)return r;const n=this.options.loose,o=n?l[u.HYPHENRANGELOOSE]:l[u.HYPHENRANGE];e=e.replace(o,A(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(l[u.COMPARATORTRIM],p),a("comparator trim",e),e=e.replace(l[u.TILDETRIM],h),a("tilde trim",e),e=e.replace(l[u.CARETTRIM],d),a("caret trim",e);let c=e.split(" ").map((e=>g(e,this.options))).join(" ").split(/\s+/).map((e=>y(e,this.options)));n&&(c=c.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(l[u.COMPARATORLOOSE]))))),a("range list",c);const v=new Map,I=c.map((e=>new i(e,this.options)));for(const e of I){if(m(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const $=[...v.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>I(r,t)&&e.set.some((e=>I(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(x(this.set[t],e,this.options))return!0;return!1}}e.exports=n;const s=new(r(58953)),o=r(13990),i=r(51565),a=r(41361),c=r(24517),{safeRe:l,t:u,comparatorTrimReplace:p,tildeTrimReplace:h,caretTrimReplace:d}=r(72841),{FLAG_INCLUDE_PRERELEASE:E,FLAG_LOOSE:f}=r(79543),m=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,I=(e,t)=>{let r=!0;const n=e.slice();let s=n.pop();for(;r&&n.length;)r=n.every((e=>s.intersects(e,t))),s=n.pop();return r},g=(e,t)=>(a("comp",e,t),e=L(e,t),a("caret",e),e=R(e,t),a("tildes",e),e=N(e,t),a("xrange",e),e=S(e,t),a("stars",e),e),$=e=>!e||"x"===e.toLowerCase()||"*"===e,R=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{const r=t.loose?l[u.TILDELOOSE]:l[u.TILDE];return e.replace(r,((t,r,n,s,o)=>{let i;return a("tilde",e,t,r,n,s,o),$(r)?i="":$(n)?i=`>=${r}.0.0 <${+r+1}.0.0-0`:$(s)?i=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(a("replaceTilde pr",o),i=`>=${r}.${n}.${s}-${o} <${r}.${+n+1}.0-0`):i=`>=${r}.${n}.${s} <${r}.${+n+1}.0-0`,a("tilde return",i),i}))},L=(e,t)=>e.trim().split(/\s+/).map((e=>T(e,t))).join(" "),T=(e,t)=>{a("caret",e,t);const r=t.loose?l[u.CARETLOOSE]:l[u.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,s,o,i)=>{let c;return a("caret",e,t,r,s,o,i),$(r)?c="":$(s)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:$(o)?c="0"===r?`>=${r}.${s}.0${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.0${n} <${+r+1}.0.0-0`:i?(a("replaceCaret pr",i),c="0"===r?"0"===s?`>=${r}.${s}.${o}-${i} <${r}.${s}.${+o+1}-0`:`>=${r}.${s}.${o}-${i} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${o}-${i} <${+r+1}.0.0-0`):(a("no pr"),c="0"===r?"0"===s?`>=${r}.${s}.${o}${n} <${r}.${s}.${+o+1}-0`:`>=${r}.${s}.${o}${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${o} <${+r+1}.0.0-0`),a("caret return",c),c}))},N=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>O(e,t))).join(" ")),O=(e,t)=>{e=e.trim();const r=t.loose?l[u.XRANGELOOSE]:l[u.XRANGE];return e.replace(r,((r,n,s,o,i,c)=>{a("xRange",e,r,n,s,o,i,c);const l=$(s),u=l||$(o),p=u||$(i),h=p;return"="===n&&h&&(n=""),c=t.includePrerelease?"-0":"",l?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(u&&(o=0),i=0,">"===n?(n=">=",u?(s=+s+1,o=0,i=0):(o=+o+1,i=0)):"<="===n&&(n="<",u?s=+s+1:o=+o+1),"<"===n&&(c="-0"),r=`${n+s}.${o}.${i}${c}`):u?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:p&&(r=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`),a("xRange return",r),r}))},S=(e,t)=>(a("replaceStars",e,t),e.trim().replace(l[u.STAR],"")),y=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(l[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),A=e=>(t,r,n,s,o,i,a,c,l,u,p,h)=>`${r=$(n)?"":$(s)?`>=${n}.0.0${e?"-0":""}`:$(o)?`>=${n}.${s}.0${e?"-0":""}`:i?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=$(l)?"":$(u)?`<${+l+1}.0.0-0`:$(p)?`<${l}.${+u+1}.0-0`:h?`<=${l}.${u}.${p}-${h}`:e?`<${l}.${u}.${+p+1}-0`:`<=${c}`}`.trim(),x=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==i.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},38868:(e,t,r)=>{const n=r(24517);e.exports=(e,t,r,s,o)=>{"string"==typeof r&&(o=s,s=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,s,o).version}catch(e){return null}}},40583:(e,t,r)=>{const n=r(37476),s=r(51565),{ANY:o}=s,i=r(27229),a=r(87851),c=[new s(">=0.0.0-0")],l=[new s(">=0.0.0")],u=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=r.includePrerelease?c:l}if(1===t.length&&t[0].semver===o){if(r.includePrerelease)return!0;t=l}const n=new Set;let s,u,d,E,f,m,v;for(const t of e)">"===t.operator||">="===t.operator?s=p(s,t,r):"<"===t.operator||"<="===t.operator?u=h(u,t,r):n.add(t.semver);if(n.size>1)return null;if(s&&u){if(d=a(s.semver,u.semver,r),d>0)return null;if(0===d&&(">="!==s.operator||"<="!==u.operator))return null}for(const e of n){if(s&&!i(e,String(s),r))return null;if(u&&!i(e,String(u),r))return null;for(const n of t)if(!i(e,String(n),r))return!1;return!0}let I=!(!u||r.includePrerelease||!u.semver.prerelease.length)&&u.semver,g=!(!s||r.includePrerelease||!s.semver.prerelease.length)&&s.semver;I&&1===I.prerelease.length&&"<"===u.operator&&0===I.prerelease[0]&&(I=!1);for(const e of t){if(v=v||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,s)if(g&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===g.major&&e.semver.minor===g.minor&&e.semver.patch===g.patch&&(g=!1),">"===e.operator||">="===e.operator){if(E=p(s,e,r),E===e&&E!==s)return!1}else if(">="===s.operator&&!i(s.semver,String(e),r))return!1;if(u)if(I&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===I.major&&e.semver.minor===I.minor&&e.semver.patch===I.patch&&(I=!1),"<"===e.operator||"<="===e.operator){if(f=h(u,e,r),f===e&&f!==u)return!1}else if("<="===u.operator&&!i(u.semver,String(e),r))return!1;if(!e.operator&&(u||s)&&0!==d)return!1}return!(s&&m&&!u&&0!==d||u&&v&&!s&&0!==d||g||I)},p=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let s=!1;e:for(const n of e.set){for(const e of t.set){const t=u(n,e,r);if(s=s||null!==t,t)continue e}if(s)return!1}return!0}},41361:(e,t,r)=>{var n=r(39907);const s=("object"==typeof n&&n.env,()=>{});e.exports=s},51262:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>n(e,t,r)<0},51565:(e,t,r)=>{const n=Symbol("SemVer ANY");class s{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof s){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),l("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(e){const t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(l("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=s;const o=r(13990),{safeRe:i,t:a}=r(72841),c=r(54004),l=r(41361),u=r(24517),p=r(37476)},52132:(e,t,r)=>{const n=r(87851);e.exports=(e,t)=>n(e,t,!0)},54004:(e,t,r)=>{const n=r(28848),s=r(28220),o=r(89761),i=r(72386),a=r(51262),c=r(89639);e.exports=(e,t,r,l)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,l);case"!=":return s(e,r,l);case">":return o(e,r,l);case">=":return i(e,r,l);case"<":return a(e,r,l);case"<=":return c(e,r,l);default:throw new TypeError(`Invalid operator: ${t}`)}}},55039:(e,t,r)=>{const n=r(24517),s=r(37476);e.exports=(e,t,r)=>{let o=null,i=null,a=null;try{a=new s(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&-1!==i.compare(e)||(o=e,i=new n(o,r)))})),o}},55357:(e,t,r)=>{const n=r(24517),s=r(37476);e.exports=(e,t,r)=>{let o=null,i=null,a=null;try{a=new s(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&1!==i.compare(e)||(o=e,i=new n(o,r)))})),o}},56783:(e,t,r)=>{const n=r(24517),s=r(93955),{safeRe:o,t:i}=r(72841);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const n=t.includePrerelease?o[i.COERCERTLFULL]:o[i.COERCERTL];let s;for(;(s=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&s.index+s[0].length===r.index+r[0].length||(r=s),n.lastIndex=s.index+s[1].length+s[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?o[i.COERCEFULL]:o[i.COERCE]);if(null===r)return null;const a=r[2],c=r[3]||"0",l=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",p=t.includePrerelease&&r[6]?`+${r[6]}`:"";return s(`${a}.${c}.${l}${u}${p}`,t)}},58854:(e,t,r)=>{const n=r(24517),s=r(51565),{ANY:o}=s,i=r(37476),a=r(27229),c=r(89761),l=r(51262),u=r(89639),p=r(72386);e.exports=(e,t,r,h)=>{let d,E,f,m,v;switch(e=new n(e,h),t=new i(t,h),r){case">":d=c,E=u,f=l,m=">",v=">=";break;case"<":d=l,E=p,f=c,m="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let i=null,a=null;if(n.forEach((e=>{e.semver===o&&(e=new s(">=0.0.0")),i=i||e,a=a||e,d(e.semver,i.semver,h)?i=e:f(e.semver,a.semver,h)&&(a=e)})),i.operator===m||i.operator===v)return!1;if((!a.operator||a.operator===m)&&E(e,a.semver))return!1;if(a.operator===v&&f(e,a.semver))return!1}return!0}},58953:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},62174:(e,t,r)=>{var n=r(33486).hp,s=r(75765),o={data:n.alloc(0),dataLength:0,sequence:0};t.A=function(e,t){return{makeBlocks:function(r){var s,o,i=n.concat([(s=r.length,o=n.alloc(2),o.writeUInt16BE(s,0),o),r]),a=t-5,c=Math.ceil(i.length/a);i=n.concat([i,n.alloc(c*a-i.length+1).fill(0)]);for(var l=[],u=0;u<c;u++){var p=n.alloc(5);p.writeUInt16BE(e,0),p.writeUInt8(5,2),p.writeUInt16BE(u,3);var h=i.slice(u*a,(u+1)*a);l.push(n.concat([p,h]))}return l},reduceResponse:function(t,r){var i=t||o,a=i.data,c=i.dataLength,l=i.sequence;if(r.readUInt16BE(0)!==e)throw new s.TransportError("Invalid channel","InvalidChannel");if(5!==r.readUInt8(2))throw new s.TransportError("Invalid tag","InvalidTag");if(r.readUInt16BE(3)!==l)throw new s.TransportError("Invalid sequence","InvalidSequence");t||(c=r.readUInt16BE(5)),l++;var u=r.slice(t?5:7);return(a=n.concat([a,u])).length>c&&(a=a.slice(0,c)),{data:a,dataLength:c,sequence:l}},getReducedResult:function(e){if(e&&e.dataLength===e.data.length)return e.data}}}},69428:(e,t,r)=>{const n=r(93955);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},71280:(e,t,r)=>{const n=r(24517),s=r(37476),o=r(89761);e.exports=(e,t)=>{e=new s(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const s=e.set[t];let i=null;s.forEach((e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!o(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||r&&!o(r,i)||(r=i)}return r&&e.test(r)?r:null}},72386:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>n(e,t,r)>=0},72841:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:o}=r(79543),i=r(41361),a=(t=e.exports={}).re=[],c=t.safeRe=[],l=t.src=[],u=t.t={};let p=0;const h="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",o],[h,s]],E=(e,t,r)=>{const n=(e=>{for(const[t,r]of d)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),s=p++;i(e,s,t),u[e]=s,l[s]=t,a[s]=new RegExp(t,r?"g":void 0),c[s]=new RegExp(n,r?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),E("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),E("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${h}+`),E("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),E("FULL",`^${l[u.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),E("LOOSE",`^${l[u.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),E("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),E("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?`+`(?:${l[u.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",l[u.COERCE],!0),E("COERCERTLFULL",l[u.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",E("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",E("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},73269:(e,t,r)=>{const n=r(93955);e.exports=(e,t)=>{const r=n(e,null,!0),s=n(t,null,!0),o=r.compare(s);if(0===o)return null;const i=o>0,a=i?r:s,c=i?s:r,l=!!a.prerelease.length;if(c.prerelease.length&&!l)return c.patch||c.minor?a.patch?"patch":a.minor?"minor":"major":"major";const u=l?"pre":"";return r.major!==s.major?u+"major":r.minor!==s.minor?u+"minor":r.patch!==s.patch?u+"patch":"prerelease"}},76486:(e,t,r)=>{const n=r(27229),s=r(87851);e.exports=(e,t,r)=>{const o=[];let i=null,a=null;const c=e.sort(((e,t)=>s(e,t,r)));for(const e of c)n(e,t,r)?(a=e,i||(i=e)):(a&&o.push([i,a]),a=null,i=null);i&&o.push([i,null]);const l=[];for(const[e,t]of o)e===t?l.push(e):t||e!==c[0]?t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`):l.push("*");const u=l.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return u.length<p.length?u:t}},79543:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},86700:(e,t,r)=>{r.r(t),r.d(t,{default:()=>B});var n=r(50046),s=r.n(n),o=r(75765);let i=0;const a=[],c=(e,t,r)=>{const n={type:e,id:String(++i),date:new Date};t&&(n.message=t),r&&(n.data=r),u(n)};class l{constructor(e,t){this.type=e,this.context=t}trace(e,t){(({type:e,message:t,data:r,context:n})=>{const s={type:e,id:String(++i),date:new Date};t&&(s.message=t),r&&(s.data=r),n&&(s.context=n),u(s)})({type:this.type,message:e,data:t,context:this.context})}getContext(){return this.context}setContext(e){this.context=e}updateContext(e){this.context=Object.assign(Object.assign({},this.context),e)}getType(){return this.type}setType(e){this.type=e}withType(e){return new l(e,this.context)}withContext(e){return new l(this.type,e)}withUpdatedContext(e){return new l(this.type,Object.assign(Object.assign({},this.context),e))}}function u(e){for(let t=0;t<a.length;t++)try{a[t](e)}catch(e){console.error(e)}}"undefined"!=typeof window&&(window.__ledgerLogsListen=e=>(a.push(e),()=>{const t=a.indexOf(e);-1!==t&&(a[t]=a[a.length-1],a.pop())}));var p=r(33486).hp,h=function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};class d{constructor({context:e,logType:t}={}){this.exchangeTimeout=3e4,this.unresponsiveTimeout=15e3,this.deviceModel=null,this._events=new(s()),this.send=(e,t,r,n,...s)=>h(this,[e,t,r,n,...s],void 0,(function*(e,t,r,n,s=p.alloc(0),i=[o.StatusCodes.OK],{abortTimeoutMs:a}={}){const c=this.tracer.withUpdatedContext({function:"send"});if(s.length>=256)throw c.trace("data.length exceeded 256 bytes limit",{dataLength:s.length}),new o.TransportError("data.length exceed 256 bytes limit. Got: "+s.length,"DataLengthTooBig");c.trace("Starting an exchange",{abortTimeoutMs:a});const l=yield this.exchange(p.concat([p.from([e,t,r,n]),p.from([s.length]),s]),{abortTimeoutMs:a});c.trace("Received response from exchange");const u=l.readUInt16BE(l.length-2);if(!i.some((e=>e===u)))throw new o.TransportStatusError(u);return l})),this._appAPIlock=null,this.tracer=new l(null!=t?t:"transport",e)}exchange(e,{abortTimeoutMs:t}={}){throw new Error("exchange not implemented")}exchangeBulk(e,t){let r=!1;return(()=>h(this,void 0,void 0,(function*(){if(!r)for(const n of e){const e=yield this.exchange(n);if(r)return;const s=e.readUInt16BE(e.length-2);if(s!==o.StatusCodes.OK)throw new o.TransportStatusError(s);t.next(e)}})))().then((()=>!r&&t.complete()),(e=>!r&&t.error(e))),{unsubscribe:()=>{r=!0}}}setScrambleKey(e){}close(){return Promise.resolve()}on(e,t){this._events.on(e,t)}off(e,t){this._events.removeListener(e,t)}emit(e,...t){this._events.emit(e,...t)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(e){this.exchangeTimeout=e}setExchangeUnresponsiveTimeout(e){this.unresponsiveTimeout=e}static create(e=3e3,t){return new Promise(((r,n)=>{let s=!1;const i=this.listen({next:t=>{s=!0,i&&i.unsubscribe(),a&&clearTimeout(a),this.open(t.descriptor,e).then(r,n)},error:e=>{a&&clearTimeout(a),n(e)},complete:()=>{a&&clearTimeout(a),s||n(new o.TransportError(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),a=t?setTimeout((()=>{i.unsubscribe(),n(new o.TransportError(this.ErrorMessage_ListenTimeout,"ListenTimeout"))}),t):null}))}exchangeAtomicImpl(e){return h(this,void 0,void 0,(function*(){const t=this.tracer.withUpdatedContext({function:"exchangeAtomicImpl",unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw t.trace("Atomic exchange is already busy"),new o.TransportRaceCondition("An action was already pending on the Ledger device. Please deny or reconnect.");let r;const n=new Promise((e=>{r=e}));this.exchangeBusyPromise=n;let s=!1;const i=setTimeout((()=>{t.trace('Timeout reached, emitting Transport event "unresponsive"',{unresponsiveTimeout:this.unresponsiveTimeout}),s=!0,this.emit("unresponsive")}),this.unresponsiveTimeout);try{const r=yield e();return s&&(t.trace("Device was unresponsive, emitting responsive"),this.emit("responsive")),r}finally{t.trace("Finalize, clearing busy guard"),clearTimeout(i),r&&r(),this.exchangeBusyPromise=null}}))}decorateAppAPIMethods(e,t,r){for(const n of t)e[n]=this.decorateAppAPIMethod(n,e[n],e,r)}decorateAppAPIMethod(e,t,r,n){return(...s)=>h(this,void 0,void 0,(function*(){const{_appAPIlock:i}=this;if(i)return Promise.reject(new o.TransportError("Ledger Device is busy (lock "+i+")","TransportLocked"));try{return this._appAPIlock=e,this.setScrambleKey(n),yield t.apply(r,s)}finally{this._appAPIlock=null}}))}setTraceContext(e){this.tracer=this.tracer.withContext(e)}updateTraceContext(e){this.tracer.updateContext(e)}getTraceContext(){return this.tracer.getContext()}}d.ErrorMessage_ListenTimeout="No Ledger device found (timeout)",d.ErrorMessage_NoDeviceFound="No Ledger device found";const E=d;var f,m,v=r(62174),I=r(2722),g=r.n(I),$=function(){return $=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},$.apply(this,arguments)};!function(e){e.blue="blue",e.nanoS="nanoS",e.nanoSP="nanoSP",e.nanoX="nanoX",e.nanoFTS="nanoFTS"}(m||(m={}));var R=((f={})[m.blue]={id:m.blue,productName:"Ledger Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:491520,masks:[822083584,822149120],getBlockSize:function(e){return 4096}},f[m.nanoS]={id:m.nanoS,productName:"Ledger Nano S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,masks:[823132160],getBlockSize:function(e){var t;return g().lt(null!==(t=g().coerce(e))&&void 0!==t?t:"","2.0.0")?4096:2048}},f[m.nanoSP]={id:m.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1572864,masks:[856686592],getBlockSize:function(e){return 32}},f[m.nanoX]={id:m.nanoX,productName:"Ledger Nano X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,masks:[855638016],getBlockSize:function(e){return 4096},bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},f[m.nanoFTS]={id:m.nanoFTS,productName:"Ledger Nano FTS",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:2097152,masks:[857735168],getBlockSize:function(e){return 4096},bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]},f),w=(m.blue,m.nanoS,m.nanoSP,m.nanoX,m.nanoFTS,Object.values(R)),L=function(e){var t=w.find((function(t){return t.legacyUsbProductId===e}));if(t)return t;var r=e>>8;return w.find((function(e){return e.productIdMM===r}))},T=[],N={};for(var O in R){var S=R[O],y=S.bluetoothSpec;if(y)for(var A=0;A<y.length;A++){var x=y[A];T.push(x.serviceUuid),N[x.serviceUuid]=N[x.serviceUuid.replace(/-/g,"")]=$({deviceModel:S},x)}}var b,P=r(33486).hp,C=(b=function(e,t){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},b(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),M=function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))},_=function(e,t){var r,n,s,o,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(s=2&o[0]?n.return:o[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,o[1])).done)return s;switch(n=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!((s=(s=i.trys).length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){i.label=o[1];break}if(6===o[0]&&i.label<s[1]){i.label=s[1],s=o;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(o);break}s[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},D=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i},U=[{vendorId:11415}],F=function(){return Promise.resolve(!(!window.navigator||!window.navigator.hid))},j=function(){var e=navigator.hid;if(!e)throw new o.TransportError("navigator.hid is not supported","HIDNotSupported");return e};function G(){return M(this,void 0,void 0,(function(){var e;return _(this,(function(t){switch(t.label){case 0:return[4,j().requestDevice({filters:U})];case 1:return e=t.sent(),Array.isArray(e)?[2,e]:[2,[e]]}}))}))}function k(){return M(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return[4,j().getDevices()];case 1:return[2,e.sent().filter((function(e){return 11415===e.vendorId}))]}}))}))}var X=function(e){function t(t){var r=e.call(this)||this;return r.channel=Math.floor(65535*Math.random()),r.packetSize=64,r.inputs=[],r.read=function(){return r.inputs.length?Promise.resolve(r.inputs.shift()):new Promise((function(e){r.inputCallback=e}))},r.onInputReport=function(e){var t=P.from(e.data.buffer);r.inputCallback?(r.inputCallback(t),r.inputCallback=null):r.inputs.push(t)},r._disconnectEmitted=!1,r._emitDisconnect=function(e){r._disconnectEmitted||(r._disconnectEmitted=!0,r.emit("disconnect",e))},r.exchange=function(e){return M(r,void 0,void 0,(function(){var t=this;return _(this,(function(r){switch(r.label){case 0:return[4,this.exchangeAtomicImpl((function(){return M(t,void 0,void 0,(function(){var t,r,n,s,o,i,a,l,u;return _(this,(function(p){switch(p.label){case 0:r=(t=this).channel,n=t.packetSize,c("apdu","=> "+e.toString("hex")),s=(0,v.A)(r,n),o=s.makeBlocks(e),i=0,p.label=1;case 1:return i<o.length?[4,this.device.sendReport(0,o[i])]:[3,4];case 2:p.sent(),p.label=3;case 3:return i++,[3,1];case 4:return(a=s.getReducedResult(l))?[3,6]:[4,this.read()];case 5:return u=p.sent(),l=s.reduceResponse(l,u),[3,4];case 6:return c("apdu","<= "+a.toString("hex")),[2,a]}}))}))})).catch((function(e){if(e&&e.message&&e.message.includes("write"))throw t._emitDisconnect(e),new o.DisconnectedDeviceDuringOperation(e.message);throw e}))];case 1:return[2,r.sent()]}}))}))},r.device=t,r.deviceModel="number"==typeof t.productId?L(t.productId):void 0,t.addEventListener("inputreport",r.onInputReport),r}return C(t,e),t.request=function(){return M(this,void 0,void 0,(function(){var e,r;return _(this,(function(n){switch(n.label){case 0:return[4,G()];case 1:return e=D.apply(void 0,[n.sent(),1]),r=e[0],[2,t.open(r)]}}))}))},t.openConnected=function(){return M(this,void 0,void 0,(function(){var e;return _(this,(function(r){switch(r.label){case 0:return[4,k()];case 1:return 0===(e=r.sent()).length?[2,null]:[2,t.open(e[0])]}}))}))},t.open=function(e){return M(this,void 0,void 0,(function(){var r,n;return _(this,(function(s){switch(s.label){case 0:return[4,e.open()];case 1:return s.sent(),r=new t(e),n=function(t){e===t.device&&(j().removeEventListener("disconnect",n),r._emitDisconnect(new o.DisconnectedDevice))},j().addEventListener("disconnect",n),[2,r]}}))}))},t.prototype.close=function(){return M(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return[4,this.exchangeBusyPromise];case 1:return e.sent(),this.device.removeEventListener("inputreport",this.onInputReport),[4,this.device.close()];case 2:return e.sent(),[2]}}))}))},t.prototype.setScrambleKey=function(){},t.isSupported=F,t.list=k,t.listen=function(e){var t=!1;return function(){return M(this,void 0,void 0,(function(){var e;return _(this,(function(t){switch(t.label){case 0:return[4,k()];case 1:return(e=t.sent()).length>0?[2,e[0]]:[4,G()];case 2:return[2,t.sent()[0]]}}))}))}().then((function(r){if(r){if(!t){var n="number"==typeof r.productId?L(r.productId):void 0;e.next({type:"add",descriptor:r,deviceModel:n}),e.complete()}}else e.error(new o.TransportOpenUserCancelled("Access denied to use Ledger device"))}),(function(t){e.error(new o.TransportOpenUserCancelled(t.message))})),{unsubscribe:function(){t=!0}}},t}(E);const B=X},87555:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>n(t,e,r)},87851:(e,t,r)=>{const n=r(24517);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},89639:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>n(e,t,r)<=0},89761:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>n(e,t,r)>0},92281:(e,t,r)=>{const n=r(93955);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},93806:e=>{const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),s=t.test(r);return n&&s&&(e=+e,r=+r),e===r?0:n&&!s?-1:s&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},93810:(e,t,r)=>{const n=r(6106);e.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))},93955:(e,t,r)=>{const n=r(24517);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},96082:(e,t,r)=>{const n=r(24517);e.exports=(e,t)=>new n(e,t).patch}};
@@ -1,2 +0,0 @@
1
- /*! For license information please see 7084.index.js.LICENSE.txt */
2
- export const __webpack_id__=7084;export const __webpack_ids__=[7084];export const __webpack_modules__={17084:(t,e,n)=>{n.d(e,{secp256k1:()=>Zt});var r={};function o(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function i(t,...e){if(!((n=t)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name))throw new Error("Uint8Array expected");var n;if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function s(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}n.r(r),n.d(r,{aK:()=>j,e8:()=>R,DO:()=>O,dJ:()=>K,OG:()=>M,My:()=>L,Ph:()=>_,lX:()=>F,Id:()=>Z,fg:()=>Y,qj:()=>T,aT:()=>z,r4:()=>D,aY:()=>I,x:()=>X,lq:()=>P,z:()=>C,zW:()=>N,Q5:()=>Q});const f="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function a(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function c(t,e){return t<<32-e|t>>>e}function u(t){return"string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))}(t)),i(t),t}class l{clone(){return this._cloneInto()}}function h(t){const e=e=>t().update(u(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function d(t=32){if(f&&"function"==typeof f.getRandomValues)return f.getRandomValues(new Uint8Array(t));if(f&&"function"==typeof f.randomBytes)return f.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function g(t,e,n){return t&e^t&n^e&n}class w extends l{constructor(t,e,n,r){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=a(this.buffer)}update(t){s(this);const{view:e,buffer:n,blockLen:r}=this,o=(t=u(t)).length;for(let i=0;i<o;){const s=Math.min(r-this.pos,o-i);if(s!==r)n.set(t.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===r&&(this.process(e,0),this.pos=0);else{const e=a(t);for(;r<=o-i;i+=r)this.process(e,i)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){s(this),function(t,e){i(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}(t,this),this.finished=!0;const{buffer:e,view:n,blockLen:r,isLE:o}=this;let{pos:f}=this;e[f++]=128,this.buffer.subarray(f).fill(0),this.padOffset>r-f&&(this.process(n,0),f=0);for(let t=f;t<r;t++)e[t]=0;!function(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const o=BigInt(32),i=BigInt(4294967295),s=Number(n>>o&i),f=Number(n&i),a=r?4:0,c=r?0:4;t.setUint32(e+a,s,r),t.setUint32(e+c,f,r)}(n,r-8,BigInt(8*this.length),o),this.process(n,0);const c=a(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,h=this.get();if(l>h.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<l;t++)c.setUint32(4*t,h[t],o)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:n,length:r,finished:o,destroyed:i,pos:s}=this;return t.length=r,t.pos=s,t.finished=o,t.destroyed=i,r%e&&t.buffer.set(n),t}}const p=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),y=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),m=new Uint32Array(64);class E extends w{constructor(){super(64,32,8,!1),this.A=0|y[0],this.B=0|y[1],this.C=0|y[2],this.D=0|y[3],this.E=0|y[4],this.F=0|y[5],this.G=0|y[6],this.H=0|y[7]}get(){const{A:t,B:e,C:n,D:r,E:o,F:i,G:s,H:f}=this;return[t,e,n,r,o,i,s,f]}set(t,e,n,r,o,i,s,f){this.A=0|t,this.B=0|e,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|f}process(t,e){for(let n=0;n<16;n++,e+=4)m[n]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=m[t-15],n=m[t-2],r=c(e,7)^c(e,18)^e>>>3,o=c(n,17)^c(n,19)^n>>>10;m[t]=o+m[t-7]+r+m[t-16]|0}let{A:n,B:r,C:o,D:i,E:s,F:f,G:a,H:u}=this;for(let t=0;t<64;t++){const e=u+(c(s,6)^c(s,11)^c(s,25))+((l=s)&f^~l&a)+p[t]+m[t]|0,h=(c(n,2)^c(n,13)^c(n,22))+g(n,r,o)|0;u=a,a=f,f=s,s=i+e|0,i=o,o=r,r=n,n=e+h|0}var l;n=n+this.A|0,r=r+this.B|0,o=o+this.C|0,i=i+this.D|0,s=s+this.E|0,f=f+this.F|0,a=a+this.G|0,u=u+this.H|0,this.set(n,r,o,i,s,f,a,u)}roundClean(){m.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const b=h((()=>new E));class B extends l{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");o(t.outputLen),o(t.blockLen)}(t);const n=u(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?t.create().update(n).digest():n);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),i.fill(0)}update(t){return s(this),this.iHash.update(t),this}digestInto(t){s(this),i(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:o,blockLen:i,outputLen:s}=this;return t.finished=r,t.destroyed=o,t.blockLen=i,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const v=(t,e,n)=>new B(t,e).update(n).digest();v.create=(t,e)=>new B(t,e);const x=BigInt(0),A=BigInt(1),S=BigInt(2);function I(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function O(t){if(!I(t))throw new Error("Uint8Array expected")}function R(t,e){if("boolean"!=typeof e)throw new Error(t+" boolean expected, got "+e)}const q=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function L(t){O(t);let e="";for(let n=0;n<t.length;n++)e+=q[t[n]];return e}function N(t){const e=t.toString(16);return 1&e.length?"0"+e:e}function U(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?x:BigInt("0x"+t)}const H={_0:48,_9:57,A:65,F:70,a:97,f:102};function k(t){return t>=H._0&&t<=H._9?t-H._0:t>=H.A&&t<=H.F?t-(H.A-10):t>=H.a&&t<=H.f?t-(H.a-10):void 0}function z(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let e=0,o=0;e<n;e++,o+=2){const n=k(t.charCodeAt(o)),i=k(t.charCodeAt(o+1));if(void 0===n||void 0===i){const e=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+o)}r[e]=16*n+i}return r}function _(t){return U(L(t))}function F(t){return O(t),U(L(Uint8Array.from(t).reverse()))}function P(t,e){return z(t.toString(16).padStart(2*e,"0"))}function C(t,e){return P(t,e).reverse()}function T(t,e,n){let r;if("string"==typeof e)try{r=z(e)}catch(e){throw new Error(t+" must be hex string or Uint8Array, cause: "+e)}else{if(!I(e))throw new Error(t+" must be hex string or Uint8Array");r=Uint8Array.from(e)}const o=r.length;if("number"==typeof n&&o!==n)throw new Error(t+" of length "+n+" expected, got "+o);return r}function Z(...t){let e=0;for(let n=0;n<t.length;n++){const r=t[n];O(r),e+=r.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const o=t[e];n.set(o,r),r+=o.length}return n}const V=t=>"bigint"==typeof t&&x<=t;function D(t,e,n){return V(t)&&V(e)&&V(n)&&e<=t&&t<n}function j(t,e,n,r){if(!D(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function K(t){let e;for(e=0;t>x;t>>=A,e+=1);return e}const M=t=>(S<<BigInt(t-1))-A,G=t=>new Uint8Array(t),W=t=>Uint8Array.from(t);function Y(t,e,n){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=G(t),o=G(t),i=0;const s=()=>{r.fill(1),o.fill(0),i=0},f=(...t)=>n(o,r,...t),a=(t=G())=>{o=f(W([0]),t),r=f(),0!==t.length&&(o=f(W([1]),t),r=f())},c=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const n=[];for(;t<e;){r=f();const e=r.slice();n.push(e),t+=r.length}return Z(...n)};return(t,e)=>{let n;for(s(),a(t);!(n=e(c()));)a();return s(),n}}const J={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||I(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function Q(t,e,n={}){const r=(e,n,r)=>{const o=J[n];if("function"!=typeof o)throw new Error("invalid validator function");const i=t[e];if(!(r&&void 0===i||o(i,t)))throw new Error("param "+String(e)+" is invalid. Expected "+n+", got "+i)};for(const[t,n]of Object.entries(e))r(t,n,!1);for(const[t,e]of Object.entries(n))r(t,e,!0);return t}function X(t){const e=new WeakMap;return(n,...r)=>{const o=e.get(n);if(void 0!==o)return o;const i=t(n,...r);return e.set(n,i),i}}const $=BigInt(0),tt=BigInt(1),et=BigInt(2),nt=BigInt(3),rt=BigInt(4),ot=BigInt(5),it=BigInt(8);function st(t,e){const n=t%e;return n>=$?n:e+n}function ft(t,e,n){if(e<$)throw new Error("invalid exponent, negatives unsupported");if(n<=$)throw new Error("invalid modulus");if(n===tt)return $;let r=tt;for(;e>$;)e&tt&&(r=r*t%n),t=t*t%n,e>>=tt;return r}function at(t,e,n){let r=t;for(;e-- >$;)r*=r,r%=n;return r}function ct(t,e){if(t===$)throw new Error("invert: expected non-zero number");if(e<=$)throw new Error("invert: expected positive modulus, got "+e);let n=st(t,e),r=e,o=$,i=tt,s=tt,f=$;for(;n!==$;){const t=r/n,e=r%n,a=o-s*t,c=i-f*t;r=n,n=e,o=s,i=f,s=a,f=c}if(r!==tt)throw new Error("invert: does not exist");return st(o,e)}const ut=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function lt(t,e){const n=void 0!==e?e:t.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function ht(t,e,n=!1,r={}){if(t<=$)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:o,nByteLength:i}=lt(t,e);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const f=Object.freeze({ORDER:t,isLE:n,BITS:o,BYTES:i,MASK:M(o),ZERO:$,ONE:tt,create:e=>st(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return $<=e&&e<t},is0:t=>t===$,isOdd:t=>(t&tt)===tt,neg:e=>st(-e,t),eql:(t,e)=>t===e,sqr:e=>st(e*e,t),add:(e,n)=>st(e+n,t),sub:(e,n)=>st(e-n,t),mul:(e,n)=>st(e*n,t),pow:(t,e)=>function(t,e,n){if(n<$)throw new Error("invalid exponent, negatives unsupported");if(n===$)return t.ONE;if(n===tt)return e;let r=t.ONE,o=e;for(;n>$;)n&tt&&(r=t.mul(r,o)),o=t.sqr(o),n>>=tt;return r}(f,t,e),div:(e,n)=>st(e*ct(n,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>ct(e,t),sqrt:r.sqrt||(e=>(s||(s=function(t){if(t%rt===nt){const e=(t+tt)/rt;return function(t,n){const r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}}if(t%it===ot){const e=(t-ot)/it;return function(t,n){const r=t.mul(n,et),o=t.pow(r,e),i=t.mul(n,o),s=t.mul(t.mul(i,et),o),f=t.mul(i,t.sub(s,t.ONE));if(!t.eql(t.sqr(f),n))throw new Error("Cannot find square root");return f}}return function(t){const e=(t-tt)/et;let n,r,o;for(n=t-tt,r=0;n%et===$;n/=et,r++);for(o=et;o<t&&ft(o,e,t)!==t-tt;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===r){const e=(t+tt)/rt;return function(t,n){const r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}}const i=(n+tt)/et;return function(t,s){if(t.pow(s,e)===t.neg(t.ONE))throw new Error("Cannot find square root");let f=r,a=t.pow(t.mul(t.ONE,o),n),c=t.pow(s,i),u=t.pow(s,n);for(;!t.eql(u,t.ONE);){if(t.eql(u,t.ZERO))return t.ZERO;let e=1;for(let n=t.sqr(u);e<f&&!t.eql(n,t.ONE);e++)n=t.sqr(n);const n=t.pow(a,tt<<BigInt(f-e-1));a=t.sqr(n),c=t.mul(c,n),u=t.mul(u,a),f=e}return c}}(t)}(t)),s(f,e))),invertBatch:t=>function(t,e){const n=new Array(e.length),r=e.reduce(((e,r,o)=>t.is0(r)?e:(n[o]=e,t.mul(e,r))),t.ONE),o=t.inv(r);return e.reduceRight(((e,r,o)=>t.is0(r)?e:(n[o]=t.mul(e,n[o]),t.mul(e,r))),o),n}(f,t),cmov:(t,e,n)=>n?e:t,toBytes:t=>n?C(t,i):P(t,i),fromBytes:t=>{if(t.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);return n?F(t):_(t)}});return Object.freeze(f)}function dt(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function gt(t){const e=dt(t);return e+Math.ceil(e/2)}const wt=BigInt(0),pt=BigInt(1);function yt(t,e){const n=e.negate();return t?n:e}function mt(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function Et(t,e){return mt(t,e),{windows:Math.ceil(e/t)+1,windowSize:2**(t-1)}}const bt=new WeakMap,Bt=new WeakMap;function vt(t){return Bt.get(t)||1}function xt(t){return Q(t.Fp,ut.reduce(((t,e)=>(t[e]="function",t)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),Q(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...lt(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}function At(t){void 0!==t.lowS&&R("lowS",t.lowS),void 0!==t.prehash&&R("prehash",t.prehash)}const{Ph:St,aT:It}=r;class Ot extends Error{constructor(t=""){super(t)}}const Rt={Err:Ot,_tlv:{encode:(t,e)=>{const{Err:n}=Rt;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(1&e.length)throw new n("tlv.encode: unpadded data");const r=e.length/2,o=N(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const i=r>127?N(o.length/2|128):"";return N(t)+i+o+e},decode(t,e){const{Err:n}=Rt;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const o=e[r++];let i=0;if(128&o){const t=127&o;if(!t)throw new n("tlv.decode(long): indefinite length not supported");if(t>4)throw new n("tlv.decode(long): byte length is too big");const s=e.subarray(r,r+t);if(s.length!==t)throw new n("tlv.decode: length bytes not complete");if(0===s[0])throw new n("tlv.decode(long): zero leftmost byte");for(const t of s)i=i<<8|t;if(r+=t,i<128)throw new n("tlv.decode(long): not minimal encoding")}else i=o;const s=e.subarray(r,r+i);if(s.length!==i)throw new n("tlv.decode: wrong value length");return{v:s,l:e.subarray(r+i)}}},_int:{encode(t){const{Err:e}=Rt;if(t<qt)throw new e("integer: negative integers are not allowed");let n=N(t);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=Rt;if(128&t[0])throw new e("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new e("invalid signature integer: unnecessary leading zero");return St(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=Rt,o="string"==typeof t?It(t):t;O(o);const{v:i,l:s}=r.decode(48,o);if(s.length)throw new e("invalid signature: left bytes after parsing");const{v:f,l:a}=r.decode(2,i),{v:c,l:u}=r.decode(2,a);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(f),s:n.decode(c)}},hexFromSig(t){const{_tlv:e,_int:n}=Rt,r=e.encode(2,n.encode(t.r))+e.encode(2,n.encode(t.s));return e.encode(48,r)}},qt=BigInt(0),Lt=BigInt(1),Nt=(BigInt(2),BigInt(3));function Ut(t){const e=function(t){const e=xt(t);Q(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:o}=e;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}(t),{Fp:n}=e,r=ht(e.n,e.nBitLength),o=e.toBytes||((t,e,r)=>{const o=e.toAffine();return Z(Uint8Array.from([4]),n.toBytes(o.x),n.toBytes(o.y))}),i=e.fromBytes||(t=>{const e=t.subarray(1);return{x:n.fromBytes(e.subarray(0,n.BYTES)),y:n.fromBytes(e.subarray(n.BYTES,2*n.BYTES))}});function s(t){const{a:r,b:o}=e,i=n.sqr(t),s=n.mul(i,t);return n.add(n.add(s,n.mul(t,r)),o)}if(!n.eql(n.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function f(t){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:o,n:i}=e;if(n&&"bigint"!=typeof t){if(I(t)&&(t=L(t)),"string"!=typeof t||!n.includes(t.length))throw new Error("invalid private key");t=t.padStart(2*r,"0")}let s;try{s="bigint"==typeof t?t:_(T("private key",t,r))}catch(e){throw new Error("invalid private key, expected hex or "+r+" bytes, got "+typeof t)}return o&&(s=st(s,i)),j("private key",s,Lt,i),s}function a(t){if(!(t instanceof l))throw new Error("ProjectivePoint expected")}const c=X(((t,e)=>{const{px:r,py:o,pz:i}=t;if(n.eql(i,n.ONE))return{x:r,y:o};const s=t.is0();null==e&&(e=s?n.ONE:n.inv(i));const f=n.mul(r,e),a=n.mul(o,e),c=n.mul(i,e);if(s)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw new Error("invZ was invalid");return{x:f,y:a}})),u=X((t=>{if(t.is0()){if(e.allowInfinityPoint&&!n.is0(t.py))return;throw new Error("bad point: ZERO")}const{x:r,y:o}=t.toAffine();if(!n.isValid(r)||!n.isValid(o))throw new Error("bad point: x or y not FE");const i=n.sqr(o),f=s(r);if(!n.eql(i,f))throw new Error("bad point: equation left != right");if(!t.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0}));class l{constructor(t,e,r){if(this.px=t,this.py=e,this.pz=r,null==t||!n.isValid(t))throw new Error("x required");if(null==e||!n.isValid(e))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required");Object.freeze(this)}static fromAffine(t){const{x:e,y:r}=t||{};if(!t||!n.isValid(e)||!n.isValid(r))throw new Error("invalid affine point");if(t instanceof l)throw new Error("projective point not allowed");const o=t=>n.eql(t,n.ZERO);return o(e)&&o(r)?l.ZERO:new l(e,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){const e=n.invertBatch(t.map((t=>t.pz)));return t.map(((t,n)=>t.toAffine(e[n]))).map(l.fromAffine)}static fromHex(t){const e=l.fromAffine(i(T("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return l.BASE.multiply(f(t))}static msm(t,e){return function(t,e,n,r){if(function(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach(((t,n)=>{if(!(t instanceof e))throw new Error("invalid point at index "+n)}))}(n,t),function(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach(((t,n)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+n)}))}(r,e),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,i=K(BigInt(n.length)),s=i>12?i-3:i>4?i-2:i?2:1,f=(1<<s)-1,a=new Array(f+1).fill(o);let c=o;for(let t=Math.floor((e.BITS-1)/s)*s;t>=0;t-=s){a.fill(o);for(let e=0;e<r.length;e++){const o=r[e],i=Number(o>>BigInt(t)&BigInt(f));a[i]=a[i].add(n[e])}let e=o;for(let t=a.length-1,n=o;t>0;t--)n=n.add(a[t]),e=e.add(n);if(c=c.add(e),0!==t)for(let t=0;t<s;t++)c=c.double()}return c}(l,r,t,e)}_setWindowSize(t){d.setWindowSize(this,t)}assertValidity(){u(this)}hasEvenY(){const{y:t}=this.toAffine();if(n.isOdd)return!n.isOdd(t);throw new Error("Field doesn't support isOdd")}equals(t){a(t);const{px:e,py:r,pz:o}=this,{px:i,py:s,pz:f}=t,c=n.eql(n.mul(e,f),n.mul(i,o)),u=n.eql(n.mul(r,f),n.mul(s,o));return c&&u}negate(){return new l(this.px,n.neg(this.py),this.pz)}double(){const{a:t,b:r}=e,o=n.mul(r,Nt),{px:i,py:s,pz:f}=this;let a=n.ZERO,c=n.ZERO,u=n.ZERO,h=n.mul(i,i),d=n.mul(s,s),g=n.mul(f,f),w=n.mul(i,s);return w=n.add(w,w),u=n.mul(i,f),u=n.add(u,u),a=n.mul(t,u),c=n.mul(o,g),c=n.add(a,c),a=n.sub(d,c),c=n.add(d,c),c=n.mul(a,c),a=n.mul(w,a),u=n.mul(o,u),g=n.mul(t,g),w=n.sub(h,g),w=n.mul(t,w),w=n.add(w,u),u=n.add(h,h),h=n.add(u,h),h=n.add(h,g),h=n.mul(h,w),c=n.add(c,h),g=n.mul(s,f),g=n.add(g,g),h=n.mul(g,w),a=n.sub(a,h),u=n.mul(g,d),u=n.add(u,u),u=n.add(u,u),new l(a,c,u)}add(t){a(t);const{px:r,py:o,pz:i}=this,{px:s,py:f,pz:c}=t;let u=n.ZERO,h=n.ZERO,d=n.ZERO;const g=e.a,w=n.mul(e.b,Nt);let p=n.mul(r,s),y=n.mul(o,f),m=n.mul(i,c),E=n.add(r,o),b=n.add(s,f);E=n.mul(E,b),b=n.add(p,y),E=n.sub(E,b),b=n.add(r,i);let B=n.add(s,c);return b=n.mul(b,B),B=n.add(p,m),b=n.sub(b,B),B=n.add(o,i),u=n.add(f,c),B=n.mul(B,u),u=n.add(y,m),B=n.sub(B,u),d=n.mul(g,b),u=n.mul(w,m),d=n.add(u,d),u=n.sub(y,d),d=n.add(y,d),h=n.mul(u,d),y=n.add(p,p),y=n.add(y,p),m=n.mul(g,m),b=n.mul(w,b),y=n.add(y,m),m=n.sub(p,m),m=n.mul(g,m),b=n.add(b,m),p=n.mul(y,b),h=n.add(h,p),p=n.mul(B,b),u=n.mul(E,u),u=n.sub(u,p),p=n.mul(E,y),d=n.mul(B,d),d=n.add(d,p),new l(u,h,d)}subtract(t){return this.add(t.negate())}is0(){return this.equals(l.ZERO)}wNAF(t){return d.wNAFCached(this,t,l.normalizeZ)}multiplyUnsafe(t){const{endo:r,n:o}=e;j("scalar",t,qt,o);const i=l.ZERO;if(t===qt)return i;if(this.is0()||t===Lt)return this;if(!r||d.hasPrecomputes(this))return d.wNAFCachedUnsafe(this,t,l.normalizeZ);let{k1neg:s,k1:f,k2neg:a,k2:c}=r.splitScalar(t),u=i,h=i,g=this;for(;f>qt||c>qt;)f&Lt&&(u=u.add(g)),c&Lt&&(h=h.add(g)),g=g.double(),f>>=Lt,c>>=Lt;return s&&(u=u.negate()),a&&(h=h.negate()),h=new l(n.mul(h.px,r.beta),h.py,h.pz),u.add(h)}multiply(t){const{endo:r,n:o}=e;let i,s;if(j("scalar",t,Lt,o),r){const{k1neg:e,k1:o,k2neg:f,k2:a}=r.splitScalar(t);let{p:c,f:u}=this.wNAF(o),{p:h,f:g}=this.wNAF(a);c=d.constTimeNegate(e,c),h=d.constTimeNegate(f,h),h=new l(n.mul(h.px,r.beta),h.py,h.pz),i=c.add(h),s=u.add(g)}else{const{p:e,f:n}=this.wNAF(t);i=e,s=n}return l.normalizeZ([i,s])[0]}multiplyAndAddUnsafe(t,e,n){const r=l.BASE,o=(t,e)=>e!==qt&&e!==Lt&&t.equals(r)?t.multiply(e):t.multiplyUnsafe(e),i=o(this,e).add(o(t,n));return i.is0()?void 0:i}toAffine(t){return c(this,t)}isTorsionFree(){const{h:t,isTorsionFree:n}=e;if(t===Lt)return!0;if(n)return n(l,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:t,clearCofactor:n}=e;return t===Lt?this:n?n(l,this):this.multiplyUnsafe(e.h)}toRawBytes(t=!0){return R("isCompressed",t),this.assertValidity(),o(l,this,t)}toHex(t=!0){return R("isCompressed",t),L(this.toRawBytes(t))}}l.BASE=new l(e.Gx,e.Gy,n.ONE),l.ZERO=new l(n.ZERO,n.ONE,n.ZERO);const h=e.nBitLength,d=(g=l,w=e.endo?Math.ceil(h/2):h,{constTimeNegate:yt,hasPrecomputes:t=>1!==vt(t),unsafeLadder(t,e,n=g.ZERO){let r=t;for(;e>wt;)e&pt&&(n=n.add(r)),r=r.double(),e>>=pt;return n},precomputeWindow(t,e){const{windows:n,windowSize:r}=Et(e,w),o=[];let i=t,s=i;for(let t=0;t<n;t++){s=i,o.push(s);for(let t=1;t<r;t++)s=s.add(i),o.push(s);i=s.double()}return o},wNAF(t,e,n){const{windows:r,windowSize:o}=Et(t,w);let i=g.ZERO,s=g.BASE;const f=BigInt(2**t-1),a=2**t,c=BigInt(t);for(let t=0;t<r;t++){const r=t*o;let u=Number(n&f);n>>=c,u>o&&(u-=a,n+=pt);const l=r,h=r+Math.abs(u)-1,d=t%2!=0,g=u<0;0===u?s=s.add(yt(d,e[l])):i=i.add(yt(g,e[h]))}return{p:i,f:s}},wNAFUnsafe(t,e,n,r=g.ZERO){const{windows:o,windowSize:i}=Et(t,w),s=BigInt(2**t-1),f=2**t,a=BigInt(t);for(let t=0;t<o;t++){const o=t*i;if(n===wt)break;let c=Number(n&s);if(n>>=a,c>i&&(c-=f,n+=pt),0===c)continue;let u=e[o+Math.abs(c)-1];c<0&&(u=u.negate()),r=r.add(u)}return r},getPrecomputes(t,e,n){let r=bt.get(e);return r||(r=this.precomputeWindow(e,t),1!==t&&bt.set(e,n(r))),r},wNAFCached(t,e,n){const r=vt(t);return this.wNAF(r,this.getPrecomputes(r,t,n),e)},wNAFCachedUnsafe(t,e,n,r){const o=vt(t);return 1===o?this.unsafeLadder(t,e,r):this.wNAFUnsafe(o,this.getPrecomputes(o,t,n),e,r)},setWindowSize(t,e){mt(e,w),Bt.set(t,e),bt.delete(t)}});var g,w;return{CURVE:e,ProjectivePoint:l,normPrivateKeyToScalar:f,weierstrassEquation:s,isWithinCurveOrder:function(t){return D(t,Lt,e.n)}}}function Ht(t){const e=function(t){const e=xt(t);return Q(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:n,n:r}=e,o=n.BYTES+1,i=2*n.BYTES+1;function s(t){return st(t,r)}function f(t){return ct(t,r)}const{ProjectivePoint:a,normPrivateKeyToScalar:c,weierstrassEquation:u,isWithinCurveOrder:l}=Ut({...e,toBytes(t,e,r){const o=e.toAffine(),i=n.toBytes(o.x),s=Z;return R("isCompressed",r),r?s(Uint8Array.from([e.hasEvenY()?2:3]),i):s(Uint8Array.from([4]),i,n.toBytes(o.y))},fromBytes(t){const e=t.length,r=t[0],s=t.subarray(1);if(e!==o||2!==r&&3!==r){if(e===i&&4===r)return{x:n.fromBytes(s.subarray(0,n.BYTES)),y:n.fromBytes(s.subarray(n.BYTES,2*n.BYTES))};throw new Error("invalid Point, expected length of "+o+", or uncompressed "+i+", got "+e)}{const t=_(s);if(!D(t,Lt,n.ORDER))throw new Error("Point is not on curve");const e=u(t);let o;try{o=n.sqrt(e)}catch(t){const e=t instanceof Error?": "+t.message:"";throw new Error("Point is not on curve"+e)}return!(1&~r)!=((o&Lt)===Lt)&&(o=n.neg(o)),{x:t,y:o}}}}),h=t=>L(P(t,e.nByteLength));function d(t){return t>r>>Lt}const g=(t,e,n)=>_(t.slice(e,n));class w{constructor(t,e,n){this.r=t,this.s=e,this.recovery=n,this.assertValidity()}static fromCompact(t){const n=e.nByteLength;return t=T("compactSignature",t,2*n),new w(g(t,0,n),g(t,n,2*n))}static fromDER(t){const{r:e,s:n}=Rt.toSig(T("DER",t));return new w(e,n)}assertValidity(){j("r",this.r,Lt,r),j("s",this.s,Lt,r)}addRecoveryBit(t){return new w(this.r,this.s,t)}recoverPublicKey(t){const{r,s:o,recovery:i}=this,c=E(T("msgHash",t));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const u=2===i||3===i?r+e.n:r;if(u>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const l=1&i?"03":"02",d=a.fromHex(l+h(u)),g=f(u),w=s(-c*g),p=s(o*g),y=a.BASE.multiplyAndAddUnsafe(d,w,p);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new w(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return z(this.toDERHex())}toDERHex(){return Rt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return z(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const p={isValidPrivateKey(t){try{return c(t),!0}catch(t){return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const t=gt(e.n);return function(t,e,n=!1){const r=t.length,o=dt(e),i=gt(e);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const s=st(n?F(t):_(t),e-tt)+tt;return n?C(s,o):P(s,o)}(e.randomBytes(t),e.n)},precompute:(t=8,e=a.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)};function y(t){const e=I(t),n="string"==typeof t,r=(e||n)&&t.length;return e?r===o||r===i:n?r===2*o||r===2*i:t instanceof a}const m=e.bits2int||function(t){if(t.length>8192)throw new Error("input is too large");const n=_(t),r=8*t.length-e.nBitLength;return r>0?n>>BigInt(r):n},E=e.bits2int_modN||function(t){return s(m(t))},b=M(e.nBitLength);function B(t){return j("num < 2^"+e.nBitLength,t,qt,b),P(t,e.nByteLength)}const v={lowS:e.lowS,prehash:!1},x={lowS:e.lowS,prehash:!1};return a.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t,e=!0){return a.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,n=!0){if(y(t))throw new Error("first arg must be private key");if(!y(e))throw new Error("second arg must be public key");return a.fromHex(e).multiply(c(t)).toRawBytes(n)},sign:function(t,r,o=v){const{seed:i,k2sig:u}=function(t,r,o=v){if(["recovered","canonical"].some((t=>t in o)))throw new Error("sign() legacy options not supported");const{hash:i,randomBytes:u}=e;let{lowS:h,prehash:g,extraEntropy:p}=o;null==h&&(h=!0),t=T("msgHash",t),At(o),g&&(t=T("prehashed msgHash",i(t)));const y=E(t),b=c(r),x=[B(b),B(y)];if(null!=p&&!1!==p){const t=!0===p?u(n.BYTES):p;x.push(T("extraEntropy",t))}const A=Z(...x),S=y;return{seed:A,k2sig:function(t){const e=m(t);if(!l(e))return;const n=f(e),r=a.BASE.multiply(e).toAffine(),o=s(r.x);if(o===qt)return;const i=s(n*s(S+o*b));if(i===qt)return;let c=(r.x===o?0:2)|Number(r.y&Lt),u=i;return h&&d(i)&&(u=function(t){return d(t)?s(-t):t}(i),c^=1),new w(o,u,c)}}}(t,r,o),h=e;return Y(h.hash.outputLen,h.nByteLength,h.hmac)(i,u)},verify:function(t,n,r,o=x){const i=t;n=T("msgHash",n),r=T("publicKey",r);const{lowS:c,prehash:u,format:l}=o;if(At(o),"strict"in o)throw new Error("options.strict was renamed to lowS");if(void 0!==l&&"compact"!==l&&"der"!==l)throw new Error("format must be compact or der");const h="string"==typeof i||I(i),d=!h&&!l&&"object"==typeof i&&null!==i&&"bigint"==typeof i.r&&"bigint"==typeof i.s;if(!h&&!d)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let g,p;try{if(d&&(g=new w(i.r,i.s)),h){try{"compact"!==l&&(g=w.fromDER(i))}catch(t){if(!(t instanceof Rt.Err))throw t}g||"der"===l||(g=w.fromCompact(i))}p=a.fromHex(r)}catch(t){return!1}if(!g)return!1;if(c&&g.hasHighS())return!1;u&&(n=e.hash(n));const{r:y,s:m}=g,b=E(n),B=f(m),v=s(b*B),A=s(y*B),S=a.BASE.multiplyAndAddUnsafe(p,v,A)?.toAffine();return!!S&&s(S.x)===y},ProjectivePoint:a,Signature:w,utils:p}}function kt(t){return{hash:t,hmac:(e,...n)=>v(t,e,function(...t){let e=0;for(let n=0;n<t.length;n++){const r=t[n];i(r),e+=r.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const o=t[e];n.set(o,r),r+=o.length}return n}(...n)),randomBytes:d}}BigInt(4);const zt=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),_t=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Ft=BigInt(1),Pt=BigInt(2),Ct=(t,e)=>(t+e/Pt)/e;const Tt=ht(zt,void 0,void 0,{sqrt:function(t){const e=zt,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),s=BigInt(23),f=BigInt(44),a=BigInt(88),c=t*t*t%e,u=c*c*t%e,l=at(u,n,e)*u%e,h=at(l,n,e)*u%e,d=at(h,Pt,e)*c%e,g=at(d,o,e)*d%e,w=at(g,i,e)*g%e,p=at(w,f,e)*w%e,y=at(p,a,e)*p%e,m=at(y,f,e)*w%e,E=at(m,n,e)*u%e,b=at(E,s,e)*g%e,B=at(b,r,e)*c%e,v=at(B,Pt,e);if(!Tt.eql(Tt.sqr(v),t))throw new Error("Cannot find square root");return v}}),Zt=function(t,e){const n=e=>Ht({...t,...kt(e)});return{...n(e),create:n}}({a:BigInt(0),b:BigInt(7),Fp:Tt,n:_t,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=_t,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Ft*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,s=BigInt("0x100000000000000000000000000000000"),f=Ct(i*t,e),a=Ct(-r*t,e);let c=st(t-f*n-a*o,e),u=st(-f*r-a*i,e);const l=c>s,h=u>s;if(l&&(c=e-c),h&&(u=e-u),c>s||u>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:l,k1:c,k2neg:h,k2:u}}}},b);BigInt(0),Zt.ProjectivePoint}};
@@ -1 +0,0 @@
1
- export const __webpack_id__=7544;export const __webpack_ids__=[7544];export const __webpack_modules__={47544:(e,a,t)=>{t.d(a,{offchainLookup:()=>w,offchainLookupSignature:()=>m});var s=t(52983),r=t(40022),n=t(14323),o=t(30476);class c extends n.C{constructor({callbackSelector:e,cause:a,data:t,extraData:s,sender:r,urls:n}){super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],a.metaMessages?.length?"":[],"Offchain Gateway Call:",n&&[" Gateway URL(s):",...n.map((e=>` ${(0,o.I)(e)}`))],` Sender: ${r}`,` Data: ${t}`,` Callback selector: ${e}`,` Extra data: ${s}`].flat(),name:"OffchainLookupError"})}}class d extends n.C{constructor({result:e,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,o.I)(a)}`,`Response: ${(0,r.A)(e)}`],name:"OffchainLookupResponseMalformedError"})}}class l extends n.C{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`],name:"OffchainLookupSenderMismatchError"})}}var u=t(38820),i=t(16395),p=t(58470),f=t(93606),h=t(30666),y=t(23785);const m="0x556f1830",b={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function w(e,{blockNumber:a,blockTag:t,data:r,to:n}){const{args:o}=(0,i.W)({data:r,abi:[b]}),[d,u,y,m,w]=o,{ccipRead:g}=e,x=g&&"function"==typeof g?.request?g.request:k;try{if(!(0,f.h)(n,d))throw new l({sender:d,to:n});const r=await x({data:y,sender:d,urls:u}),{data:o}=await(0,s.T)(e,{blockNumber:a,blockTag:t,data:(0,h.xW)([m,(0,p.h)([{type:"bytes"},{type:"bytes"}],[r,w])]),to:n});return o}catch(e){throw new c({callbackSelector:m,cause:e,data:r,extraData:w,sender:d,urls:u})}}async function k({data:e,sender:a,urls:t}){let s=new Error("An unknown error occurred.");for(let n=0;n<t.length;n++){const o=t[n],c=o.includes("{data}")?"GET":"POST",l="POST"===c?{data:e,sender:a}:void 0,i="POST"===c?{"Content-Type":"application/json"}:{};try{const t=await fetch(o.replace("{sender}",a).replace("{data}",e),{body:JSON.stringify(l),headers:i,method:c});let n;if(n=t.headers.get("Content-Type")?.startsWith("application/json")?(await t.json()).data:await t.text(),!t.ok){s=new u.Ci({body:l,details:n?.error?(0,r.A)(n.error):t.statusText,headers:t.headers,status:t.status,url:o});continue}if(!(0,y.q)(n)){s=new d({result:n,url:o});continue}return n}catch(e){s=new u.Ci({body:l,details:e.message,url:o})}}throw s}}};
@@ -1 +0,0 @@
1
- export const __webpack_id__=7591;export const __webpack_ids__=[7591];export const __webpack_modules__={37591:(e,i,t)=>{t.r(i),t.d(i,{Account:()=>y,AppwriteException:()=>g,AuthenticationFactor:()=>E,AuthenticatorType:()=>x,Avatars:()=>I,Browser:()=>D,Client:()=>f,Compression:()=>_,CreditCard:()=>N,Databases:()=>b,ExecutionMethod:()=>V,Flag:()=>B,Functions:()=>q,Graphql:()=>M,Health:()=>R,ID:()=>P,ImageFormat:()=>Q,ImageGravity:()=>H,IndexType:()=>F,Locale:()=>j,MessagePriority:()=>$,Messaging:()=>U,MessagingProviderType:()=>Z,Name:()=>G,OAuthProvider:()=>C,PasswordHash:()=>W,Permission:()=>T,Query:()=>w,RelationMutate:()=>z,RelationshipType:()=>K,Role:()=>A,Runtime:()=>O,SmtpEncryption:()=>J,Storage:()=>L,Teams:()=>k,Users:()=>S}),globalThis.Blob;const n=globalThis.File,a=globalThis.FormData,o=(globalThis.Headers,globalThis.Request,globalThis.Response,globalThis.AbortController,globalThis.fetch||(()=>{throw new Error("[node-fetch-native] Failed to fetch: `globalThis.fetch` is not available!")}));var r=Object.defineProperty,s=(e,i)=>r(e,"name",{value:i,configurable:!0}),c=Object.defineProperty,d=s(((e,i)=>c(e,"name",{value:i,configurable:!0})),"e");function l(){return{agent:void 0,dispatcher:void 0}}function p(){return globalThis.fetch}s(l,"createAgent"),d(l,"createAgent"),s(p,"createFetch"),d(p,"createFetch"),globalThis.fetch;var u=class{constructor(e,i,t){this.method=e,this.attribute=i,void 0!==t&&(Array.isArray(t)?this.values=t:this.values=[t])}toString(){return JSON.stringify({method:this.method,attribute:this.attribute,values:this.values})}};u.equal=(e,i)=>new u("equal",e,i).toString(),u.notEqual=(e,i)=>new u("notEqual",e,i).toString(),u.lessThan=(e,i)=>new u("lessThan",e,i).toString(),u.lessThanEqual=(e,i)=>new u("lessThanEqual",e,i).toString(),u.greaterThan=(e,i)=>new u("greaterThan",e,i).toString(),u.greaterThanEqual=(e,i)=>new u("greaterThanEqual",e,i).toString(),u.isNull=e=>new u("isNull",e).toString(),u.isNotNull=e=>new u("isNotNull",e).toString(),u.between=(e,i,t)=>new u("between",e,[i,t]).toString(),u.startsWith=(e,i)=>new u("startsWith",e,i).toString(),u.endsWith=(e,i)=>new u("endsWith",e,i).toString(),u.select=e=>new u("select",void 0,e).toString(),u.search=(e,i)=>new u("search",e,i).toString(),u.orderDesc=e=>new u("orderDesc",e).toString(),u.orderAsc=e=>new u("orderAsc",e).toString(),u.cursorAfter=e=>new u("cursorAfter",void 0,e).toString(),u.cursorBefore=e=>new u("cursorBefore",void 0,e).toString(),u.limit=e=>new u("limit",void 0,e).toString(),u.offset=e=>new u("offset",void 0,e).toString(),u.contains=(e,i)=>new u("contains",e,i).toString(),u.or=e=>new u("or",void 0,e.map((e=>JSON.parse(e)))).toString(),u.and=e=>new u("and",void 0,e.map((e=>JSON.parse(e)))).toString();var w=u,h=t(39907),g=class extends Error{constructor(e,i=0,t="",n=""){super(e),this.name="AppwriteException",this.message=e,this.code=i,this.type=t,this.response=n}};function v(){let e="AppwriteNodeJSSDK/14.2.0";const i=[];return void 0!==h&&("string"==typeof h.platform&&i.push(h.platform),"string"==typeof h.arch&&i.push(h.arch)),i.length>0&&(e+=` (${i.join("; ")})`),"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?e+=` ${navigator.userAgent}`:"string"==typeof globalThis.EdgeRuntime?e+=" EdgeRuntime":void 0!==h&&"string"==typeof h.version&&(e+=` Node.js/${h.version}`),e}var m=class e{constructor(){this.config={endpoint:"https://cloud.appwrite.io/v1",selfSigned:!1,project:"",key:"",jwt:"",locale:"",session:"",forwardeduseragent:""},this.headers={"x-sdk-name":"Node.js","x-sdk-platform":"server","x-sdk-language":"nodejs","x-sdk-version":"14.2.0","user-agent":v(),"X-Appwrite-Response-Format":"1.6.0"}}setEndpoint(e){return this.config.endpoint=e,this}setSelfSigned(e){return void 0!==globalThis.EdgeRuntime&&console.warn("setSelfSigned is not supported in edge runtimes."),this.config.selfSigned=e,this}addHeader(e,i){return this.headers[e.toLowerCase()]=i,this}setProject(e){return this.headers["X-Appwrite-Project"]=e,this.config.project=e,this}setKey(e){return this.headers["X-Appwrite-Key"]=e,this.config.key=e,this}setJWT(e){return this.headers["X-Appwrite-JWT"]=e,this.config.jwt=e,this}setLocale(e){return this.headers["X-Appwrite-Locale"]=e,this.config.locale=e,this}setSession(e){return this.headers["X-Appwrite-Session"]=e,this.config.session=e,this}setForwardedUserAgent(e){return this.headers["X-Forwarded-User-Agent"]=e,this.config.forwardeduseragent=e,this}prepareRequest(i,t,o={},r={}){let s={method:i=i.toUpperCase(),headers:o=Object.assign({},this.headers,o),...(this.config.endpoint,this.config.selfSigned,{agent:void 0,dispatcher:void 0})};if("GET"===i)for(const[i,n]of Object.entries(e.flatten(r)))t.searchParams.append(i,n);else switch(o["content-type"]){case"application/json":s.body=JSON.stringify(r);break;case"multipart/form-data":const e=new a;for(const[i,t]of Object.entries(r))if(t instanceof n)e.append(i,t,t.name);else if(Array.isArray(t))for(const n of t)e.append(`${i}[]`,n);else e.append(i,t);s.body=e,delete o["content-type"]}return{uri:t.toString(),options:s}}async chunkedUpload(i,t,a={},o={},r){const s=Object.values(o).find((e=>e instanceof n));if(s.size<=e.CHUNK_SIZE)return await this.call(i,t,a,o);let c=0,d=null;for(;c<s.size;){let l=c+e.CHUNK_SIZE;l>=s.size&&(l=s.size),a["content-range"]=`bytes ${c}-${l-1}/${s.size}`;const p=s.slice(c,l);let u={...o,file:new n([p],s.name)};d=await this.call(i,t,a,u),r&&"function"==typeof r&&r({$id:d.$id,progress:Math.round(l/s.size*100),sizeUploaded:l,chunksTotal:Math.ceil(s.size/e.CHUNK_SIZE),chunksUploaded:Math.ceil(l/e.CHUNK_SIZE)}),d&&d.$id&&(a["x-appwrite-id"]=d.$id),c=l}return d}async ping(){return this.call("GET",new URL(this.config.endpoint+"/ping"))}async redirect(e,i,t={},n={}){const{uri:a,options:r}=this.prepareRequest(e,i,t,n),s=await o(a,{...r,redirect:"manual"});if(301!==s.status&&302!==s.status)throw new g("Invalid redirect",s.status);return s.headers.get("location")||""}async call(e,i,t={},n={},a="json"){var r;const{uri:s,options:c}=this.prepareRequest(e,i,t,n);let d=null;const l=await o(s,c),p=l.headers.get("x-appwrite-warning");if(p&&p.split(";").forEach((e=>console.warn("Warning: "+e))),d=(null==(r=l.headers.get("content-type"))?void 0:r.includes("application/json"))?await l.json():"arrayBuffer"===a?await l.arrayBuffer():{message:await l.text()},400<=l.status)throw new g(null==d?void 0:d.message,l.status,null==d?void 0:d.type,d);return d}static flatten(i,t=""){let n={};for(const[a,o]of Object.entries(i)){let i=t?t+"["+a+"]":a;Array.isArray(o)?n={...n,...e.flatten(o,i)}:n[i]=o}return n}};m.CHUNK_SIZE=5242880;var f=m,y=class{constructor(e){this.client=e}async get(){const e=new URL(this.client.config.endpoint+"/account");return await this.client.call("get",e,{"content-type":"application/json"},{})}async create(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "email"');if(void 0===t)throw new g('Missing required parameter: "password"');const a={};void 0!==e&&(a.userId=e),void 0!==i&&(a.email=i),void 0!==t&&(a.password=t),void 0!==n&&(a.name=n);const o=new URL(this.client.config.endpoint+"/account");return await this.client.call("post",o,{"content-type":"application/json"},a)}async updateEmail(e,i){if(void 0===e)throw new g('Missing required parameter: "email"');if(void 0===i)throw new g('Missing required parameter: "password"');const t={};void 0!==e&&(t.email=e),void 0!==i&&(t.password=i);const n=new URL(this.client.config.endpoint+"/account/email");return await this.client.call("patch",n,{"content-type":"application/json"},t)}async listIdentities(e){const i={};void 0!==e&&(i.queries=e);const t=new URL(this.client.config.endpoint+"/account/identities");return await this.client.call("get",t,{"content-type":"application/json"},i)}async deleteIdentity(e){if(void 0===e)throw new g('Missing required parameter: "identityId"');const i="/account/identities/{identityId}".replace("{identityId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async createJWT(){const e=new URL(this.client.config.endpoint+"/account/jwts");return await this.client.call("post",e,{"content-type":"application/json"},{})}async listLogs(e){const i={};void 0!==e&&(i.queries=e);const t=new URL(this.client.config.endpoint+"/account/logs");return await this.client.call("get",t,{"content-type":"application/json"},i)}async updateMFA(e){if(void 0===e)throw new g('Missing required parameter: "mfa"');const i={};void 0!==e&&(i.mfa=e);const t=new URL(this.client.config.endpoint+"/account/mfa");return await this.client.call("patch",t,{"content-type":"application/json"},i)}async createMfaAuthenticator(e){if(void 0===e)throw new g('Missing required parameter: "type"');const i="/account/mfa/authenticators/{type}".replace("{type}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("post",t,{"content-type":"application/json"},{})}async updateMfaAuthenticator(e,i){if(void 0===e)throw new g('Missing required parameter: "type"');if(void 0===i)throw new g('Missing required parameter: "otp"');const t="/account/mfa/authenticators/{type}".replace("{type}",e),n={};void 0!==i&&(n.otp=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("put",a,{"content-type":"application/json"},n)}async deleteMfaAuthenticator(e){if(void 0===e)throw new g('Missing required parameter: "type"');const i="/account/mfa/authenticators/{type}".replace("{type}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async createMfaChallenge(e){if(void 0===e)throw new g('Missing required parameter: "factor"');const i={};void 0!==e&&(i.factor=e);const t=new URL(this.client.config.endpoint+"/account/mfa/challenge");return await this.client.call("post",t,{"content-type":"application/json"},i)}async updateMfaChallenge(e,i){if(void 0===e)throw new g('Missing required parameter: "challengeId"');if(void 0===i)throw new g('Missing required parameter: "otp"');const t={};void 0!==e&&(t.challengeId=e),void 0!==i&&(t.otp=i);const n=new URL(this.client.config.endpoint+"/account/mfa/challenge");return await this.client.call("put",n,{"content-type":"application/json"},t)}async listMfaFactors(){const e=new URL(this.client.config.endpoint+"/account/mfa/factors");return await this.client.call("get",e,{"content-type":"application/json"},{})}async getMfaRecoveryCodes(){const e=new URL(this.client.config.endpoint+"/account/mfa/recovery-codes");return await this.client.call("get",e,{"content-type":"application/json"},{})}async createMfaRecoveryCodes(){const e=new URL(this.client.config.endpoint+"/account/mfa/recovery-codes");return await this.client.call("post",e,{"content-type":"application/json"},{})}async updateMfaRecoveryCodes(){const e=new URL(this.client.config.endpoint+"/account/mfa/recovery-codes");return await this.client.call("patch",e,{"content-type":"application/json"},{})}async updateName(e){if(void 0===e)throw new g('Missing required parameter: "name"');const i={};void 0!==e&&(i.name=e);const t=new URL(this.client.config.endpoint+"/account/name");return await this.client.call("patch",t,{"content-type":"application/json"},i)}async updatePassword(e,i){if(void 0===e)throw new g('Missing required parameter: "password"');const t={};void 0!==e&&(t.password=e),void 0!==i&&(t.oldPassword=i);const n=new URL(this.client.config.endpoint+"/account/password");return await this.client.call("patch",n,{"content-type":"application/json"},t)}async updatePhone(e,i){if(void 0===e)throw new g('Missing required parameter: "phone"');if(void 0===i)throw new g('Missing required parameter: "password"');const t={};void 0!==e&&(t.phone=e),void 0!==i&&(t.password=i);const n=new URL(this.client.config.endpoint+"/account/phone");return await this.client.call("patch",n,{"content-type":"application/json"},t)}async getPrefs(){const e=new URL(this.client.config.endpoint+"/account/prefs");return await this.client.call("get",e,{"content-type":"application/json"},{})}async updatePrefs(e){if(void 0===e)throw new g('Missing required parameter: "prefs"');const i={};void 0!==e&&(i.prefs=e);const t=new URL(this.client.config.endpoint+"/account/prefs");return await this.client.call("patch",t,{"content-type":"application/json"},i)}async createRecovery(e,i){if(void 0===e)throw new g('Missing required parameter: "email"');if(void 0===i)throw new g('Missing required parameter: "url"');const t={};void 0!==e&&(t.email=e),void 0!==i&&(t.url=i);const n=new URL(this.client.config.endpoint+"/account/recovery");return await this.client.call("post",n,{"content-type":"application/json"},t)}async updateRecovery(e,i,t){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "secret"');if(void 0===t)throw new g('Missing required parameter: "password"');const n={};void 0!==e&&(n.userId=e),void 0!==i&&(n.secret=i),void 0!==t&&(n.password=t);const a=new URL(this.client.config.endpoint+"/account/recovery");return await this.client.call("put",a,{"content-type":"application/json"},n)}async listSessions(){const e=new URL(this.client.config.endpoint+"/account/sessions");return await this.client.call("get",e,{"content-type":"application/json"},{})}async deleteSessions(){const e=new URL(this.client.config.endpoint+"/account/sessions");return await this.client.call("delete",e,{"content-type":"application/json"},{})}async createAnonymousSession(){const e=new URL(this.client.config.endpoint+"/account/sessions/anonymous");return await this.client.call("post",e,{"content-type":"application/json"},{})}async createEmailPasswordSession(e,i){if(void 0===e)throw new g('Missing required parameter: "email"');if(void 0===i)throw new g('Missing required parameter: "password"');const t={};void 0!==e&&(t.email=e),void 0!==i&&(t.password=i);const n=new URL(this.client.config.endpoint+"/account/sessions/email");return await this.client.call("post",n,{"content-type":"application/json"},t)}async updateMagicURLSession(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "secret"');const t={};void 0!==e&&(t.userId=e),void 0!==i&&(t.secret=i);const n=new URL(this.client.config.endpoint+"/account/sessions/magic-url");return await this.client.call("put",n,{"content-type":"application/json"},t)}async updatePhoneSession(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "secret"');const t={};void 0!==e&&(t.userId=e),void 0!==i&&(t.secret=i);const n=new URL(this.client.config.endpoint+"/account/sessions/phone");return await this.client.call("put",n,{"content-type":"application/json"},t)}async createSession(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "secret"');const t={};void 0!==e&&(t.userId=e),void 0!==i&&(t.secret=i);const n=new URL(this.client.config.endpoint+"/account/sessions/token");return await this.client.call("post",n,{"content-type":"application/json"},t)}async getSession(e){if(void 0===e)throw new g('Missing required parameter: "sessionId"');const i="/account/sessions/{sessionId}".replace("{sessionId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async updateSession(e){if(void 0===e)throw new g('Missing required parameter: "sessionId"');const i="/account/sessions/{sessionId}".replace("{sessionId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("patch",t,{"content-type":"application/json"},{})}async deleteSession(e){if(void 0===e)throw new g('Missing required parameter: "sessionId"');const i="/account/sessions/{sessionId}".replace("{sessionId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async updateStatus(){const e=new URL(this.client.config.endpoint+"/account/status");return await this.client.call("patch",e,{"content-type":"application/json"},{})}async createEmailToken(e,i,t){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "email"');const n={};void 0!==e&&(n.userId=e),void 0!==i&&(n.email=i),void 0!==t&&(n.phrase=t);const a=new URL(this.client.config.endpoint+"/account/tokens/email");return await this.client.call("post",a,{"content-type":"application/json"},n)}async createMagicURLToken(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "email"');const a={};void 0!==e&&(a.userId=e),void 0!==i&&(a.email=i),void 0!==t&&(a.url=t),void 0!==n&&(a.phrase=n);const o=new URL(this.client.config.endpoint+"/account/tokens/magic-url");return await this.client.call("post",o,{"content-type":"application/json"},a)}async createOAuth2Token(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "provider"');const a="/account/tokens/oauth2/{provider}".replace("{provider}",e),o={};void 0!==i&&(o.success=i),void 0!==t&&(o.failure=t),void 0!==n&&(o.scopes=n);const r=new URL(this.client.config.endpoint+a);return await this.client.redirect("get",r,{"content-type":"application/json"},o)}async createPhoneToken(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "phone"');const t={};void 0!==e&&(t.userId=e),void 0!==i&&(t.phone=i);const n=new URL(this.client.config.endpoint+"/account/tokens/phone");return await this.client.call("post",n,{"content-type":"application/json"},t)}async createVerification(e){if(void 0===e)throw new g('Missing required parameter: "url"');const i={};void 0!==e&&(i.url=e);const t=new URL(this.client.config.endpoint+"/account/verification");return await this.client.call("post",t,{"content-type":"application/json"},i)}async updateVerification(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "secret"');const t={};void 0!==e&&(t.userId=e),void 0!==i&&(t.secret=i);const n=new URL(this.client.config.endpoint+"/account/verification");return await this.client.call("put",n,{"content-type":"application/json"},t)}async createPhoneVerification(){const e=new URL(this.client.config.endpoint+"/account/verification/phone");return await this.client.call("post",e,{"content-type":"application/json"},{})}async updatePhoneVerification(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "secret"');const t={};void 0!==e&&(t.userId=e),void 0!==i&&(t.secret=i);const n=new URL(this.client.config.endpoint+"/account/verification/phone");return await this.client.call("put",n,{"content-type":"application/json"},t)}},I=class{constructor(e){this.client=e}async getBrowser(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "code"');const a="/avatars/browsers/{code}".replace("{code}",e),o={};void 0!==i&&(o.width=i),void 0!==t&&(o.height=t),void 0!==n&&(o.quality=n);const r=new URL(this.client.config.endpoint+a);return await this.client.call("get",r,{"content-type":"application/json"},o,"arrayBuffer")}async getCreditCard(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "code"');const a="/avatars/credit-cards/{code}".replace("{code}",e),o={};void 0!==i&&(o.width=i),void 0!==t&&(o.height=t),void 0!==n&&(o.quality=n);const r=new URL(this.client.config.endpoint+a);return await this.client.call("get",r,{"content-type":"application/json"},o,"arrayBuffer")}async getFavicon(e){if(void 0===e)throw new g('Missing required parameter: "url"');const i={};void 0!==e&&(i.url=e);const t=new URL(this.client.config.endpoint+"/avatars/favicon");return await this.client.call("get",t,{"content-type":"application/json"},i,"arrayBuffer")}async getFlag(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "code"');const a="/avatars/flags/{code}".replace("{code}",e),o={};void 0!==i&&(o.width=i),void 0!==t&&(o.height=t),void 0!==n&&(o.quality=n);const r=new URL(this.client.config.endpoint+a);return await this.client.call("get",r,{"content-type":"application/json"},o,"arrayBuffer")}async getImage(e,i,t){if(void 0===e)throw new g('Missing required parameter: "url"');const n={};void 0!==e&&(n.url=e),void 0!==i&&(n.width=i),void 0!==t&&(n.height=t);const a=new URL(this.client.config.endpoint+"/avatars/image");return await this.client.call("get",a,{"content-type":"application/json"},n,"arrayBuffer")}async getInitials(e,i,t,n){const a={};void 0!==e&&(a.name=e),void 0!==i&&(a.width=i),void 0!==t&&(a.height=t),void 0!==n&&(a.background=n);const o=new URL(this.client.config.endpoint+"/avatars/initials");return await this.client.call("get",o,{"content-type":"application/json"},a,"arrayBuffer")}async getQR(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "text"');const a={};void 0!==e&&(a.text=e),void 0!==i&&(a.size=i),void 0!==t&&(a.margin=t),void 0!==n&&(a.download=n);const o=new URL(this.client.config.endpoint+"/avatars/qr");return await this.client.call("get",o,{"content-type":"application/json"},a,"arrayBuffer")}},b=class{constructor(e){this.client=e}async list(e,i){const t={};void 0!==e&&(t.queries=e),void 0!==i&&(t.search=i);const n=new URL(this.client.config.endpoint+"/databases");return await this.client.call("get",n,{"content-type":"application/json"},t)}async create(e,i,t){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "name"');const n={};void 0!==e&&(n.databaseId=e),void 0!==i&&(n.name=i),void 0!==t&&(n.enabled=t);const a=new URL(this.client.config.endpoint+"/databases");return await this.client.call("post",a,{"content-type":"application/json"},n)}async get(e){if(void 0===e)throw new g('Missing required parameter: "databaseId"');const i="/databases/{databaseId}".replace("{databaseId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async update(e,i,t){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "name"');const n="/databases/{databaseId}".replace("{databaseId}",e),a={};void 0!==i&&(a.name=i),void 0!==t&&(a.enabled=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("put",o,{"content-type":"application/json"},a)}async delete(e){if(void 0===e)throw new g('Missing required parameter: "databaseId"');const i="/databases/{databaseId}".replace("{databaseId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async listCollections(e,i,t){if(void 0===e)throw new g('Missing required parameter: "databaseId"');const n="/databases/{databaseId}/collections".replace("{databaseId}",e),a={};void 0!==i&&(a.queries=i),void 0!==t&&(a.search=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("get",o,{"content-type":"application/json"},a)}async createCollection(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "name"');const r="/databases/{databaseId}/collections".replace("{databaseId}",e),s={};void 0!==i&&(s.collectionId=i),void 0!==t&&(s.name=t),void 0!==n&&(s.permissions=n),void 0!==a&&(s.documentSecurity=a),void 0!==o&&(s.enabled=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("post",c,{"content-type":"application/json"},s)}async getCollection(e,i){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');const t="/databases/{databaseId}/collections/{collectionId}".replace("{databaseId}",e).replace("{collectionId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("get",n,{"content-type":"application/json"},{})}async updateCollection(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "name"');const r="/databases/{databaseId}/collections/{collectionId}".replace("{databaseId}",e).replace("{collectionId}",i),s={};void 0!==t&&(s.name=t),void 0!==n&&(s.permissions=n),void 0!==a&&(s.documentSecurity=a),void 0!==o&&(s.enabled=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("put",c,{"content-type":"application/json"},s)}async deleteCollection(e,i){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');const t="/databases/{databaseId}/collections/{collectionId}".replace("{databaseId}",e).replace("{collectionId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("delete",n,{"content-type":"application/json"},{})}async listAttributes(e,i,t){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');const n="/databases/{databaseId}/collections/{collectionId}/attributes".replace("{databaseId}",e).replace("{collectionId}",i),a={};void 0!==t&&(a.queries=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("get",o,{"content-type":"application/json"},a)}async createBooleanAttribute(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');const r="/databases/{databaseId}/collections/{collectionId}/attributes/boolean".replace("{databaseId}",e).replace("{collectionId}",i),s={};void 0!==t&&(s.key=t),void 0!==n&&(s.required=n),void 0!==a&&(s.default=a),void 0!==o&&(s.array=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("post",c,{"content-type":"application/json"},s)}async updateBooleanAttribute(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');if(void 0===a)throw new g('Missing required parameter: "xdefault"');const r="/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),s={};void 0!==n&&(s.required=n),void 0!==a&&(s.default=a),void 0!==o&&(s.newKey=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("patch",c,{"content-type":"application/json"},s)}async createDatetimeAttribute(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');const r="/databases/{databaseId}/collections/{collectionId}/attributes/datetime".replace("{databaseId}",e).replace("{collectionId}",i),s={};void 0!==t&&(s.key=t),void 0!==n&&(s.required=n),void 0!==a&&(s.default=a),void 0!==o&&(s.array=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("post",c,{"content-type":"application/json"},s)}async updateDatetimeAttribute(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');if(void 0===a)throw new g('Missing required parameter: "xdefault"');const r="/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),s={};void 0!==n&&(s.required=n),void 0!==a&&(s.default=a),void 0!==o&&(s.newKey=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("patch",c,{"content-type":"application/json"},s)}async createEmailAttribute(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');const r="/databases/{databaseId}/collections/{collectionId}/attributes/email".replace("{databaseId}",e).replace("{collectionId}",i),s={};void 0!==t&&(s.key=t),void 0!==n&&(s.required=n),void 0!==a&&(s.default=a),void 0!==o&&(s.array=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("post",c,{"content-type":"application/json"},s)}async updateEmailAttribute(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');if(void 0===a)throw new g('Missing required parameter: "xdefault"');const r="/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),s={};void 0!==n&&(s.required=n),void 0!==a&&(s.default=a),void 0!==o&&(s.newKey=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("patch",c,{"content-type":"application/json"},s)}async createEnumAttribute(e,i,t,n,a,o,r){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "elements"');if(void 0===a)throw new g('Missing required parameter: "required"');const s="/databases/{databaseId}/collections/{collectionId}/attributes/enum".replace("{databaseId}",e).replace("{collectionId}",i),c={};void 0!==t&&(c.key=t),void 0!==n&&(c.elements=n),void 0!==a&&(c.required=a),void 0!==o&&(c.default=o),void 0!==r&&(c.array=r);const d=new URL(this.client.config.endpoint+s);return await this.client.call("post",d,{"content-type":"application/json"},c)}async updateEnumAttribute(e,i,t,n,a,o,r){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "elements"');if(void 0===a)throw new g('Missing required parameter: "required"');if(void 0===o)throw new g('Missing required parameter: "xdefault"');const s="/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),c={};void 0!==n&&(c.elements=n),void 0!==a&&(c.required=a),void 0!==o&&(c.default=o),void 0!==r&&(c.newKey=r);const d=new URL(this.client.config.endpoint+s);return await this.client.call("patch",d,{"content-type":"application/json"},c)}async createFloatAttribute(e,i,t,n,a,o,r,s){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');const c="/databases/{databaseId}/collections/{collectionId}/attributes/float".replace("{databaseId}",e).replace("{collectionId}",i),d={};void 0!==t&&(d.key=t),void 0!==n&&(d.required=n),void 0!==a&&(d.min=a),void 0!==o&&(d.max=o),void 0!==r&&(d.default=r),void 0!==s&&(d.array=s);const l=new URL(this.client.config.endpoint+c);return await this.client.call("post",l,{"content-type":"application/json"},d)}async updateFloatAttribute(e,i,t,n,a,o,r,s){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');if(void 0===a)throw new g('Missing required parameter: "min"');if(void 0===o)throw new g('Missing required parameter: "max"');if(void 0===r)throw new g('Missing required parameter: "xdefault"');const c="/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),d={};void 0!==n&&(d.required=n),void 0!==a&&(d.min=a),void 0!==o&&(d.max=o),void 0!==r&&(d.default=r),void 0!==s&&(d.newKey=s);const l=new URL(this.client.config.endpoint+c);return await this.client.call("patch",l,{"content-type":"application/json"},d)}async createIntegerAttribute(e,i,t,n,a,o,r,s){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');const c="/databases/{databaseId}/collections/{collectionId}/attributes/integer".replace("{databaseId}",e).replace("{collectionId}",i),d={};void 0!==t&&(d.key=t),void 0!==n&&(d.required=n),void 0!==a&&(d.min=a),void 0!==o&&(d.max=o),void 0!==r&&(d.default=r),void 0!==s&&(d.array=s);const l=new URL(this.client.config.endpoint+c);return await this.client.call("post",l,{"content-type":"application/json"},d)}async updateIntegerAttribute(e,i,t,n,a,o,r,s){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');if(void 0===a)throw new g('Missing required parameter: "min"');if(void 0===o)throw new g('Missing required parameter: "max"');if(void 0===r)throw new g('Missing required parameter: "xdefault"');const c="/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),d={};void 0!==n&&(d.required=n),void 0!==a&&(d.min=a),void 0!==o&&(d.max=o),void 0!==r&&(d.default=r),void 0!==s&&(d.newKey=s);const l=new URL(this.client.config.endpoint+c);return await this.client.call("patch",l,{"content-type":"application/json"},d)}async createIpAttribute(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');const r="/databases/{databaseId}/collections/{collectionId}/attributes/ip".replace("{databaseId}",e).replace("{collectionId}",i),s={};void 0!==t&&(s.key=t),void 0!==n&&(s.required=n),void 0!==a&&(s.default=a),void 0!==o&&(s.array=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("post",c,{"content-type":"application/json"},s)}async updateIpAttribute(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');if(void 0===a)throw new g('Missing required parameter: "xdefault"');const r="/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),s={};void 0!==n&&(s.required=n),void 0!==a&&(s.default=a),void 0!==o&&(s.newKey=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("patch",c,{"content-type":"application/json"},s)}async createRelationshipAttribute(e,i,t,n,a,o,r,s){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "relatedCollectionId"');if(void 0===n)throw new g('Missing required parameter: "type"');const c="/databases/{databaseId}/collections/{collectionId}/attributes/relationship".replace("{databaseId}",e).replace("{collectionId}",i),d={};void 0!==t&&(d.relatedCollectionId=t),void 0!==n&&(d.type=n),void 0!==a&&(d.twoWay=a),void 0!==o&&(d.key=o),void 0!==r&&(d.twoWayKey=r),void 0!==s&&(d.onDelete=s);const l=new URL(this.client.config.endpoint+c);return await this.client.call("post",l,{"content-type":"application/json"},d)}async createStringAttribute(e,i,t,n,a,o,r,s){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "size"');if(void 0===a)throw new g('Missing required parameter: "required"');const c="/databases/{databaseId}/collections/{collectionId}/attributes/string".replace("{databaseId}",e).replace("{collectionId}",i),d={};void 0!==t&&(d.key=t),void 0!==n&&(d.size=n),void 0!==a&&(d.required=a),void 0!==o&&(d.default=o),void 0!==r&&(d.array=r),void 0!==s&&(d.encrypt=s);const l=new URL(this.client.config.endpoint+c);return await this.client.call("post",l,{"content-type":"application/json"},d)}async updateStringAttribute(e,i,t,n,a,o,r){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');if(void 0===a)throw new g('Missing required parameter: "xdefault"');const s="/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),c={};void 0!==n&&(c.required=n),void 0!==a&&(c.default=a),void 0!==o&&(c.size=o),void 0!==r&&(c.newKey=r);const d=new URL(this.client.config.endpoint+s);return await this.client.call("patch",d,{"content-type":"application/json"},c)}async createUrlAttribute(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');const r="/databases/{databaseId}/collections/{collectionId}/attributes/url".replace("{databaseId}",e).replace("{collectionId}",i),s={};void 0!==t&&(s.key=t),void 0!==n&&(s.required=n),void 0!==a&&(s.default=a),void 0!==o&&(s.array=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("post",c,{"content-type":"application/json"},s)}async updateUrlAttribute(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "required"');if(void 0===a)throw new g('Missing required parameter: "xdefault"');const r="/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),s={};void 0!==n&&(s.required=n),void 0!==a&&(s.default=a),void 0!==o&&(s.newKey=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("patch",c,{"content-type":"application/json"},s)}async getAttribute(e,i,t){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');const n="/databases/{databaseId}/collections/{collectionId}/attributes/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),a=new URL(this.client.config.endpoint+n);return await this.client.call("get",a,{"content-type":"application/json"},{})}async deleteAttribute(e,i,t){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');const n="/databases/{databaseId}/collections/{collectionId}/attributes/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),a=new URL(this.client.config.endpoint+n);return await this.client.call("delete",a,{"content-type":"application/json"},{})}async updateRelationshipAttribute(e,i,t,n,a){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');const o="/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),r={};void 0!==n&&(r.onDelete=n),void 0!==a&&(r.newKey=a);const s=new URL(this.client.config.endpoint+o);return await this.client.call("patch",s,{"content-type":"application/json"},r)}async listDocuments(e,i,t){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');const n="/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}",e).replace("{collectionId}",i),a={};void 0!==t&&(a.queries=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("get",o,{"content-type":"application/json"},a)}async createDocument(e,i,t,n,a){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "documentId"');if(void 0===n)throw new g('Missing required parameter: "data"');const o="/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}",e).replace("{collectionId}",i),r={};void 0!==t&&(r.documentId=t),void 0!==n&&(r.data=n),void 0!==a&&(r.permissions=a);const s=new URL(this.client.config.endpoint+o);return await this.client.call("post",s,{"content-type":"application/json"},r)}async getDocument(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "documentId"');const a="/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{documentId}",t),o={};void 0!==n&&(o.queries=n);const r=new URL(this.client.config.endpoint+a);return await this.client.call("get",r,{"content-type":"application/json"},o)}async updateDocument(e,i,t,n,a){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "documentId"');const o="/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{documentId}",t),r={};void 0!==n&&(r.data=n),void 0!==a&&(r.permissions=a);const s=new URL(this.client.config.endpoint+o);return await this.client.call("patch",s,{"content-type":"application/json"},r)}async deleteDocument(e,i,t){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "documentId"');const n="/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{documentId}",t),a=new URL(this.client.config.endpoint+n);return await this.client.call("delete",a,{"content-type":"application/json"},{})}async listIndexes(e,i,t){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');const n="/databases/{databaseId}/collections/{collectionId}/indexes".replace("{databaseId}",e).replace("{collectionId}",i),a={};void 0!==t&&(a.queries=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("get",o,{"content-type":"application/json"},a)}async createIndex(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');if(void 0===n)throw new g('Missing required parameter: "type"');if(void 0===a)throw new g('Missing required parameter: "attributes"');const r="/databases/{databaseId}/collections/{collectionId}/indexes".replace("{databaseId}",e).replace("{collectionId}",i),s={};void 0!==t&&(s.key=t),void 0!==n&&(s.type=n),void 0!==a&&(s.attributes=a),void 0!==o&&(s.orders=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("post",c,{"content-type":"application/json"},s)}async getIndex(e,i,t){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');const n="/databases/{databaseId}/collections/{collectionId}/indexes/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),a=new URL(this.client.config.endpoint+n);return await this.client.call("get",a,{"content-type":"application/json"},{})}async deleteIndex(e,i,t){if(void 0===e)throw new g('Missing required parameter: "databaseId"');if(void 0===i)throw new g('Missing required parameter: "collectionId"');if(void 0===t)throw new g('Missing required parameter: "key"');const n="/databases/{databaseId}/collections/{collectionId}/indexes/{key}".replace("{databaseId}",e).replace("{collectionId}",i).replace("{key}",t),a=new URL(this.client.config.endpoint+n);return await this.client.call("delete",a,{"content-type":"application/json"},{})}},q=class{constructor(e){this.client=e}async list(e,i){const t={};void 0!==e&&(t.queries=e),void 0!==i&&(t.search=i);const n=new URL(this.client.config.endpoint+"/functions");return await this.client.call("get",n,{"content-type":"application/json"},t)}async create(e,i,t,n,a,o,r,s,c,d,l,p,u,w,h,v,m,f,y,I,b,q){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "name"');if(void 0===t)throw new g('Missing required parameter: "runtime"');const M={};void 0!==e&&(M.functionId=e),void 0!==i&&(M.name=i),void 0!==t&&(M.runtime=t),void 0!==n&&(M.execute=n),void 0!==a&&(M.events=a),void 0!==o&&(M.schedule=o),void 0!==r&&(M.timeout=r),void 0!==s&&(M.enabled=s),void 0!==c&&(M.logging=c),void 0!==d&&(M.entrypoint=d),void 0!==l&&(M.commands=l),void 0!==p&&(M.scopes=p),void 0!==u&&(M.installationId=u),void 0!==w&&(M.providerRepositoryId=w),void 0!==h&&(M.providerBranch=h),void 0!==v&&(M.providerSilentMode=v),void 0!==m&&(M.providerRootDirectory=m),void 0!==f&&(M.templateRepository=f),void 0!==y&&(M.templateOwner=y),void 0!==I&&(M.templateRootDirectory=I),void 0!==b&&(M.templateVersion=b),void 0!==q&&(M.specification=q);const R=new URL(this.client.config.endpoint+"/functions");return await this.client.call("post",R,{"content-type":"application/json"},M)}async listRuntimes(){const e=new URL(this.client.config.endpoint+"/functions/runtimes");return await this.client.call("get",e,{"content-type":"application/json"},{})}async listSpecifications(){const e=new URL(this.client.config.endpoint+"/functions/specifications");return await this.client.call("get",e,{"content-type":"application/json"},{})}async get(e){if(void 0===e)throw new g('Missing required parameter: "functionId"');const i="/functions/{functionId}".replace("{functionId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async update(e,i,t,n,a,o,r,s,c,d,l,p,u,w,h,v,m,f){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "name"');const y="/functions/{functionId}".replace("{functionId}",e),I={};void 0!==i&&(I.name=i),void 0!==t&&(I.runtime=t),void 0!==n&&(I.execute=n),void 0!==a&&(I.events=a),void 0!==o&&(I.schedule=o),void 0!==r&&(I.timeout=r),void 0!==s&&(I.enabled=s),void 0!==c&&(I.logging=c),void 0!==d&&(I.entrypoint=d),void 0!==l&&(I.commands=l),void 0!==p&&(I.scopes=p),void 0!==u&&(I.installationId=u),void 0!==w&&(I.providerRepositoryId=w),void 0!==h&&(I.providerBranch=h),void 0!==v&&(I.providerSilentMode=v),void 0!==m&&(I.providerRootDirectory=m),void 0!==f&&(I.specification=f);const b=new URL(this.client.config.endpoint+y);return await this.client.call("put",b,{"content-type":"application/json"},I)}async delete(e){if(void 0===e)throw new g('Missing required parameter: "functionId"');const i="/functions/{functionId}".replace("{functionId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async listDeployments(e,i,t){if(void 0===e)throw new g('Missing required parameter: "functionId"');const n="/functions/{functionId}/deployments".replace("{functionId}",e),a={};void 0!==i&&(a.queries=i),void 0!==t&&(a.search=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("get",o,{"content-type":"application/json"},a)}async createDeployment(e,i,t,n,a,o=e=>{}){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "code"');if(void 0===t)throw new g('Missing required parameter: "activate"');const r="/functions/{functionId}/deployments".replace("{functionId}",e),s={};void 0!==n&&(s.entrypoint=n),void 0!==a&&(s.commands=a),void 0!==i&&(s.code=i),void 0!==t&&(s.activate=t);const c=new URL(this.client.config.endpoint+r);return await this.client.chunkedUpload("post",c,{"content-type":"multipart/form-data"},s,o)}async getDeployment(e,i){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "deploymentId"');const t="/functions/{functionId}/deployments/{deploymentId}".replace("{functionId}",e).replace("{deploymentId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("get",n,{"content-type":"application/json"},{})}async updateDeployment(e,i){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "deploymentId"');const t="/functions/{functionId}/deployments/{deploymentId}".replace("{functionId}",e).replace("{deploymentId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("patch",n,{"content-type":"application/json"},{})}async deleteDeployment(e,i){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "deploymentId"');const t="/functions/{functionId}/deployments/{deploymentId}".replace("{functionId}",e).replace("{deploymentId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("delete",n,{"content-type":"application/json"},{})}async createBuild(e,i,t){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "deploymentId"');const n="/functions/{functionId}/deployments/{deploymentId}/build".replace("{functionId}",e).replace("{deploymentId}",i),a={};void 0!==t&&(a.buildId=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("post",o,{"content-type":"application/json"},a)}async updateDeploymentBuild(e,i){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "deploymentId"');const t="/functions/{functionId}/deployments/{deploymentId}/build".replace("{functionId}",e).replace("{deploymentId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("patch",n,{"content-type":"application/json"},{})}async getDeploymentDownload(e,i){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "deploymentId"');const t="/functions/{functionId}/deployments/{deploymentId}/download".replace("{functionId}",e).replace("{deploymentId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("get",n,{"content-type":"application/json"},{},"arrayBuffer")}async listExecutions(e,i,t){if(void 0===e)throw new g('Missing required parameter: "functionId"');const n="/functions/{functionId}/executions".replace("{functionId}",e),a={};void 0!==i&&(a.queries=i),void 0!==t&&(a.search=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("get",o,{"content-type":"application/json"},a)}async createExecution(e,i,t,n,a,o,r){if(void 0===e)throw new g('Missing required parameter: "functionId"');const s="/functions/{functionId}/executions".replace("{functionId}",e),c={};void 0!==i&&(c.body=i),void 0!==t&&(c.async=t),void 0!==n&&(c.path=n),void 0!==a&&(c.method=a),void 0!==o&&(c.headers=o),void 0!==r&&(c.scheduledAt=r);const d=new URL(this.client.config.endpoint+s);return await this.client.call("post",d,{"content-type":"application/json"},c)}async getExecution(e,i){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "executionId"');const t="/functions/{functionId}/executions/{executionId}".replace("{functionId}",e).replace("{executionId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("get",n,{"content-type":"application/json"},{})}async deleteExecution(e,i){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "executionId"');const t="/functions/{functionId}/executions/{executionId}".replace("{functionId}",e).replace("{executionId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("delete",n,{"content-type":"application/json"},{})}async listVariables(e){if(void 0===e)throw new g('Missing required parameter: "functionId"');const i="/functions/{functionId}/variables".replace("{functionId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async createVariable(e,i,t){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "key"');if(void 0===t)throw new g('Missing required parameter: "value"');const n="/functions/{functionId}/variables".replace("{functionId}",e),a={};void 0!==i&&(a.key=i),void 0!==t&&(a.value=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("post",o,{"content-type":"application/json"},a)}async getVariable(e,i){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "variableId"');const t="/functions/{functionId}/variables/{variableId}".replace("{functionId}",e).replace("{variableId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("get",n,{"content-type":"application/json"},{})}async updateVariable(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "variableId"');if(void 0===t)throw new g('Missing required parameter: "key"');const a="/functions/{functionId}/variables/{variableId}".replace("{functionId}",e).replace("{variableId}",i),o={};void 0!==t&&(o.key=t),void 0!==n&&(o.value=n);const r=new URL(this.client.config.endpoint+a);return await this.client.call("put",r,{"content-type":"application/json"},o)}async deleteVariable(e,i){if(void 0===e)throw new g('Missing required parameter: "functionId"');if(void 0===i)throw new g('Missing required parameter: "variableId"');const t="/functions/{functionId}/variables/{variableId}".replace("{functionId}",e).replace("{variableId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("delete",n,{"content-type":"application/json"},{})}},M=class{constructor(e){this.client=e}async query(e){if(void 0===e)throw new g('Missing required parameter: "query"');const i={};void 0!==e&&(i.query=e);const t=new URL(this.client.config.endpoint+"/graphql");return await this.client.call("post",t,{"x-sdk-graphql":"true","content-type":"application/json"},i)}async mutation(e){if(void 0===e)throw new g('Missing required parameter: "query"');const i={};void 0!==e&&(i.query=e);const t=new URL(this.client.config.endpoint+"/graphql/mutation");return await this.client.call("post",t,{"x-sdk-graphql":"true","content-type":"application/json"},i)}},R=class{constructor(e){this.client=e}async get(){const e=new URL(this.client.config.endpoint+"/health");return await this.client.call("get",e,{"content-type":"application/json"},{})}async getAntivirus(){const e=new URL(this.client.config.endpoint+"/health/anti-virus");return await this.client.call("get",e,{"content-type":"application/json"},{})}async getCache(){const e=new URL(this.client.config.endpoint+"/health/cache");return await this.client.call("get",e,{"content-type":"application/json"},{})}async getCertificate(e){const i={};void 0!==e&&(i.domain=e);const t=new URL(this.client.config.endpoint+"/health/certificate");return await this.client.call("get",t,{"content-type":"application/json"},i)}async getDB(){const e=new URL(this.client.config.endpoint+"/health/db");return await this.client.call("get",e,{"content-type":"application/json"},{})}async getPubSub(){const e=new URL(this.client.config.endpoint+"/health/pubsub");return await this.client.call("get",e,{"content-type":"application/json"},{})}async getQueue(){const e=new URL(this.client.config.endpoint+"/health/queue");return await this.client.call("get",e,{"content-type":"application/json"},{})}async getQueueBuilds(e){const i={};void 0!==e&&(i.threshold=e);const t=new URL(this.client.config.endpoint+"/health/queue/builds");return await this.client.call("get",t,{"content-type":"application/json"},i)}async getQueueCertificates(e){const i={};void 0!==e&&(i.threshold=e);const t=new URL(this.client.config.endpoint+"/health/queue/certificates");return await this.client.call("get",t,{"content-type":"application/json"},i)}async getQueueDatabases(e,i){const t={};void 0!==e&&(t.name=e),void 0!==i&&(t.threshold=i);const n=new URL(this.client.config.endpoint+"/health/queue/databases");return await this.client.call("get",n,{"content-type":"application/json"},t)}async getQueueDeletes(e){const i={};void 0!==e&&(i.threshold=e);const t=new URL(this.client.config.endpoint+"/health/queue/deletes");return await this.client.call("get",t,{"content-type":"application/json"},i)}async getFailedJobs(e,i){if(void 0===e)throw new g('Missing required parameter: "name"');const t="/health/queue/failed/{name}".replace("{name}",e),n={};void 0!==i&&(n.threshold=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("get",a,{"content-type":"application/json"},n)}async getQueueFunctions(e){const i={};void 0!==e&&(i.threshold=e);const t=new URL(this.client.config.endpoint+"/health/queue/functions");return await this.client.call("get",t,{"content-type":"application/json"},i)}async getQueueLogs(e){const i={};void 0!==e&&(i.threshold=e);const t=new URL(this.client.config.endpoint+"/health/queue/logs");return await this.client.call("get",t,{"content-type":"application/json"},i)}async getQueueMails(e){const i={};void 0!==e&&(i.threshold=e);const t=new URL(this.client.config.endpoint+"/health/queue/mails");return await this.client.call("get",t,{"content-type":"application/json"},i)}async getQueueMessaging(e){const i={};void 0!==e&&(i.threshold=e);const t=new URL(this.client.config.endpoint+"/health/queue/messaging");return await this.client.call("get",t,{"content-type":"application/json"},i)}async getQueueMigrations(e){const i={};void 0!==e&&(i.threshold=e);const t=new URL(this.client.config.endpoint+"/health/queue/migrations");return await this.client.call("get",t,{"content-type":"application/json"},i)}async getQueueUsage(e){const i={};void 0!==e&&(i.threshold=e);const t=new URL(this.client.config.endpoint+"/health/queue/usage");return await this.client.call("get",t,{"content-type":"application/json"},i)}async getQueueUsageDump(e){const i={};void 0!==e&&(i.threshold=e);const t=new URL(this.client.config.endpoint+"/health/queue/usage-dump");return await this.client.call("get",t,{"content-type":"application/json"},i)}async getQueueWebhooks(e){const i={};void 0!==e&&(i.threshold=e);const t=new URL(this.client.config.endpoint+"/health/queue/webhooks");return await this.client.call("get",t,{"content-type":"application/json"},i)}async getStorage(){const e=new URL(this.client.config.endpoint+"/health/storage");return await this.client.call("get",e,{"content-type":"application/json"},{})}async getStorageLocal(){const e=new URL(this.client.config.endpoint+"/health/storage/local");return await this.client.call("get",e,{"content-type":"application/json"},{})}async getTime(){const e=new URL(this.client.config.endpoint+"/health/time");return await this.client.call("get",e,{"content-type":"application/json"},{})}},j=class{constructor(e){this.client=e}async get(){const e=new URL(this.client.config.endpoint+"/locale");return await this.client.call("get",e,{"content-type":"application/json"},{})}async listCodes(){const e=new URL(this.client.config.endpoint+"/locale/codes");return await this.client.call("get",e,{"content-type":"application/json"},{})}async listContinents(){const e=new URL(this.client.config.endpoint+"/locale/continents");return await this.client.call("get",e,{"content-type":"application/json"},{})}async listCountries(){const e=new URL(this.client.config.endpoint+"/locale/countries");return await this.client.call("get",e,{"content-type":"application/json"},{})}async listCountriesEU(){const e=new URL(this.client.config.endpoint+"/locale/countries/eu");return await this.client.call("get",e,{"content-type":"application/json"},{})}async listCountriesPhones(){const e=new URL(this.client.config.endpoint+"/locale/countries/phones");return await this.client.call("get",e,{"content-type":"application/json"},{})}async listCurrencies(){const e=new URL(this.client.config.endpoint+"/locale/currencies");return await this.client.call("get",e,{"content-type":"application/json"},{})}async listLanguages(){const e=new URL(this.client.config.endpoint+"/locale/languages");return await this.client.call("get",e,{"content-type":"application/json"},{})}},U=class{constructor(e){this.client=e}async listMessages(e,i){const t={};void 0!==e&&(t.queries=e),void 0!==i&&(t.search=i);const n=new URL(this.client.config.endpoint+"/messaging/messages");return await this.client.call("get",n,{"content-type":"application/json"},t)}async createEmail(e,i,t,n,a,o,r,s,c,d,l,p){if(void 0===e)throw new g('Missing required parameter: "messageId"');if(void 0===i)throw new g('Missing required parameter: "subject"');if(void 0===t)throw new g('Missing required parameter: "content"');const u={};void 0!==e&&(u.messageId=e),void 0!==i&&(u.subject=i),void 0!==t&&(u.content=t),void 0!==n&&(u.topics=n),void 0!==a&&(u.users=a),void 0!==o&&(u.targets=o),void 0!==r&&(u.cc=r),void 0!==s&&(u.bcc=s),void 0!==c&&(u.attachments=c),void 0!==d&&(u.draft=d),void 0!==l&&(u.html=l),void 0!==p&&(u.scheduledAt=p);const w=new URL(this.client.config.endpoint+"/messaging/messages/email");return await this.client.call("post",w,{"content-type":"application/json"},u)}async updateEmail(e,i,t,n,a,o,r,s,c,d,l,p){if(void 0===e)throw new g('Missing required parameter: "messageId"');const u="/messaging/messages/email/{messageId}".replace("{messageId}",e),w={};void 0!==i&&(w.topics=i),void 0!==t&&(w.users=t),void 0!==n&&(w.targets=n),void 0!==a&&(w.subject=a),void 0!==o&&(w.content=o),void 0!==r&&(w.draft=r),void 0!==s&&(w.html=s),void 0!==c&&(w.cc=c),void 0!==d&&(w.bcc=d),void 0!==l&&(w.scheduledAt=l),void 0!==p&&(w.attachments=p);const h=new URL(this.client.config.endpoint+u);return await this.client.call("patch",h,{"content-type":"application/json"},w)}async createPush(e,i,t,n,a,o,r,s,c,d,l,p,u,w,h,v,m,f,y){if(void 0===e)throw new g('Missing required parameter: "messageId"');const I={};void 0!==e&&(I.messageId=e),void 0!==i&&(I.title=i),void 0!==t&&(I.body=t),void 0!==n&&(I.topics=n),void 0!==a&&(I.users=a),void 0!==o&&(I.targets=o),void 0!==r&&(I.data=r),void 0!==s&&(I.action=s),void 0!==c&&(I.image=c),void 0!==d&&(I.icon=d),void 0!==l&&(I.sound=l),void 0!==p&&(I.color=p),void 0!==u&&(I.tag=u),void 0!==w&&(I.badge=w),void 0!==h&&(I.draft=h),void 0!==v&&(I.scheduledAt=v),void 0!==m&&(I.contentAvailable=m),void 0!==f&&(I.critical=f),void 0!==y&&(I.priority=y);const b=new URL(this.client.config.endpoint+"/messaging/messages/push");return await this.client.call("post",b,{"content-type":"application/json"},I)}async updatePush(e,i,t,n,a,o,r,s,c,d,l,p,u,w,h,v,m,f,y){if(void 0===e)throw new g('Missing required parameter: "messageId"');const I="/messaging/messages/push/{messageId}".replace("{messageId}",e),b={};void 0!==i&&(b.topics=i),void 0!==t&&(b.users=t),void 0!==n&&(b.targets=n),void 0!==a&&(b.title=a),void 0!==o&&(b.body=o),void 0!==r&&(b.data=r),void 0!==s&&(b.action=s),void 0!==c&&(b.image=c),void 0!==d&&(b.icon=d),void 0!==l&&(b.sound=l),void 0!==p&&(b.color=p),void 0!==u&&(b.tag=u),void 0!==w&&(b.badge=w),void 0!==h&&(b.draft=h),void 0!==v&&(b.scheduledAt=v),void 0!==m&&(b.contentAvailable=m),void 0!==f&&(b.critical=f),void 0!==y&&(b.priority=y);const q=new URL(this.client.config.endpoint+I);return await this.client.call("patch",q,{"content-type":"application/json"},b)}async createSms(e,i,t,n,a,o,r){if(void 0===e)throw new g('Missing required parameter: "messageId"');if(void 0===i)throw new g('Missing required parameter: "content"');const s={};void 0!==e&&(s.messageId=e),void 0!==i&&(s.content=i),void 0!==t&&(s.topics=t),void 0!==n&&(s.users=n),void 0!==a&&(s.targets=a),void 0!==o&&(s.draft=o),void 0!==r&&(s.scheduledAt=r);const c=new URL(this.client.config.endpoint+"/messaging/messages/sms");return await this.client.call("post",c,{"content-type":"application/json"},s)}async updateSms(e,i,t,n,a,o,r){if(void 0===e)throw new g('Missing required parameter: "messageId"');const s="/messaging/messages/sms/{messageId}".replace("{messageId}",e),c={};void 0!==i&&(c.topics=i),void 0!==t&&(c.users=t),void 0!==n&&(c.targets=n),void 0!==a&&(c.content=a),void 0!==o&&(c.draft=o),void 0!==r&&(c.scheduledAt=r);const d=new URL(this.client.config.endpoint+s);return await this.client.call("patch",d,{"content-type":"application/json"},c)}async getMessage(e){if(void 0===e)throw new g('Missing required parameter: "messageId"');const i="/messaging/messages/{messageId}".replace("{messageId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async delete(e){if(void 0===e)throw new g('Missing required parameter: "messageId"');const i="/messaging/messages/{messageId}".replace("{messageId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async listMessageLogs(e,i){if(void 0===e)throw new g('Missing required parameter: "messageId"');const t="/messaging/messages/{messageId}/logs".replace("{messageId}",e),n={};void 0!==i&&(n.queries=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("get",a,{"content-type":"application/json"},n)}async listTargets(e,i){if(void 0===e)throw new g('Missing required parameter: "messageId"');const t="/messaging/messages/{messageId}/targets".replace("{messageId}",e),n={};void 0!==i&&(n.queries=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("get",a,{"content-type":"application/json"},n)}async listProviders(e,i){const t={};void 0!==e&&(t.queries=e),void 0!==i&&(t.search=i);const n=new URL(this.client.config.endpoint+"/messaging/providers");return await this.client.call("get",n,{"content-type":"application/json"},t)}async createApnsProvider(e,i,t,n,a,o,r,s){if(void 0===e)throw new g('Missing required parameter: "providerId"');if(void 0===i)throw new g('Missing required parameter: "name"');const c={};void 0!==e&&(c.providerId=e),void 0!==i&&(c.name=i),void 0!==t&&(c.authKey=t),void 0!==n&&(c.authKeyId=n),void 0!==a&&(c.teamId=a),void 0!==o&&(c.bundleId=o),void 0!==r&&(c.sandbox=r),void 0!==s&&(c.enabled=s);const d=new URL(this.client.config.endpoint+"/messaging/providers/apns");return await this.client.call("post",d,{"content-type":"application/json"},c)}async updateApnsProvider(e,i,t,n,a,o,r,s){if(void 0===e)throw new g('Missing required parameter: "providerId"');const c="/messaging/providers/apns/{providerId}".replace("{providerId}",e),d={};void 0!==i&&(d.name=i),void 0!==t&&(d.enabled=t),void 0!==n&&(d.authKey=n),void 0!==a&&(d.authKeyId=a),void 0!==o&&(d.teamId=o),void 0!==r&&(d.bundleId=r),void 0!==s&&(d.sandbox=s);const l=new URL(this.client.config.endpoint+c);return await this.client.call("patch",l,{"content-type":"application/json"},d)}async createFcmProvider(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "providerId"');if(void 0===i)throw new g('Missing required parameter: "name"');const a={};void 0!==e&&(a.providerId=e),void 0!==i&&(a.name=i),void 0!==t&&(a.serviceAccountJSON=t),void 0!==n&&(a.enabled=n);const o=new URL(this.client.config.endpoint+"/messaging/providers/fcm");return await this.client.call("post",o,{"content-type":"application/json"},a)}async updateFcmProvider(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "providerId"');const a="/messaging/providers/fcm/{providerId}".replace("{providerId}",e),o={};void 0!==i&&(o.name=i),void 0!==t&&(o.enabled=t),void 0!==n&&(o.serviceAccountJSON=n);const r=new URL(this.client.config.endpoint+a);return await this.client.call("patch",r,{"content-type":"application/json"},o)}async createMailgunProvider(e,i,t,n,a,o,r,s,c,d){if(void 0===e)throw new g('Missing required parameter: "providerId"');if(void 0===i)throw new g('Missing required parameter: "name"');const l={};void 0!==e&&(l.providerId=e),void 0!==i&&(l.name=i),void 0!==t&&(l.apiKey=t),void 0!==n&&(l.domain=n),void 0!==a&&(l.isEuRegion=a),void 0!==o&&(l.fromName=o),void 0!==r&&(l.fromEmail=r),void 0!==s&&(l.replyToName=s),void 0!==c&&(l.replyToEmail=c),void 0!==d&&(l.enabled=d);const p=new URL(this.client.config.endpoint+"/messaging/providers/mailgun");return await this.client.call("post",p,{"content-type":"application/json"},l)}async updateMailgunProvider(e,i,t,n,a,o,r,s,c,d){if(void 0===e)throw new g('Missing required parameter: "providerId"');const l="/messaging/providers/mailgun/{providerId}".replace("{providerId}",e),p={};void 0!==i&&(p.name=i),void 0!==t&&(p.apiKey=t),void 0!==n&&(p.domain=n),void 0!==a&&(p.isEuRegion=a),void 0!==o&&(p.enabled=o),void 0!==r&&(p.fromName=r),void 0!==s&&(p.fromEmail=s),void 0!==c&&(p.replyToName=c),void 0!==d&&(p.replyToEmail=d);const u=new URL(this.client.config.endpoint+l);return await this.client.call("patch",u,{"content-type":"application/json"},p)}async createMsg91Provider(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "providerId"');if(void 0===i)throw new g('Missing required parameter: "name"');const r={};void 0!==e&&(r.providerId=e),void 0!==i&&(r.name=i),void 0!==t&&(r.templateId=t),void 0!==n&&(r.senderId=n),void 0!==a&&(r.authKey=a),void 0!==o&&(r.enabled=o);const s=new URL(this.client.config.endpoint+"/messaging/providers/msg91");return await this.client.call("post",s,{"content-type":"application/json"},r)}async updateMsg91Provider(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "providerId"');const r="/messaging/providers/msg91/{providerId}".replace("{providerId}",e),s={};void 0!==i&&(s.name=i),void 0!==t&&(s.enabled=t),void 0!==n&&(s.templateId=n),void 0!==a&&(s.senderId=a),void 0!==o&&(s.authKey=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("patch",c,{"content-type":"application/json"},s)}async createSendgridProvider(e,i,t,n,a,o,r,s){if(void 0===e)throw new g('Missing required parameter: "providerId"');if(void 0===i)throw new g('Missing required parameter: "name"');const c={};void 0!==e&&(c.providerId=e),void 0!==i&&(c.name=i),void 0!==t&&(c.apiKey=t),void 0!==n&&(c.fromName=n),void 0!==a&&(c.fromEmail=a),void 0!==o&&(c.replyToName=o),void 0!==r&&(c.replyToEmail=r),void 0!==s&&(c.enabled=s);const d=new URL(this.client.config.endpoint+"/messaging/providers/sendgrid");return await this.client.call("post",d,{"content-type":"application/json"},c)}async updateSendgridProvider(e,i,t,n,a,o,r,s){if(void 0===e)throw new g('Missing required parameter: "providerId"');const c="/messaging/providers/sendgrid/{providerId}".replace("{providerId}",e),d={};void 0!==i&&(d.name=i),void 0!==t&&(d.enabled=t),void 0!==n&&(d.apiKey=n),void 0!==a&&(d.fromName=a),void 0!==o&&(d.fromEmail=o),void 0!==r&&(d.replyToName=r),void 0!==s&&(d.replyToEmail=s);const l=new URL(this.client.config.endpoint+c);return await this.client.call("patch",l,{"content-type":"application/json"},d)}async createSmtpProvider(e,i,t,n,a,o,r,s,c,d,l,p,u,w){if(void 0===e)throw new g('Missing required parameter: "providerId"');if(void 0===i)throw new g('Missing required parameter: "name"');if(void 0===t)throw new g('Missing required parameter: "host"');const h={};void 0!==e&&(h.providerId=e),void 0!==i&&(h.name=i),void 0!==t&&(h.host=t),void 0!==n&&(h.port=n),void 0!==a&&(h.username=a),void 0!==o&&(h.password=o),void 0!==r&&(h.encryption=r),void 0!==s&&(h.autoTLS=s),void 0!==c&&(h.mailer=c),void 0!==d&&(h.fromName=d),void 0!==l&&(h.fromEmail=l),void 0!==p&&(h.replyToName=p),void 0!==u&&(h.replyToEmail=u),void 0!==w&&(h.enabled=w);const v=new URL(this.client.config.endpoint+"/messaging/providers/smtp");return await this.client.call("post",v,{"content-type":"application/json"},h)}async updateSmtpProvider(e,i,t,n,a,o,r,s,c,d,l,p,u,w){if(void 0===e)throw new g('Missing required parameter: "providerId"');const h="/messaging/providers/smtp/{providerId}".replace("{providerId}",e),v={};void 0!==i&&(v.name=i),void 0!==t&&(v.host=t),void 0!==n&&(v.port=n),void 0!==a&&(v.username=a),void 0!==o&&(v.password=o),void 0!==r&&(v.encryption=r),void 0!==s&&(v.autoTLS=s),void 0!==c&&(v.mailer=c),void 0!==d&&(v.fromName=d),void 0!==l&&(v.fromEmail=l),void 0!==p&&(v.replyToName=p),void 0!==u&&(v.replyToEmail=u),void 0!==w&&(v.enabled=w);const m=new URL(this.client.config.endpoint+h);return await this.client.call("patch",m,{"content-type":"application/json"},v)}async createTelesignProvider(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "providerId"');if(void 0===i)throw new g('Missing required parameter: "name"');const r={};void 0!==e&&(r.providerId=e),void 0!==i&&(r.name=i),void 0!==t&&(r.from=t),void 0!==n&&(r.customerId=n),void 0!==a&&(r.apiKey=a),void 0!==o&&(r.enabled=o);const s=new URL(this.client.config.endpoint+"/messaging/providers/telesign");return await this.client.call("post",s,{"content-type":"application/json"},r)}async updateTelesignProvider(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "providerId"');const r="/messaging/providers/telesign/{providerId}".replace("{providerId}",e),s={};void 0!==i&&(s.name=i),void 0!==t&&(s.enabled=t),void 0!==n&&(s.customerId=n),void 0!==a&&(s.apiKey=a),void 0!==o&&(s.from=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("patch",c,{"content-type":"application/json"},s)}async createTextmagicProvider(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "providerId"');if(void 0===i)throw new g('Missing required parameter: "name"');const r={};void 0!==e&&(r.providerId=e),void 0!==i&&(r.name=i),void 0!==t&&(r.from=t),void 0!==n&&(r.username=n),void 0!==a&&(r.apiKey=a),void 0!==o&&(r.enabled=o);const s=new URL(this.client.config.endpoint+"/messaging/providers/textmagic");return await this.client.call("post",s,{"content-type":"application/json"},r)}async updateTextmagicProvider(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "providerId"');const r="/messaging/providers/textmagic/{providerId}".replace("{providerId}",e),s={};void 0!==i&&(s.name=i),void 0!==t&&(s.enabled=t),void 0!==n&&(s.username=n),void 0!==a&&(s.apiKey=a),void 0!==o&&(s.from=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("patch",c,{"content-type":"application/json"},s)}async createTwilioProvider(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "providerId"');if(void 0===i)throw new g('Missing required parameter: "name"');const r={};void 0!==e&&(r.providerId=e),void 0!==i&&(r.name=i),void 0!==t&&(r.from=t),void 0!==n&&(r.accountSid=n),void 0!==a&&(r.authToken=a),void 0!==o&&(r.enabled=o);const s=new URL(this.client.config.endpoint+"/messaging/providers/twilio");return await this.client.call("post",s,{"content-type":"application/json"},r)}async updateTwilioProvider(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "providerId"');const r="/messaging/providers/twilio/{providerId}".replace("{providerId}",e),s={};void 0!==i&&(s.name=i),void 0!==t&&(s.enabled=t),void 0!==n&&(s.accountSid=n),void 0!==a&&(s.authToken=a),void 0!==o&&(s.from=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("patch",c,{"content-type":"application/json"},s)}async createVonageProvider(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "providerId"');if(void 0===i)throw new g('Missing required parameter: "name"');const r={};void 0!==e&&(r.providerId=e),void 0!==i&&(r.name=i),void 0!==t&&(r.from=t),void 0!==n&&(r.apiKey=n),void 0!==a&&(r.apiSecret=a),void 0!==o&&(r.enabled=o);const s=new URL(this.client.config.endpoint+"/messaging/providers/vonage");return await this.client.call("post",s,{"content-type":"application/json"},r)}async updateVonageProvider(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "providerId"');const r="/messaging/providers/vonage/{providerId}".replace("{providerId}",e),s={};void 0!==i&&(s.name=i),void 0!==t&&(s.enabled=t),void 0!==n&&(s.apiKey=n),void 0!==a&&(s.apiSecret=a),void 0!==o&&(s.from=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("patch",c,{"content-type":"application/json"},s)}async getProvider(e){if(void 0===e)throw new g('Missing required parameter: "providerId"');const i="/messaging/providers/{providerId}".replace("{providerId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async deleteProvider(e){if(void 0===e)throw new g('Missing required parameter: "providerId"');const i="/messaging/providers/{providerId}".replace("{providerId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async listProviderLogs(e,i){if(void 0===e)throw new g('Missing required parameter: "providerId"');const t="/messaging/providers/{providerId}/logs".replace("{providerId}",e),n={};void 0!==i&&(n.queries=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("get",a,{"content-type":"application/json"},n)}async listSubscriberLogs(e,i){if(void 0===e)throw new g('Missing required parameter: "subscriberId"');const t="/messaging/subscribers/{subscriberId}/logs".replace("{subscriberId}",e),n={};void 0!==i&&(n.queries=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("get",a,{"content-type":"application/json"},n)}async listTopics(e,i){const t={};void 0!==e&&(t.queries=e),void 0!==i&&(t.search=i);const n=new URL(this.client.config.endpoint+"/messaging/topics");return await this.client.call("get",n,{"content-type":"application/json"},t)}async createTopic(e,i,t){if(void 0===e)throw new g('Missing required parameter: "topicId"');if(void 0===i)throw new g('Missing required parameter: "name"');const n={};void 0!==e&&(n.topicId=e),void 0!==i&&(n.name=i),void 0!==t&&(n.subscribe=t);const a=new URL(this.client.config.endpoint+"/messaging/topics");return await this.client.call("post",a,{"content-type":"application/json"},n)}async getTopic(e){if(void 0===e)throw new g('Missing required parameter: "topicId"');const i="/messaging/topics/{topicId}".replace("{topicId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async updateTopic(e,i,t){if(void 0===e)throw new g('Missing required parameter: "topicId"');const n="/messaging/topics/{topicId}".replace("{topicId}",e),a={};void 0!==i&&(a.name=i),void 0!==t&&(a.subscribe=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("patch",o,{"content-type":"application/json"},a)}async deleteTopic(e){if(void 0===e)throw new g('Missing required parameter: "topicId"');const i="/messaging/topics/{topicId}".replace("{topicId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async listTopicLogs(e,i){if(void 0===e)throw new g('Missing required parameter: "topicId"');const t="/messaging/topics/{topicId}/logs".replace("{topicId}",e),n={};void 0!==i&&(n.queries=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("get",a,{"content-type":"application/json"},n)}async listSubscribers(e,i,t){if(void 0===e)throw new g('Missing required parameter: "topicId"');const n="/messaging/topics/{topicId}/subscribers".replace("{topicId}",e),a={};void 0!==i&&(a.queries=i),void 0!==t&&(a.search=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("get",o,{"content-type":"application/json"},a)}async createSubscriber(e,i,t){if(void 0===e)throw new g('Missing required parameter: "topicId"');if(void 0===i)throw new g('Missing required parameter: "subscriberId"');if(void 0===t)throw new g('Missing required parameter: "targetId"');const n="/messaging/topics/{topicId}/subscribers".replace("{topicId}",e),a={};void 0!==i&&(a.subscriberId=i),void 0!==t&&(a.targetId=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("post",o,{"content-type":"application/json"},a)}async getSubscriber(e,i){if(void 0===e)throw new g('Missing required parameter: "topicId"');if(void 0===i)throw new g('Missing required parameter: "subscriberId"');const t="/messaging/topics/{topicId}/subscribers/{subscriberId}".replace("{topicId}",e).replace("{subscriberId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("get",n,{"content-type":"application/json"},{})}async deleteSubscriber(e,i){if(void 0===e)throw new g('Missing required parameter: "topicId"');if(void 0===i)throw new g('Missing required parameter: "subscriberId"');const t="/messaging/topics/{topicId}/subscribers/{subscriberId}".replace("{topicId}",e).replace("{subscriberId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("delete",n,{"content-type":"application/json"},{})}},L=class{constructor(e){this.client=e}async listBuckets(e,i){const t={};void 0!==e&&(t.queries=e),void 0!==i&&(t.search=i);const n=new URL(this.client.config.endpoint+"/storage/buckets");return await this.client.call("get",n,{"content-type":"application/json"},t)}async createBucket(e,i,t,n,a,o,r,s,c,d){if(void 0===e)throw new g('Missing required parameter: "bucketId"');if(void 0===i)throw new g('Missing required parameter: "name"');const l={};void 0!==e&&(l.bucketId=e),void 0!==i&&(l.name=i),void 0!==t&&(l.permissions=t),void 0!==n&&(l.fileSecurity=n),void 0!==a&&(l.enabled=a),void 0!==o&&(l.maximumFileSize=o),void 0!==r&&(l.allowedFileExtensions=r),void 0!==s&&(l.compression=s),void 0!==c&&(l.encryption=c),void 0!==d&&(l.antivirus=d);const p=new URL(this.client.config.endpoint+"/storage/buckets");return await this.client.call("post",p,{"content-type":"application/json"},l)}async getBucket(e){if(void 0===e)throw new g('Missing required parameter: "bucketId"');const i="/storage/buckets/{bucketId}".replace("{bucketId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async updateBucket(e,i,t,n,a,o,r,s,c,d){if(void 0===e)throw new g('Missing required parameter: "bucketId"');if(void 0===i)throw new g('Missing required parameter: "name"');const l="/storage/buckets/{bucketId}".replace("{bucketId}",e),p={};void 0!==i&&(p.name=i),void 0!==t&&(p.permissions=t),void 0!==n&&(p.fileSecurity=n),void 0!==a&&(p.enabled=a),void 0!==o&&(p.maximumFileSize=o),void 0!==r&&(p.allowedFileExtensions=r),void 0!==s&&(p.compression=s),void 0!==c&&(p.encryption=c),void 0!==d&&(p.antivirus=d);const u=new URL(this.client.config.endpoint+l);return await this.client.call("put",u,{"content-type":"application/json"},p)}async deleteBucket(e){if(void 0===e)throw new g('Missing required parameter: "bucketId"');const i="/storage/buckets/{bucketId}".replace("{bucketId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async listFiles(e,i,t){if(void 0===e)throw new g('Missing required parameter: "bucketId"');const n="/storage/buckets/{bucketId}/files".replace("{bucketId}",e),a={};void 0!==i&&(a.queries=i),void 0!==t&&(a.search=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("get",o,{"content-type":"application/json"},a)}async createFile(e,i,t,n,a=e=>{}){if(void 0===e)throw new g('Missing required parameter: "bucketId"');if(void 0===i)throw new g('Missing required parameter: "fileId"');if(void 0===t)throw new g('Missing required parameter: "file"');const o="/storage/buckets/{bucketId}/files".replace("{bucketId}",e),r={};void 0!==i&&(r.fileId=i),void 0!==t&&(r.file=t),void 0!==n&&(r.permissions=n);const s=new URL(this.client.config.endpoint+o);return await this.client.chunkedUpload("post",s,{"content-type":"multipart/form-data"},r,a)}async getFile(e,i){if(void 0===e)throw new g('Missing required parameter: "bucketId"');if(void 0===i)throw new g('Missing required parameter: "fileId"');const t="/storage/buckets/{bucketId}/files/{fileId}".replace("{bucketId}",e).replace("{fileId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("get",n,{"content-type":"application/json"},{})}async updateFile(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "bucketId"');if(void 0===i)throw new g('Missing required parameter: "fileId"');const a="/storage/buckets/{bucketId}/files/{fileId}".replace("{bucketId}",e).replace("{fileId}",i),o={};void 0!==t&&(o.name=t),void 0!==n&&(o.permissions=n);const r=new URL(this.client.config.endpoint+a);return await this.client.call("put",r,{"content-type":"application/json"},o)}async deleteFile(e,i){if(void 0===e)throw new g('Missing required parameter: "bucketId"');if(void 0===i)throw new g('Missing required parameter: "fileId"');const t="/storage/buckets/{bucketId}/files/{fileId}".replace("{bucketId}",e).replace("{fileId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("delete",n,{"content-type":"application/json"},{})}async getFileDownload(e,i){if(void 0===e)throw new g('Missing required parameter: "bucketId"');if(void 0===i)throw new g('Missing required parameter: "fileId"');const t="/storage/buckets/{bucketId}/files/{fileId}/download".replace("{bucketId}",e).replace("{fileId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("get",n,{"content-type":"application/json"},{},"arrayBuffer")}async getFilePreview(e,i,t,n,a,o,r,s,c,d,l,p,u){if(void 0===e)throw new g('Missing required parameter: "bucketId"');if(void 0===i)throw new g('Missing required parameter: "fileId"');const w="/storage/buckets/{bucketId}/files/{fileId}/preview".replace("{bucketId}",e).replace("{fileId}",i),h={};void 0!==t&&(h.width=t),void 0!==n&&(h.height=n),void 0!==a&&(h.gravity=a),void 0!==o&&(h.quality=o),void 0!==r&&(h.borderWidth=r),void 0!==s&&(h.borderColor=s),void 0!==c&&(h.borderRadius=c),void 0!==d&&(h.opacity=d),void 0!==l&&(h.rotation=l),void 0!==p&&(h.background=p),void 0!==u&&(h.output=u);const v=new URL(this.client.config.endpoint+w);return await this.client.call("get",v,{"content-type":"application/json"},h,"arrayBuffer")}async getFileView(e,i){if(void 0===e)throw new g('Missing required parameter: "bucketId"');if(void 0===i)throw new g('Missing required parameter: "fileId"');const t="/storage/buckets/{bucketId}/files/{fileId}/view".replace("{bucketId}",e).replace("{fileId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("get",n,{"content-type":"application/json"},{},"arrayBuffer")}},k=class{constructor(e){this.client=e}async list(e,i){const t={};void 0!==e&&(t.queries=e),void 0!==i&&(t.search=i);const n=new URL(this.client.config.endpoint+"/teams");return await this.client.call("get",n,{"content-type":"application/json"},t)}async create(e,i,t){if(void 0===e)throw new g('Missing required parameter: "teamId"');if(void 0===i)throw new g('Missing required parameter: "name"');const n={};void 0!==e&&(n.teamId=e),void 0!==i&&(n.name=i),void 0!==t&&(n.roles=t);const a=new URL(this.client.config.endpoint+"/teams");return await this.client.call("post",a,{"content-type":"application/json"},n)}async get(e){if(void 0===e)throw new g('Missing required parameter: "teamId"');const i="/teams/{teamId}".replace("{teamId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async updateName(e,i){if(void 0===e)throw new g('Missing required parameter: "teamId"');if(void 0===i)throw new g('Missing required parameter: "name"');const t="/teams/{teamId}".replace("{teamId}",e),n={};void 0!==i&&(n.name=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("put",a,{"content-type":"application/json"},n)}async delete(e){if(void 0===e)throw new g('Missing required parameter: "teamId"');const i="/teams/{teamId}".replace("{teamId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async listMemberships(e,i,t){if(void 0===e)throw new g('Missing required parameter: "teamId"');const n="/teams/{teamId}/memberships".replace("{teamId}",e),a={};void 0!==i&&(a.queries=i),void 0!==t&&(a.search=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("get",o,{"content-type":"application/json"},a)}async createMembership(e,i,t,n,a,o,r){if(void 0===e)throw new g('Missing required parameter: "teamId"');if(void 0===i)throw new g('Missing required parameter: "roles"');const s="/teams/{teamId}/memberships".replace("{teamId}",e),c={};void 0!==t&&(c.email=t),void 0!==n&&(c.userId=n),void 0!==a&&(c.phone=a),void 0!==i&&(c.roles=i),void 0!==o&&(c.url=o),void 0!==r&&(c.name=r);const d=new URL(this.client.config.endpoint+s);return await this.client.call("post",d,{"content-type":"application/json"},c)}async getMembership(e,i){if(void 0===e)throw new g('Missing required parameter: "teamId"');if(void 0===i)throw new g('Missing required parameter: "membershipId"');const t="/teams/{teamId}/memberships/{membershipId}".replace("{teamId}",e).replace("{membershipId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("get",n,{"content-type":"application/json"},{})}async updateMembership(e,i,t){if(void 0===e)throw new g('Missing required parameter: "teamId"');if(void 0===i)throw new g('Missing required parameter: "membershipId"');if(void 0===t)throw new g('Missing required parameter: "roles"');const n="/teams/{teamId}/memberships/{membershipId}".replace("{teamId}",e).replace("{membershipId}",i),a={};void 0!==t&&(a.roles=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("patch",o,{"content-type":"application/json"},a)}async deleteMembership(e,i){if(void 0===e)throw new g('Missing required parameter: "teamId"');if(void 0===i)throw new g('Missing required parameter: "membershipId"');const t="/teams/{teamId}/memberships/{membershipId}".replace("{teamId}",e).replace("{membershipId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("delete",n,{"content-type":"application/json"},{})}async updateMembershipStatus(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "teamId"');if(void 0===i)throw new g('Missing required parameter: "membershipId"');if(void 0===t)throw new g('Missing required parameter: "userId"');if(void 0===n)throw new g('Missing required parameter: "secret"');const a="/teams/{teamId}/memberships/{membershipId}/status".replace("{teamId}",e).replace("{membershipId}",i),o={};void 0!==t&&(o.userId=t),void 0!==n&&(o.secret=n);const r=new URL(this.client.config.endpoint+a);return await this.client.call("patch",r,{"content-type":"application/json"},o)}async getPrefs(e){if(void 0===e)throw new g('Missing required parameter: "teamId"');const i="/teams/{teamId}/prefs".replace("{teamId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async updatePrefs(e,i){if(void 0===e)throw new g('Missing required parameter: "teamId"');if(void 0===i)throw new g('Missing required parameter: "prefs"');const t="/teams/{teamId}/prefs".replace("{teamId}",e),n={};void 0!==i&&(n.prefs=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("put",a,{"content-type":"application/json"},n)}},S=class{constructor(e){this.client=e}async list(e,i){const t={};void 0!==e&&(t.queries=e),void 0!==i&&(t.search=i);const n=new URL(this.client.config.endpoint+"/users");return await this.client.call("get",n,{"content-type":"application/json"},t)}async create(e,i,t,n,a){if(void 0===e)throw new g('Missing required parameter: "userId"');const o={};void 0!==e&&(o.userId=e),void 0!==i&&(o.email=i),void 0!==t&&(o.phone=t),void 0!==n&&(o.password=n),void 0!==a&&(o.name=a);const r=new URL(this.client.config.endpoint+"/users");return await this.client.call("post",r,{"content-type":"application/json"},o)}async createArgon2User(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "email"');if(void 0===t)throw new g('Missing required parameter: "password"');const a={};void 0!==e&&(a.userId=e),void 0!==i&&(a.email=i),void 0!==t&&(a.password=t),void 0!==n&&(a.name=n);const o=new URL(this.client.config.endpoint+"/users/argon2");return await this.client.call("post",o,{"content-type":"application/json"},a)}async createBcryptUser(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "email"');if(void 0===t)throw new g('Missing required parameter: "password"');const a={};void 0!==e&&(a.userId=e),void 0!==i&&(a.email=i),void 0!==t&&(a.password=t),void 0!==n&&(a.name=n);const o=new URL(this.client.config.endpoint+"/users/bcrypt");return await this.client.call("post",o,{"content-type":"application/json"},a)}async listIdentities(e,i){const t={};void 0!==e&&(t.queries=e),void 0!==i&&(t.search=i);const n=new URL(this.client.config.endpoint+"/users/identities");return await this.client.call("get",n,{"content-type":"application/json"},t)}async deleteIdentity(e){if(void 0===e)throw new g('Missing required parameter: "identityId"');const i="/users/identities/{identityId}".replace("{identityId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async createMD5User(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "email"');if(void 0===t)throw new g('Missing required parameter: "password"');const a={};void 0!==e&&(a.userId=e),void 0!==i&&(a.email=i),void 0!==t&&(a.password=t),void 0!==n&&(a.name=n);const o=new URL(this.client.config.endpoint+"/users/md5");return await this.client.call("post",o,{"content-type":"application/json"},a)}async createPHPassUser(e,i,t,n){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "email"');if(void 0===t)throw new g('Missing required parameter: "password"');const a={};void 0!==e&&(a.userId=e),void 0!==i&&(a.email=i),void 0!==t&&(a.password=t),void 0!==n&&(a.name=n);const o=new URL(this.client.config.endpoint+"/users/phpass");return await this.client.call("post",o,{"content-type":"application/json"},a)}async createScryptUser(e,i,t,n,a,o,r,s,c){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "email"');if(void 0===t)throw new g('Missing required parameter: "password"');if(void 0===n)throw new g('Missing required parameter: "passwordSalt"');if(void 0===a)throw new g('Missing required parameter: "passwordCpu"');if(void 0===o)throw new g('Missing required parameter: "passwordMemory"');if(void 0===r)throw new g('Missing required parameter: "passwordParallel"');if(void 0===s)throw new g('Missing required parameter: "passwordLength"');const d={};void 0!==e&&(d.userId=e),void 0!==i&&(d.email=i),void 0!==t&&(d.password=t),void 0!==n&&(d.passwordSalt=n),void 0!==a&&(d.passwordCpu=a),void 0!==o&&(d.passwordMemory=o),void 0!==r&&(d.passwordParallel=r),void 0!==s&&(d.passwordLength=s),void 0!==c&&(d.name=c);const l=new URL(this.client.config.endpoint+"/users/scrypt");return await this.client.call("post",l,{"content-type":"application/json"},d)}async createScryptModifiedUser(e,i,t,n,a,o,r){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "email"');if(void 0===t)throw new g('Missing required parameter: "password"');if(void 0===n)throw new g('Missing required parameter: "passwordSalt"');if(void 0===a)throw new g('Missing required parameter: "passwordSaltSeparator"');if(void 0===o)throw new g('Missing required parameter: "passwordSignerKey"');const s={};void 0!==e&&(s.userId=e),void 0!==i&&(s.email=i),void 0!==t&&(s.password=t),void 0!==n&&(s.passwordSalt=n),void 0!==a&&(s.passwordSaltSeparator=a),void 0!==o&&(s.passwordSignerKey=o),void 0!==r&&(s.name=r);const c=new URL(this.client.config.endpoint+"/users/scrypt-modified");return await this.client.call("post",c,{"content-type":"application/json"},s)}async createSHAUser(e,i,t,n,a){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "email"');if(void 0===t)throw new g('Missing required parameter: "password"');const o={};void 0!==e&&(o.userId=e),void 0!==i&&(o.email=i),void 0!==t&&(o.password=t),void 0!==n&&(o.passwordVersion=n),void 0!==a&&(o.name=a);const r=new URL(this.client.config.endpoint+"/users/sha");return await this.client.call("post",r,{"content-type":"application/json"},o)}async get(e){if(void 0===e)throw new g('Missing required parameter: "userId"');const i="/users/{userId}".replace("{userId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async delete(e){if(void 0===e)throw new g('Missing required parameter: "userId"');const i="/users/{userId}".replace("{userId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async updateEmail(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "email"');const t="/users/{userId}/email".replace("{userId}",e),n={};void 0!==i&&(n.email=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("patch",a,{"content-type":"application/json"},n)}async createJWT(e,i,t){if(void 0===e)throw new g('Missing required parameter: "userId"');const n="/users/{userId}/jwts".replace("{userId}",e),a={};void 0!==i&&(a.sessionId=i),void 0!==t&&(a.duration=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("post",o,{"content-type":"application/json"},a)}async updateLabels(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "labels"');const t="/users/{userId}/labels".replace("{userId}",e),n={};void 0!==i&&(n.labels=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("put",a,{"content-type":"application/json"},n)}async listLogs(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');const t="/users/{userId}/logs".replace("{userId}",e),n={};void 0!==i&&(n.queries=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("get",a,{"content-type":"application/json"},n)}async listMemberships(e){if(void 0===e)throw new g('Missing required parameter: "userId"');const i="/users/{userId}/memberships".replace("{userId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async updateMfa(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "mfa"');const t="/users/{userId}/mfa".replace("{userId}",e),n={};void 0!==i&&(n.mfa=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("patch",a,{"content-type":"application/json"},n)}async deleteMfaAuthenticator(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "type"');const t="/users/{userId}/mfa/authenticators/{type}".replace("{userId}",e).replace("{type}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("delete",n,{"content-type":"application/json"},{})}async listMfaFactors(e){if(void 0===e)throw new g('Missing required parameter: "userId"');const i="/users/{userId}/mfa/factors".replace("{userId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async getMfaRecoveryCodes(e){if(void 0===e)throw new g('Missing required parameter: "userId"');const i="/users/{userId}/mfa/recovery-codes".replace("{userId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async updateMfaRecoveryCodes(e){if(void 0===e)throw new g('Missing required parameter: "userId"');const i="/users/{userId}/mfa/recovery-codes".replace("{userId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("put",t,{"content-type":"application/json"},{})}async createMfaRecoveryCodes(e){if(void 0===e)throw new g('Missing required parameter: "userId"');const i="/users/{userId}/mfa/recovery-codes".replace("{userId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("patch",t,{"content-type":"application/json"},{})}async updateName(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "name"');const t="/users/{userId}/name".replace("{userId}",e),n={};void 0!==i&&(n.name=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("patch",a,{"content-type":"application/json"},n)}async updatePassword(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "password"');const t="/users/{userId}/password".replace("{userId}",e),n={};void 0!==i&&(n.password=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("patch",a,{"content-type":"application/json"},n)}async updatePhone(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "number"');const t="/users/{userId}/phone".replace("{userId}",e),n={};void 0!==i&&(n.number=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("patch",a,{"content-type":"application/json"},n)}async getPrefs(e){if(void 0===e)throw new g('Missing required parameter: "userId"');const i="/users/{userId}/prefs".replace("{userId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async updatePrefs(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "prefs"');const t="/users/{userId}/prefs".replace("{userId}",e),n={};void 0!==i&&(n.prefs=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("patch",a,{"content-type":"application/json"},n)}async listSessions(e){if(void 0===e)throw new g('Missing required parameter: "userId"');const i="/users/{userId}/sessions".replace("{userId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("get",t,{"content-type":"application/json"},{})}async createSession(e){if(void 0===e)throw new g('Missing required parameter: "userId"');const i="/users/{userId}/sessions".replace("{userId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("post",t,{"content-type":"application/json"},{})}async deleteSessions(e){if(void 0===e)throw new g('Missing required parameter: "userId"');const i="/users/{userId}/sessions".replace("{userId}",e),t=new URL(this.client.config.endpoint+i);return await this.client.call("delete",t,{"content-type":"application/json"},{})}async deleteSession(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "sessionId"');const t="/users/{userId}/sessions/{sessionId}".replace("{userId}",e).replace("{sessionId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("delete",n,{"content-type":"application/json"},{})}async updateStatus(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "status"');const t="/users/{userId}/status".replace("{userId}",e),n={};void 0!==i&&(n.status=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("patch",a,{"content-type":"application/json"},n)}async listTargets(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');const t="/users/{userId}/targets".replace("{userId}",e),n={};void 0!==i&&(n.queries=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("get",a,{"content-type":"application/json"},n)}async createTarget(e,i,t,n,a,o){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "targetId"');if(void 0===t)throw new g('Missing required parameter: "providerType"');if(void 0===n)throw new g('Missing required parameter: "identifier"');const r="/users/{userId}/targets".replace("{userId}",e),s={};void 0!==i&&(s.targetId=i),void 0!==t&&(s.providerType=t),void 0!==n&&(s.identifier=n),void 0!==a&&(s.providerId=a),void 0!==o&&(s.name=o);const c=new URL(this.client.config.endpoint+r);return await this.client.call("post",c,{"content-type":"application/json"},s)}async getTarget(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "targetId"');const t="/users/{userId}/targets/{targetId}".replace("{userId}",e).replace("{targetId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("get",n,{"content-type":"application/json"},{})}async updateTarget(e,i,t,n,a){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "targetId"');const o="/users/{userId}/targets/{targetId}".replace("{userId}",e).replace("{targetId}",i),r={};void 0!==t&&(r.identifier=t),void 0!==n&&(r.providerId=n),void 0!==a&&(r.name=a);const s=new URL(this.client.config.endpoint+o);return await this.client.call("patch",s,{"content-type":"application/json"},r)}async deleteTarget(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "targetId"');const t="/users/{userId}/targets/{targetId}".replace("{userId}",e).replace("{targetId}",i),n=new URL(this.client.config.endpoint+t);return await this.client.call("delete",n,{"content-type":"application/json"},{})}async createToken(e,i,t){if(void 0===e)throw new g('Missing required parameter: "userId"');const n="/users/{userId}/tokens".replace("{userId}",e),a={};void 0!==i&&(a.length=i),void 0!==t&&(a.expire=t);const o=new URL(this.client.config.endpoint+n);return await this.client.call("post",o,{"content-type":"application/json"},a)}async updateEmailVerification(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "emailVerification"');const t="/users/{userId}/verification".replace("{userId}",e),n={};void 0!==i&&(n.emailVerification=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("patch",a,{"content-type":"application/json"},n)}async updatePhoneVerification(e,i){if(void 0===e)throw new g('Missing required parameter: "userId"');if(void 0===i)throw new g('Missing required parameter: "phoneVerification"');const t="/users/{userId}/verification/phone".replace("{userId}",e),n={};void 0!==i&&(n.phoneVerification=i);const a=new URL(this.client.config.endpoint+t);return await this.client.call("patch",a,{"content-type":"application/json"},n)}},T=class{};T.read=e=>`read("${e}")`,T.write=e=>`write("${e}")`,T.create=e=>`create("${e}")`,T.update=e=>`update("${e}")`,T.delete=e=>`delete("${e}")`;var A=class{static any(){return"any"}static user(e,i=""){return""===i?`user:${e}`:`user:${e}/${i}`}static users(e=""){return""===e?"users":`users/${e}`}static guests(){return"guests"}static team(e,i=""){return""===i?`team:${e}`:`team:${e}/${i}`}static member(e){return`member:${e}`}static label(e){return`label:${e}`}},P=class e{static#e(){const e=new Date,i=Math.floor(e.getTime()/1e3),t=e.getMilliseconds();return i.toString(16)+t.toString(16).padStart(5,"0")}static custom(e){return e}static unique(i=7){const t=e.#e();let n="";for(let e=0;e<i;e++)n+=Math.floor(16*Math.random()).toString(16);return t+n}},x=(e=>(e.Totp="totp",e))(x||{}),E=(e=>(e.Email="email",e.Phone="phone",e.Totp="totp",e.Recoverycode="recoverycode",e))(E||{}),C=(e=>(e.Amazon="amazon",e.Apple="apple",e.Auth0="auth0",e.Authentik="authentik",e.Autodesk="autodesk",e.Bitbucket="bitbucket",e.Bitly="bitly",e.Box="box",e.Dailymotion="dailymotion",e.Discord="discord",e.Disqus="disqus",e.Dropbox="dropbox",e.Etsy="etsy",e.Facebook="facebook",e.Github="github",e.Gitlab="gitlab",e.Google="google",e.Linkedin="linkedin",e.Microsoft="microsoft",e.Notion="notion",e.Oidc="oidc",e.Okta="okta",e.Paypal="paypal",e.PaypalSandbox="paypalSandbox",e.Podio="podio",e.Salesforce="salesforce",e.Slack="slack",e.Spotify="spotify",e.Stripe="stripe",e.Tradeshift="tradeshift",e.TradeshiftBox="tradeshiftBox",e.Twitch="twitch",e.Wordpress="wordpress",e.Yahoo="yahoo",e.Yammer="yammer",e.Yandex="yandex",e.Zoho="zoho",e.Zoom="zoom",e.Mock="mock",e))(C||{}),D=(e=>(e.AvantBrowser="aa",e.AndroidWebViewBeta="an",e.GoogleChrome="ch",e.GoogleChromeIOS="ci",e.GoogleChromeMobile="cm",e.Chromium="cr",e.MozillaFirefox="ff",e.Safari="sf",e.MobileSafari="mf",e.MicrosoftEdge="ps",e.MicrosoftEdgeIOS="oi",e.OperaMini="om",e.Opera="op",e.OperaNext="on",e))(D||{}),N=(e=>(e.AmericanExpress="amex",e.Argencard="argencard",e.Cabal="cabal",e.Cencosud="cencosud",e.DinersClub="diners",e.Discover="discover",e.Elo="elo",e.Hipercard="hipercard",e.JCB="jcb",e.Mastercard="mastercard",e.Naranja="naranja",e.TarjetaShopping="targeta-shopping",e.UnionChinaPay="union-china-pay",e.Visa="visa",e.MIR="mir",e.Maestro="maestro",e))(N||{}),B=(e=>(e.Afghanistan="af",e.Angola="ao",e.Albania="al",e.Andorra="ad",e.UnitedArabEmirates="ae",e.Argentina="ar",e.Armenia="am",e.AntiguaAndBarbuda="ag",e.Australia="au",e.Austria="at",e.Azerbaijan="az",e.Burundi="bi",e.Belgium="be",e.Benin="bj",e.BurkinaFaso="bf",e.Bangladesh="bd",e.Bulgaria="bg",e.Bahrain="bh",e.Bahamas="bs",e.BosniaAndHerzegovina="ba",e.Belarus="by",e.Belize="bz",e.Bolivia="bo",e.Brazil="br",e.Barbados="bb",e.BruneiDarussalam="bn",e.Bhutan="bt",e.Botswana="bw",e.CentralAfricanRepublic="cf",e.Canada="ca",e.Switzerland="ch",e.Chile="cl",e.China="cn",e.CoteDIvoire="ci",e.Cameroon="cm",e.DemocraticRepublicOfTheCongo="cd",e.RepublicOfTheCongo="cg",e.Colombia="co",e.Comoros="km",e.CapeVerde="cv",e.CostaRica="cr",e.Cuba="cu",e.Cyprus="cy",e.CzechRepublic="cz",e.Germany="de",e.Djibouti="dj",e.Dominica="dm",e.Denmark="dk",e.DominicanRepublic="do",e.Algeria="dz",e.Ecuador="ec",e.Egypt="eg",e.Eritrea="er",e.Spain="es",e.Estonia="ee",e.Ethiopia="et",e.Finland="fi",e.Fiji="fj",e.France="fr",e.MicronesiaFederatedStatesOf="fm",e.Gabon="ga",e.UnitedKingdom="gb",e.Georgia="ge",e.Ghana="gh",e.Guinea="gn",e.Gambia="gm",e.GuineaBissau="gw",e.EquatorialGuinea="gq",e.Greece="gr",e.Grenada="gd",e.Guatemala="gt",e.Guyana="gy",e.Honduras="hn",e.Croatia="hr",e.Haiti="ht",e.Hungary="hu",e.Indonesia="id",e.India="in",e.Ireland="ie",e.IranIslamicRepublicOf="ir",e.Iraq="iq",e.Iceland="is",e.Israel="il",e.Italy="it",e.Jamaica="jm",e.Jordan="jo",e.Japan="jp",e.Kazakhstan="kz",e.Kenya="ke",e.Kyrgyzstan="kg",e.Cambodia="kh",e.Kiribati="ki",e.SaintKittsAndNevis="kn",e.SouthKorea="kr",e.Kuwait="kw",e.LaoPeopleSDemocraticRepublic="la",e.Lebanon="lb",e.Liberia="lr",e.Libya="ly",e.SaintLucia="lc",e.Liechtenstein="li",e.SriLanka="lk",e.Lesotho="ls",e.Lithuania="lt",e.Luxembourg="lu",e.Latvia="lv",e.Morocco="ma",e.Monaco="mc",e.Moldova="md",e.Madagascar="mg",e.Maldives="mv",e.Mexico="mx",e.MarshallIslands="mh",e.NorthMacedonia="mk",e.Mali="ml",e.Malta="mt",e.Myanmar="mm",e.Montenegro="me",e.Mongolia="mn",e.Mozambique="mz",e.Mauritania="mr",e.Mauritius="mu",e.Malawi="mw",e.Malaysia="my",e.Namibia="na",e.Niger="ne",e.Nigeria="ng",e.Nicaragua="ni",e.Netherlands="nl",e.Norway="no",e.Nepal="np",e.Nauru="nr",e.NewZealand="nz",e.Oman="om",e.Pakistan="pk",e.Panama="pa",e.Peru="pe",e.Philippines="ph",e.Palau="pw",e.PapuaNewGuinea="pg",e.Poland="pl",e.FrenchPolynesia="pf",e.NorthKorea="kp",e.Portugal="pt",e.Paraguay="py",e.Qatar="qa",e.Romania="ro",e.Russia="ru",e.Rwanda="rw",e.SaudiArabia="sa",e.Sudan="sd",e.Senegal="sn",e.Singapore="sg",e.SolomonIslands="sb",e.SierraLeone="sl",e.ElSalvador="sv",e.SanMarino="sm",e.Somalia="so",e.Serbia="rs",e.SouthSudan="ss",e.SaoTomeAndPrincipe="st",e.Suriname="sr",e.Slovakia="sk",e.Slovenia="si",e.Sweden="se",e.Eswatini="sz",e.Seychelles="sc",e.Syria="sy",e.Chad="td",e.Togo="tg",e.Thailand="th",e.Tajikistan="tj",e.Turkmenistan="tm",e.TimorLeste="tl",e.Tonga="to",e.TrinidadAndTobago="tt",e.Tunisia="tn",e.Turkey="tr",e.Tuvalu="tv",e.Tanzania="tz",e.Uganda="ug",e.Ukraine="ua",e.Uruguay="uy",e.UnitedStates="us",e.Uzbekistan="uz",e.VaticanCity="va",e.SaintVincentAndTheGrenadines="vc",e.Venezuela="ve",e.Vietnam="vn",e.Vanuatu="vu",e.Samoa="ws",e.Yemen="ye",e.SouthAfrica="za",e.Zambia="zm",e.Zimbabwe="zw",e))(B||{}),K=(e=>(e.OneToOne="oneToOne",e.ManyToOne="manyToOne",e.ManyToMany="manyToMany",e.OneToMany="oneToMany",e))(K||{}),z=(e=>(e.Cascade="cascade",e.Restrict="restrict",e.SetNull="setNull",e))(z||{}),F=(e=>(e.Key="key",e.Fulltext="fulltext",e.Unique="unique",e))(F||{}),O=(e=>(e.Node145="node-14.5",e.Node160="node-16.0",e.Node180="node-18.0",e.Node190="node-19.0",e.Node200="node-20.0",e.Node210="node-21.0",e.Node22="node-22",e.Php80="php-8.0",e.Php81="php-8.1",e.Php82="php-8.2",e.Php83="php-8.3",e.Ruby30="ruby-3.0",e.Ruby31="ruby-3.1",e.Ruby32="ruby-3.2",e.Ruby33="ruby-3.3",e.Python38="python-3.8",e.Python39="python-3.9",e.Python310="python-3.10",e.Python311="python-3.11",e.Python312="python-3.12",e.Pythonml311="python-ml-3.11",e.Deno121="deno-1.21",e.Deno124="deno-1.24",e.Deno135="deno-1.35",e.Deno140="deno-1.40",e.Deno146="deno-1.46",e.Deno20="deno-2.0",e.Dart215="dart-2.15",e.Dart216="dart-2.16",e.Dart217="dart-2.17",e.Dart218="dart-2.18",e.Dart30="dart-3.0",e.Dart31="dart-3.1",e.Dart33="dart-3.3",e.Dart35="dart-3.5",e.Dotnet60="dotnet-6.0",e.Dotnet70="dotnet-7.0",e.Dotnet80="dotnet-8.0",e.Java80="java-8.0",e.Java110="java-11.0",e.Java170="java-17.0",e.Java180="java-18.0",e.Java210="java-21.0",e.Java22="java-22",e.Swift55="swift-5.5",e.Swift58="swift-5.8",e.Swift59="swift-5.9",e.Swift510="swift-5.10",e.Kotlin16="kotlin-1.6",e.Kotlin18="kotlin-1.8",e.Kotlin19="kotlin-1.9",e.Kotlin20="kotlin-2.0",e.Cpp17="cpp-17",e.Cpp20="cpp-20",e.Bun10="bun-1.0",e.Bun11="bun-1.1",e.Go123="go-1.23",e.Static1="static-1",e.Flutter324="flutter-3.24",e))(O||{}),V=(e=>(e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e))(V||{}),G=(e=>(e.V1database="v1-database",e.V1deletes="v1-deletes",e.V1audits="v1-audits",e.V1mails="v1-mails",e.V1functions="v1-functions",e.V1usage="v1-usage",e.V1usagedump="v1-usage-dump",e.V1webhooks="v1-webhooks",e.V1certificates="v1-certificates",e.V1builds="v1-builds",e.V1messaging="v1-messaging",e.V1migrations="v1-migrations",e))(G||{}),$=(e=>(e.Normal="normal",e.High="high",e))($||{}),J=(e=>(e.None="none",e.Ssl="ssl",e.Tls="tls",e))(J||{}),_=(e=>(e.None="none",e.Gzip="gzip",e.Zstd="zstd",e))(_||{}),H=(e=>(e.Center="center",e.Topleft="top-left",e.Top="top",e.Topright="top-right",e.Left="left",e.Right="right",e.Bottomleft="bottom-left",e.Bottom="bottom",e.Bottomright="bottom-right",e))(H||{}),Q=(e=>(e.Jpg="jpg",e.Jpeg="jpeg",e.Gif="gif",e.Png="png",e.Webp="webp",e.Avif="avif",e))(Q||{}),W=(e=>(e.Sha1="sha1",e.Sha224="sha224",e.Sha256="sha256",e.Sha384="sha384",e.Sha512224="sha512/224",e.Sha512256="sha512/256",e.Sha512="sha512",e.Sha3224="sha3-224",e.Sha3256="sha3-256",e.Sha3384="sha3-384",e.Sha3512="sha3-512",e))(W||{}),Z=(e=>(e.Email="email",e.Sms="sms",e.Push="push",e))(Z||{})}};
@@ -1 +0,0 @@
1
- export const __webpack_id__=8780;export const __webpack_ids__=[8780];export const __webpack_modules__={25278:()=>{},45423:()=>{}};