@muxcodecli/cli 1.15.17 → 1.15.18

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 (204) hide show
  1. package/dist/bip-bop-01-ga21wr3r.mp3 +0 -0
  2. package/dist/bip-bop-03-kgfd4rq4.mp3 +0 -0
  3. package/dist/chunk-0hqmdrjr.js +3 -0
  4. package/dist/chunk-0npjzye0.js +2 -0
  5. package/dist/chunk-0pe6y883.js +2 -0
  6. package/dist/chunk-0qqpjj2h.js +3 -0
  7. package/dist/chunk-0r3h8jgj.js +2 -0
  8. package/dist/chunk-11285jfy.js +3 -0
  9. package/dist/chunk-11ant2kk.js +3 -0
  10. package/dist/chunk-124qmktt.js +18 -0
  11. package/dist/chunk-138ntz3h.js +2 -0
  12. package/dist/chunk-1e73ypg5.js +3 -0
  13. package/dist/chunk-1evcc54z.js +3 -0
  14. package/dist/chunk-1mqsg5s7.js +75 -0
  15. package/dist/chunk-1pv2317e.js +7 -0
  16. package/dist/chunk-1y3ssxx6.js +2 -0
  17. package/dist/chunk-20x8vsdn.js +7 -0
  18. package/dist/chunk-21x3anp4.js +9 -0
  19. package/dist/chunk-22qpzg37.js +212 -0
  20. package/dist/chunk-2bt5mtgm.js +3 -0
  21. package/dist/chunk-2d95ene8.js +2 -0
  22. package/dist/chunk-2h2zq5cp.js +2 -0
  23. package/dist/chunk-2pc63est.js +2 -0
  24. package/dist/chunk-33gs9z8d.js +2 -0
  25. package/dist/chunk-33vwwxjk.js +2 -0
  26. package/dist/chunk-3dq7hfxc.js +9 -0
  27. package/dist/chunk-3jvft1k1.js +2 -0
  28. package/dist/chunk-4jqh4mpm.js +2 -0
  29. package/dist/chunk-4mgyaytc.js +672 -0
  30. package/dist/chunk-4va8fzq1.js +2 -0
  31. package/dist/chunk-4wkq9y2z.js +7 -0
  32. package/dist/chunk-526nbm9e.js +2 -0
  33. package/dist/chunk-5a6895cv.js +37 -0
  34. package/dist/chunk-5e9dq2av.js +2 -0
  35. package/dist/chunk-5jn2z3nf.js +3 -0
  36. package/dist/chunk-5npr1qyq.js +574 -0
  37. package/dist/chunk-5sfky0gz.js +8 -0
  38. package/dist/chunk-5t7xqdvk.js +3 -0
  39. package/dist/chunk-5tpqj6ag.js +10 -0
  40. package/dist/chunk-5v5015am.js +12 -0
  41. package/dist/chunk-5wawdxv2.js +7 -0
  42. package/dist/chunk-6btrg3ff.js +2 -0
  43. package/dist/chunk-6skbzman.js +6 -0
  44. package/dist/chunk-6sz698ew.js +11 -0
  45. package/dist/chunk-6xzrzmsr.js +2 -0
  46. package/dist/chunk-7848rf5q.js +63 -0
  47. package/dist/chunk-7ep2edcv.js +12 -0
  48. package/dist/chunk-7svw66kw.js +13 -0
  49. package/dist/chunk-7xgr8vx6.js +2 -0
  50. package/dist/chunk-7zjn6m1m.js +2 -0
  51. package/dist/chunk-8atqb297.js +12 -0
  52. package/dist/chunk-8ebkxjar.js +7 -0
  53. package/dist/chunk-8j3aw4qg.js +3 -0
  54. package/dist/chunk-8jy0dvcn.js +3 -0
  55. package/dist/chunk-8refh038.js +2 -0
  56. package/dist/chunk-93cszp8k.js +3 -0
  57. package/dist/chunk-93ze3gcb.js +2 -0
  58. package/dist/chunk-98yxzxtd.js +2 -0
  59. package/dist/chunk-9g64kggy.js +3 -0
  60. package/dist/chunk-9h1pwxb2.js +8 -0
  61. package/dist/chunk-9j4j9nrm.js +2 -0
  62. package/dist/chunk-9kzczwh0.js +3 -0
  63. package/dist/chunk-9n629gtn.js +3 -0
  64. package/dist/chunk-9y59sxde.js +2 -0
  65. package/dist/chunk-a2m5jyd8.js +2 -0
  66. package/dist/chunk-a595cp8s.js +2 -0
  67. package/dist/chunk-ak0k3m4q.js +3 -0
  68. package/dist/chunk-apksmrz9.js +3 -0
  69. package/dist/chunk-b05r09sj.js +10 -0
  70. package/dist/chunk-b47e563q.js +2 -0
  71. package/dist/chunk-b57avnse.js +2 -0
  72. package/dist/chunk-bfjq7w7k.js +2 -0
  73. package/dist/chunk-bhc70qet.js +3 -0
  74. package/dist/chunk-bvtscj68.js +2 -0
  75. package/dist/chunk-bw2cy5v0.js +8 -0
  76. package/dist/chunk-c7dvyh2x.js +2 -0
  77. package/dist/chunk-cbz8b7g5.js +3 -0
  78. package/dist/chunk-cw4vbnet.js +3 -0
  79. package/dist/chunk-czcj3j9y.js +2 -0
  80. package/dist/chunk-dg466kdp.js +2 -0
  81. package/dist/chunk-dmscgnhq.js +2 -0
  82. package/dist/chunk-dtk4m8rm.js +3 -0
  83. package/dist/chunk-dy7akyj3.js +2 -0
  84. package/dist/chunk-e2wv2sp4.js +2 -0
  85. package/dist/chunk-e8j03wnd.js +3 -0
  86. package/dist/chunk-egkp6tct.js +2 -0
  87. package/dist/chunk-emfc800a.js +2 -0
  88. package/dist/chunk-envnht72.js +4 -0
  89. package/dist/chunk-eskw1cj2.js +3 -0
  90. package/dist/chunk-ezz15tyg.js +2 -0
  91. package/dist/chunk-fkmzj0qt.js +16 -0
  92. package/dist/chunk-fqt3c3g5.js +4 -0
  93. package/dist/chunk-frbht418.js +19 -0
  94. package/dist/chunk-ftz8cqfq.js +2 -0
  95. package/dist/chunk-g4jxdrr6.js +2 -0
  96. package/dist/chunk-g52xzmrr.js +2 -0
  97. package/dist/chunk-gbtvkje9.js +4 -0
  98. package/dist/chunk-gm9msqq5.js +8 -0
  99. package/dist/chunk-gxat3dpd.js +3 -0
  100. package/dist/chunk-hfppq1w5.js +4 -0
  101. package/dist/chunk-jdg870gy.js +1683 -0
  102. package/dist/chunk-jfz77m78.js +3 -0
  103. package/dist/chunk-jg9r58pf.js +16 -0
  104. package/dist/chunk-jgzt4945.js +2 -0
  105. package/dist/chunk-jh2epywq.js +2 -0
  106. package/dist/chunk-jpj6a56k.js +2 -0
  107. package/dist/chunk-jw4sgq23.js +2 -0
  108. package/dist/chunk-jws11ngd.js +2 -0
  109. package/dist/chunk-jxhz82qt.js +2 -0
  110. package/dist/chunk-k19y2psf.js +4 -0
  111. package/dist/chunk-k6cj14zk.js +2 -0
  112. package/dist/chunk-kktm0pdc.js +3 -0
  113. package/dist/chunk-kmr27ake.js +160 -0
  114. package/dist/chunk-kyhwvbvq.js +2 -0
  115. package/dist/chunk-mgn5pejx.js +2 -0
  116. package/dist/chunk-mskyzxb3.js +3 -0
  117. package/dist/chunk-my9cfmvt.js +5 -0
  118. package/dist/chunk-n4vx7kvs.js +389 -0
  119. package/dist/chunk-nc44rvs7.js +23 -0
  120. package/dist/chunk-ng3vbpmy.js +3 -0
  121. package/dist/chunk-nmnp5g5p.js +228 -0
  122. package/dist/chunk-nn0t3xmn.js +2 -0
  123. package/dist/chunk-npr41z9a.js +19 -0
  124. package/dist/chunk-ntvr3177.js +25 -0
  125. package/dist/chunk-pkc5hkha.js +2 -0
  126. package/dist/chunk-ppg6zhae.js +3 -0
  127. package/dist/chunk-pqwm9zk1.js +6 -0
  128. package/dist/chunk-ptvjmfqx.js +2 -0
  129. package/dist/chunk-q1r48y0y.js +34 -0
  130. package/dist/chunk-q9yddd1r.js +3 -0
  131. package/dist/chunk-qavtgsrh.js +2 -0
  132. package/dist/chunk-qvh8ghjw.js +7 -0
  133. package/dist/chunk-qx6r187q.js +2 -0
  134. package/dist/chunk-r093mfa8.js +32 -0
  135. package/dist/chunk-rbaj9ktq.js +2 -0
  136. package/dist/chunk-rkf9ynkx.js +3 -0
  137. package/dist/chunk-rpp44jtx.js +3 -0
  138. package/dist/chunk-rrvwp351.js +2 -0
  139. package/dist/chunk-rs8fsgqt.js +81 -0
  140. package/dist/chunk-s4gy87ft.js +8 -0
  141. package/dist/chunk-s5qq2ch2.js +12 -0
  142. package/dist/chunk-s92578qx.js +71 -0
  143. package/dist/chunk-snsb760m.js +2 -0
  144. package/dist/chunk-sp1cvejp.js +2 -0
  145. package/dist/chunk-spb3tm25.js +4 -0
  146. package/dist/chunk-srnmswkj.js +2 -0
  147. package/dist/chunk-sxgbzwrs.js +2 -0
  148. package/dist/chunk-t2s6m9t2.js +35 -0
  149. package/dist/chunk-t98sdxty.js +2 -0
  150. package/dist/chunk-tbnxx5na.js +2 -0
  151. package/dist/chunk-tfxm3qz4.js +2 -0
  152. package/dist/chunk-treb38pz.js +3 -0
  153. package/dist/chunk-tvw8tfpr.js +6 -0
  154. package/dist/chunk-v107htgw.js +101 -0
  155. package/dist/chunk-v8at4gnt.js +2 -0
  156. package/dist/chunk-vmr3get8.js +2 -0
  157. package/dist/chunk-vqrnejgj.js +71 -0
  158. package/dist/chunk-vvwy955j.js +3 -0
  159. package/dist/chunk-w5jxffnq.js +2 -0
  160. package/dist/chunk-wcbh5jqy.js +3 -0
  161. package/dist/chunk-wfmrnep1.js +2 -0
  162. package/dist/chunk-wk11yy8h.js +3 -0
  163. package/dist/chunk-wn5f1tfj.js +2 -0
  164. package/dist/chunk-wpm2p1gq.js +3 -0
  165. package/dist/chunk-wxkyv5gj.js +2 -0
  166. package/dist/chunk-wyed730e.js +2 -0
  167. package/dist/chunk-x65zs89t.js +3 -0
  168. package/dist/chunk-x6zjq78z.js +2 -0
  169. package/dist/chunk-xedav0qx.js +3 -0
  170. package/dist/chunk-xmftb9ad.js +38 -0
  171. package/dist/chunk-xvtkw7hj.js +3 -0
  172. package/dist/chunk-xy0txg0n.js +2 -0
  173. package/dist/chunk-y7s5cpwr.js +34 -0
  174. package/dist/chunk-yg48tfvv.js +16 -0
  175. package/dist/chunk-ygpen625.js +3 -0
  176. package/dist/chunk-ymb45bt6.js +2 -0
  177. package/dist/chunk-yp2zfcvh.js +8 -0
  178. package/dist/chunk-z3mx7n44.js +3 -0
  179. package/dist/chunk-zaj612bw.js +3 -0
  180. package/dist/chunk-zb3179f9.js +3 -0
  181. package/dist/chunk-zhd8f4pc.js +759 -0
  182. package/dist/chunk-zjpnyah2.js +3 -0
  183. package/dist/cli/cmd/tui/worker.js +2 -0
  184. package/dist/highlights-eq9cgrbb.scm +604 -0
  185. package/dist/highlights-ghv9g403.scm +205 -0
  186. package/dist/highlights-hk7bwhj4.scm +284 -0
  187. package/dist/highlights-r812a2qc.scm +150 -0
  188. package/dist/highlights-x6tmsnaa.scm +115 -0
  189. package/dist/index.js +146 -5742
  190. package/dist/injections-73j83es3.scm +27 -0
  191. package/dist/muxcode-linux-x64 +0 -0
  192. package/dist/nope-03-2z8weyjw.mp3 +0 -0
  193. package/dist/photon_rs_bg-bq08arze.wasm +0 -0
  194. package/dist/staplebops-06-rz29m246.mp3 +0 -0
  195. package/dist/tree-sitter-3jzf13jk.wasm +0 -0
  196. package/dist/tree-sitter-bash-hq5s6fxb.wasm +0 -0
  197. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  198. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  199. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  200. package/dist/tree-sitter-powershell-ryb2ffqs.wasm +0 -0
  201. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  202. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  203. package/dist/yup-01-30ecpeh9.mp3 +0 -0
  204. package/package.json +2 -2
@@ -0,0 +1,23 @@
1
+ // @bun
2
+ import{Ag as Go,Bg as sl,Cg as kt,zg as gr}from"./chunk-spb3tm25.js";import{Dg as zt}from"./chunk-kktm0pdc.js";import{Eg as Sh}from"./chunk-apksmrz9.js";import{Gg as Ze,Hg as tn,Ig as Yl,Lg as $h,Mg as sn,Ng as hc,Og as qt,Pg as rn,Qg as jr}from"./chunk-npr41z9a.js";import{Rg as ce}from"./chunk-e8j03wnd.js";import{Sg as js}from"./chunk-wk11yy8h.js";import{$g as Za}from"./chunk-3dq7hfxc.js";import{ah as zl}from"./chunk-zaj612bw.js";import{Ls as Jl}from"./chunk-zjpnyah2.js";import{Ms as Zl,Ns as Tl,Os as ve}from"./chunk-0hqmdrjr.js";import{RF as L,UF as ee}from"./chunk-8j3aw4qg.js";var Ao=L((xo)=>{var wo=ce();function Eo(e){return e}var Bs=(e)=>(t)=>async(r)=>{if(!wo.HttpRequest.isInstance(r.request))return t(r);let{request:n}=r,{handlerProtocol:a=""}=e.requestHandler.metadata||{};if(a.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let o=n.hostname;if(n.port!=null)o+=`:${n.port}`;n.headers.host=o}return t(r)},qs={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},No=(e)=>({applyToStack:(t)=>{t.add(Bs(e),qs)}});xo.getHostHeaderPlugin=No;xo.hostHeaderMiddleware=Bs;xo.hostHeaderMiddlewareOptions=qs;xo.resolveHostHeaderConfig=Eo});var Io=L((Co)=>{var Hs=()=>(e,t)=>async(r)=>{try{let n=await e(r),{clientName:a,commandName:o,logger:c,dynamoDbDocumentClientOptions:d={}}=t,{overrideInputFilterSensitiveLog:p,overrideOutputFilterSensitiveLog:m}=d,E=p??t.inputFilterSensitiveLog,y=m??t.outputFilterSensitiveLog,{$metadata:b,...S}=n.output;return c?.info?.({clientName:a,commandName:o,input:E(r.input),output:y(S),metadata:b}),n}catch(n){let{clientName:a,commandName:o,logger:c,dynamoDbDocumentClientOptions:d={}}=t,{overrideInputFilterSensitiveLog:p}=d,m=p??t.inputFilterSensitiveLog;throw c?.error?.({clientName:a,commandName:o,input:m(r.input),error:n,metadata:n.$metadata}),n}},ks={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},_o=(e)=>({applyToStack:(t)=>{t.add(Hs(),ks)}});Co.getLoggerPlugin=_o;Co.loggerMiddleware=Hs;Co.loggerMiddlewareOptions=ks});var Gs=L((Po)=>{var ze={REQUEST_ID:Symbol.for("_AWS_LAMBDA_REQUEST_ID"),X_RAY_TRACE_ID:Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),TENANT_ID:Symbol.for("_AWS_LAMBDA_TENANT_ID")},bt=["true","1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??"");if(!bt)globalThis.awslambda=globalThis.awslambda||{};class Fe{static PROTECTED_KEYS=ze;isProtectedKey(e){return Object.values(ze).includes(e)}getRequestId(){return this.get(ze.REQUEST_ID)??"-"}getXRayTraceId(){return this.get(ze.X_RAY_TRACE_ID)}getTenantId(){return this.get(ze.TENANT_ID)}}class Xs extends Fe{currentContext;getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(e){return this.currentContext?.[e]}set(e,t){if(this.isProtectedKey(e))throw Error(`Cannot modify protected Lambda context field: ${String(e)}`);this.currentContext=this.currentContext||{},this.currentContext[e]=t}run(e,t){return this.currentContext=e,t()}}class Tt extends Fe{als;static async create(){let e=new Tt,t=await import("async_hooks");return e.als=new t.AsyncLocalStorage,e}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(e){return this.als.getStore()?.[e]}set(e,t){if(this.isProtectedKey(e))throw Error(`Cannot modify protected Lambda context field: ${String(e)}`);let r=this.als.getStore();if(!r)throw Error("No context available");r[e]=t}run(e,t){return this.als.run(e,t)}}Po.InvokeStore=void 0;(function(e){let t=null;async function r(n){if(!t)t=(async()=>{let o=n===!0||"AWS_LAMBDA_MAX_CONCURRENCY"in process.env?await Tt.create():new Xs;if(!bt&&globalThis.awslambda?.InvokeStore)return globalThis.awslambda.InvokeStore;else if(!bt&&globalThis.awslambda)return globalThis.awslambda.InvokeStore=o,o;else return o})();return t}e.getInstanceAsync=r,e._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE==="1"?{reset:()=>{if(t=null,globalThis.awslambda?.InvokeStore)delete globalThis.awslambda.InvokeStore;globalThis.awslambda={InvokeStore:void 0}}}:void 0})(Po.InvokeStore||(Po.InvokeStore={}));Po.InvokeStoreBase=Fe});var Fs=L((Vs)=>{Object.defineProperty(Vs,"__esModule",{value:!0});Vs.recursionDetectionMiddleware=void 0;var zo=Gs(),Uo=ce(),At="X-Amzn-Trace-Id",Lo="AWS_LAMBDA_FUNCTION_NAME",Ro="_X_AMZN_TRACE_ID",Bo=()=>(e)=>async(t)=>{let{request:r}=t;if(!Uo.HttpRequest.isInstance(r))return e(t);let n=Object.keys(r.headers??{}).find((E)=>E.toLowerCase()===At.toLowerCase())??At;if(r.headers.hasOwnProperty(n))return e(t);let a=process.env[Lo],o=process.env[Ro],p=(await zo.InvokeStore.getInstanceAsync())?.getXRayTraceId()??o,m=(E)=>typeof E==="string"&&E.length>0;if(m(a)&&m(p))r.headers[At]=p;return e({...t,request:r})};Vs.recursionDetectionMiddleware=Bo});var Xo=L((Le)=>{var Ue=Fs(),qo={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},Ho=(e)=>({applyToStack:(t)=>{t.add(Ue.recursionDetectionMiddleware(),qo)}});Le.getRecursionDetectionPlugin=Ho;Object.prototype.hasOwnProperty.call(Ue,"__proto__")&&!Object.prototype.hasOwnProperty.call(Le,"__proto__")&&Object.defineProperty(Le,"__proto__",{enumerable:!0,value:Ue.__proto__});Object.keys(Ue).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(Le,e))Le[e]=Ue[e]})});var rr=L((Yo)=>{var Se=Go(),Vo=js(),Ks=(e,t=!1)=>{if(t){for(let r of e.split("."))if(!Ks(r))return!1;return!0}if(!Se.isValidHostLabel(e))return!1;if(e.length<3||e.length>63)return!1;if(e!==e.toLowerCase())return!1;if(Se.isIpAddress(e))return!1;return!0},Ws=":",Qo="/",Fo=(e)=>{let t=e.split(Ws);if(t.length<6)return null;let[r,n,a,o,c,...d]=t;if(r!=="arn"||n===""||a===""||d.join(Ws)==="")return null;let p=d.map((m)=>m.split(Qo)).flat();return{partition:n,service:a,region:o,accountId:c,resourceId:p}},Wo=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],jo="1.1",Js={partitions:Wo,version:jo},Zs=Js,Ys="",vs=(e)=>{let{partitions:t}=Zs;for(let n of t){let{regions:a,outputs:o}=n;for(let[c,d]of Object.entries(a))if(c===e)return{...o,...d}}for(let n of t){let{regionRegex:a,outputs:o}=n;if(new RegExp(a).test(e))return{...o}}let r=t.find((n)=>n.id==="aws");if(!r)throw Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},er=(e,t="")=>{Zs=e,Ys=t},Ko=()=>{er(Js,"")},Jo=()=>Ys,tr={isVirtualHostableS3Bucket:Ks,parseArn:Fo,partition:vs};Se.customEndpointFunctions.aws=tr;var Zo=(e)=>{if(typeof e.endpointProvider!=="function")throw Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client.");let{endpoint:t}=e;if(t===void 0)e.endpoint=async()=>{return sr(e.endpointProvider({Region:typeof e.region==="function"?await e.region():e.region,UseDualStack:typeof e.useDualstackEndpoint==="function"?await e.useDualstackEndpoint():e.useDualstackEndpoint,UseFIPS:typeof e.useFipsEndpoint==="function"?await e.useFipsEndpoint():e.useFipsEndpoint,Endpoint:void 0},{logger:e.logger}))};return e},sr=(e)=>Vo.parseUrl(e.url);Yo.EndpointError=Se.EndpointError;Yo.isIpAddress=Se.isIpAddress;Yo.resolveEndpoint=Se.resolveEndpoint;Yo.awsEndpointFunctions=tr;Yo.getUserAgentPrefix=Jo;Yo.partition=vs;Yo.resolveDefaultAwsRegionalEndpointsConfig=Zo;Yo.setPartitionInfo=er;Yo.toEndpointV1=sr;Yo.useDefaultPartitionInfo=Ko});var Ct=L((Ea)=>{var ca=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],la=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],ua=["TimeoutError","RequestTimeout","RequestTimeoutException"],fa=[500,502,503,504],da=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],pa=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],ir=(e)=>e?.$retryable!==void 0,ga=(e)=>ca.includes(e.name),nr=(e)=>e.$metadata?.clockSkewCorrected,or=(e)=>{let t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);if(!(e&&e instanceof TypeError))return!1;return t.has(e.message)},ma=(e)=>e.$metadata?.httpStatusCode===429||la.includes(e.name)||e.$retryable?.throttling==!0,_t=(e,t=0)=>ir(e)||nr(e)||ua.includes(e.name)||da.includes(e?.code||"")||pa.includes(e?.code||"")||fa.includes(e.$metadata?.httpStatusCode||0)||or(e)||e.cause!==void 0&&t<=10&&_t(e.cause,t+1),wa=(e)=>{if(e.$metadata?.httpStatusCode!==void 0){let t=e.$metadata.httpStatusCode;if(500<=t&&t<=599&&!_t(e))return!0;return!1}return!1};Ea.isBrowserNetworkError=or;Ea.isClockSkewCorrectedError=nr;Ea.isClockSkewError=ga;Ea.isRetryableByTrait=ir;Ea.isServerError=wa;Ea.isThrottlingError=ma;Ea.isTransientError=_t});var It=L((za)=>{var _a=Ct();za.RETRY_MODES=void 0;(function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"})(za.RETRY_MODES||(za.RETRY_MODES={}));var We=3,Ca=za.RETRY_MODES.STANDARD;class je{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??0.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??0.5,this.scaleConstant=e?.scaleConstant??0.4,this.smooth=e?.smooth??0.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let t;this.updateMeasuredRate();let r=e;if(r?.errorType==="THROTTLING"||_a.isThrottlingError(r?.error??e)){let o=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=o,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(o),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());let a=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(a)}getCurrentTimeInSeconds(){return Date.now()/1000}async acquireTokenBucket(e){if(!this.enabled)return;if(this.refillTokenBucket(),e>this.availableTokens){let t=(e-this.availableTokens)/this.fillRate*1000;await new Promise((r)=>je.setTimeoutFn(r,t))}this.availableTokens=this.availableTokens-e}refillTokenBucket(){let e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}let t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){let r=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(r*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}var $a=100,Ot=20000,Ma=500,$t=500,Oa=5,Ia=10,ar=1,Pa="amz-sdk-invocation-id",Da="amz-sdk-request";class V{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return V.v2026?50:100}static throttlingDelay(){return V.v2026?1000:500}static cost(){return V.v2026?14:5}static throttlingCost(){return V.v2026?5:10}static modifiedCostType(){return V.v2026?"THROTTLING":"TRANSIENT"}}class hr{x=V.delay();computeNextBackoffDelay(e){let t=Math.random(),r=2,n=t*Math.min(this.x*2**e,Ot);return Math.floor(n)}setDelayBase(e){this.x=e}}class Mt{delay;count;cost;longPoll;constructor(e,t,r,n){this.delay=e,this.count=t,this.cost=r,this.longPoll=n}getRetryCount(){return this.count}getRetryDelay(){return Math.min(Ot,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}class Re{mode=za.RETRY_MODES.STANDARD;capacity=$t;retryBackoffStrategy;maxAttemptsProvider;baseDelay;constructor(e){if(typeof e==="number")this.maxAttemptsProvider=async()=>e;else if(typeof e==="function")this.maxAttemptsProvider=e;else if(e&&typeof e==="object")this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff;this.maxAttemptsProvider??=async()=>We,this.baseDelay??=V.delay(),this.retryBackoffStrategy??=new hr}async acquireInitialRetryToken(e){return new Mt(V.delay(),0,void 0,V.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,t){let r=await this.getMaxAttempts(),n=this.shouldRetry(e,t,r);if(n||e.isLongPoll?.()){let a=t.errorType;this.retryBackoffStrategy.setDelayBase(a==="THROTTLING"?V.throttlingDelay():this.baseDelay);let o=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),c=o;if(t.retryAfterHint instanceof Date)c=Math.max(o,Math.min(t.retryAfterHint.getTime()-Date.now(),o+5000));if(!n)throw Object.assign(Error("No retry token available"),{$backoff:V.v2026?c:0});else{let d=this.getCapacityCost(a);return this.capacity-=d,new Mt(c,e.getRetryCount()+1,d,e.isLongPoll?.()??!1)}}throw Error("No retry token available")}recordSuccess(e){this.capacity=Math.min($t,this.capacity+(e.getRetryCost()??ar))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(e){return console.warn(`Max attempts provider could not resolve. Using default of ${We}`),We}}shouldRetry(e,t,r){return e.getRetryCount()+1<r&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return e===V.modifiedCostType()?V.throttlingCost():V.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}async maxAttempts(){return this.maxAttemptsProvider()}}class cr{mode=za.RETRY_MODES.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){let{rateLimiter:r}=t??{};this.rateLimiter=r??new je,this.standardRetryStrategy=t?new Re({maxAttempts:typeof e==="number"?e:3,...t}):new Re(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}class lr extends Re{computeNextBackoffDelay;constructor(e,t=V.delay()){super(typeof e==="function"?e:async()=>e);if(typeof t==="number")this.computeNextBackoffDelay=()=>t;else this.computeNextBackoffDelay=t}async refreshRetryTokenForRetry(e,t){let r=await super.refreshRetryTokenForRetry(e,t);return r.getRetryDelay=()=>this.computeNextBackoffDelay(r.getRetryCount()),r}}za.AdaptiveRetryStrategy=cr;za.ConfiguredRetryStrategy=lr;za.DEFAULT_MAX_ATTEMPTS=We;za.DEFAULT_RETRY_DELAY_BASE=$a;za.DEFAULT_RETRY_MODE=Ca;za.DefaultRateLimiter=je;za.INITIAL_RETRY_TOKENS=$t;za.INVOCATION_ID_HEADER=Pa;za.MAXIMUM_RETRY_DELAY=Ot;za.NO_RETRY_INCREMENT=ar;za.REQUEST_HEADER=Da;za.RETRY_COST=Oa;za.Retry=V;za.StandardRetryStrategy=Re;za.THROTTLING_RETRY_DELAY_BASE=Ma;za.TIMEOUT_RETRY_COST=Ia});var Nr=L((lh)=>{var Ya=gr(),va=rr(),eh=ce(),re=Za(),ur=It(),mr=void 0;function th(e){if(e===void 0)return!0;return typeof e==="string"&&e.length<=50}function sh(e){let t=Ya.normalizeProvider(e.userAgentAppId??mr),{customUserAgent:r}=e;return Object.assign(e,{customUserAgent:typeof r==="string"?[[r]]:r,userAgentAppId:async()=>{let n=await t();if(!th(n)){let a=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console:e.logger;if(typeof n!=="string")a?.warn("userAgentAppId must be a string or undefined.");else if(n.length>50)a?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}var rh=/\d{12}\.ddb/;async function ih(e,t,r){if(r.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor")re.setFeature(e,"PROTOCOL_RPC_V2_CBOR","M");if(typeof t.retryStrategy==="function"){let o=await t.retryStrategy();if(typeof o.mode==="string")switch(o.mode){case ur.RETRY_MODES.ADAPTIVE:re.setFeature(e,"RETRY_MODE_ADAPTIVE","F");break;case ur.RETRY_MODES.STANDARD:re.setFeature(e,"RETRY_MODE_STANDARD","E");break}}if(typeof t.accountIdEndpointMode==="function"){let o=e.endpointV2;if(String(o?.url?.hostname).match(rh))re.setFeature(e,"ACCOUNT_ID_ENDPOINT","O");switch(await t.accountIdEndpointMode?.()){case"disabled":re.setFeature(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":re.setFeature(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":re.setFeature(e,"ACCOUNT_ID_MODE_REQUIRED","R");break}}let a=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(a?.$source){let o=a;if(o.accountId)re.setFeature(e,"RESOLVED_ACCOUNT_ID","T");for(let[c,d]of Object.entries(o.$source??{}))re.setFeature(e,c,d)}}var fr="user-agent",Pt="x-amz-user-agent",dr=" ",Dt="/",nh=/[^!$%&'*+\-.^_`|~\w]/g,oh=/[^!$%&'*+\-.^_`|~\w#]/g,pr="-",ah=1024;function hh(e){let t="";for(let r in e){let n=e[r];if(t.length+n.length+1<=ah){if(t.length)t+=","+n;else t+=n;continue}break}return t}var wr=(e)=>(t,r)=>async(n)=>{let{request:a}=n;if(!eh.HttpRequest.isInstance(a))return t(n);let{headers:o}=a,c=r?.userAgent?.map(Ke)||[],d=(await e.defaultUserAgentProvider()).map(Ke);await ih(r,e,n);let p=r;d.push(`m/${hh(Object.assign({},r.__smithy_context?.features,p.__aws_sdk_context?.features))}`);let m=e?.customUserAgent?.map(Ke)||[],E=await e.userAgentAppId();if(E)d.push(Ke(["app",`${E}`]));let y=va.getUserAgentPrefix(),b=(y?[y]:[]).concat([...d,...c,...m]).join(dr),S=[...d.filter((I)=>I.startsWith("aws-sdk-")),...m].join(dr);if(e.runtime!=="browser"){if(S)o[Pt]=o[Pt]?`${o[fr]} ${S}`:S;o[fr]=b}else o[Pt]=b;return t({...n,request:a})},Ke=(e)=>{let t=e[0].split(Dt).map((c)=>c.replace(nh,pr)).join(Dt),r=e[1]?.replace(oh,pr),n=t.indexOf(Dt),a=t.substring(0,n),o=t.substring(n+1);if(a==="api")o=o.toLowerCase();return[a,o,r].filter((c)=>c&&c.length>0).reduce((c,d,p)=>{switch(p){case 0:return d;case 1:return`${c}/${d}`;default:return`${c}#${d}`}},"")},Er={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},ch=(e)=>({applyToStack:(t)=>{t.add(wr(e),Er)}});lh.DEFAULT_UA_APP_ID=mr;lh.getUserAgentMiddlewareOptions=Er;lh.getUserAgentPlugin=ch;lh.resolveUserAgentConfig=sh;lh.userAgentMiddleware=wr});var bh=L((Eh)=>{var mh=ce(),xr="content-length";function yr(e){return(t)=>async(r)=>{let n=r.request;if(mh.HttpRequest.isInstance(n)){let{body:a,headers:o}=n;if(a&&Object.keys(o).map((c)=>c.toLowerCase()).indexOf(xr)===-1)try{let c=e(a);n.headers={...n.headers,[xr]:String(c)}}catch(c){}}return t({...r,request:n})}}var br={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},wh=(e)=>({applyToStack:(t)=>{t.add(yr(e.bodyLengthChecker),br)}});Eh.contentLengthMiddleware=yr;Eh.contentLengthMiddlewareOptions=br;Eh.getContentLengthPlugin=wh});var $r=L((_r)=>{Object.defineProperty(_r,"__esModule",{value:!0});_r.getEndpointUrlConfig=void 0;var Sr=Sh(),Tr="AWS_ENDPOINT_URL",Ar="endpoint_url",Th=(e)=>({environmentVariableSelector:(t)=>{let r=e.split(" ").map((o)=>o.toUpperCase()),n=t[[Tr,...r].join("_")];if(n)return n;let a=t[Tr];if(a)return a;return},configFileSelector:(t,r)=>{if(r&&t.services){let a=r[["services",t.services].join(Sr.CONFIG_PREFIX_SEPARATOR)];if(a){let o=e.split(" ").map((d)=>d.toLowerCase()),c=a[[o.join("_"),Ar].join(Sr.CONFIG_PREFIX_SEPARATOR)];if(c)return c}}let n=t[Ar];if(n)return n;return},default:void 0});_r.getEndpointUrlConfig=Th});var Ir=L((Mr)=>{Object.defineProperty(Mr,"__esModule",{value:!0});Mr.getEndpointFromConfig=void 0;var Ah=zt(),_h=$r(),Ch=async(e)=>(0,Ah.loadConfig)((0,_h.getEndpointUrlConfig)(e??""))();Mr.getEndpointFromConfig=Ch});var Lr=L((Ph)=>{var Mh=ce(),Oh=$h(),Pr=(e,t)=>(r,n)=>async(a)=>{let{response:o}=await r(a);try{let c=await t(o,e);return{response:o,output:c}}catch(c){if(Object.defineProperty(c,"$response",{value:o,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in c)){try{c.message+=`
3
+ Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`}catch(p){if(!n.logger||n.logger?.constructor?.name==="NoOpLogger")console.warn("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.");else n.logger?.warn?.("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.")}if(typeof c.$responseBodyText<"u"){if(c.$response)c.$response.body=c.$responseBodyText}try{if(Mh.HttpResponse.isInstance(o)){let{headers:p={}}=o,m=Object.entries(p);c.$metadata={httpStatusCode:o.statusCode,requestId:Ut(/^x-[\w-]+-request-?id$/,m),extendedRequestId:Ut(/^x-[\w-]+-id-2$/,m),cfId:Ut(/^x-[\w-]+-cf-id$/,m)}}}catch(p){}}throw c}},Ut=(e,t)=>{return(t.find(([r])=>{return r.match(e)})||[void 0,void 0])[1]},Dr=(e,t)=>(r,n)=>async(a)=>{let o=e,c=n.endpointV2?async()=>Oh.toEndpointV1(n.endpointV2):o.endpoint;if(!c)throw Error("No valid endpoint provider available.");let d=await t(a.input,{...e,endpoint:c});return r({...a,request:d})},zr={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Ur={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Ih(e,t,r){return{applyToStack:(n)=>{n.add(Pr(e,r),zr),n.add(Dr(e,t),Ur)}}}Ph.deserializerMiddleware=Pr;Ph.deserializerMiddlewareOption=zr;Ph.getSerdePlugin=Ih;Ph.serializerMiddleware=Dr;Ph.serializerMiddlewareOption=Ur});var nc=L((Jh)=>{var Bh=gr(),Je=Ze(),Br=Ir(),Rr=js(),qh=Lr(),Hh=async(e)=>{let t=e?.Bucket||"";if(typeof e.Bucket==="string")e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(Qh(t)){if(e.ForcePathStyle===!0)throw Error("Path-style addressing cannot be used with ARN buckets")}else if(!Vh(t)||t.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)e.ForcePathStyle=!0;if(e.DisableMultiRegionAccessPoints)e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0;return e},kh=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Xh=/(\d+\.){3}\d+/,Gh=/\.\./,Vh=(e)=>kh.test(e)&&!Xh.test(e)&&!Gh.test(e),Qh=(e)=>{let[t,r,n,,,a]=e.split(":"),o=t==="arn"&&e.split(":").length>=6,c=Boolean(o&&r&&n&&a);if(o&&!c)throw Error(`Invalid ARN: ${e} was an invalid ARN.`);return c},Fh=(e,t,r,n=!1)=>{let a=async()=>{let o;if(n)o=r.clientContextParams?.[e]??r[e]??r[t];else o=r[e]??r[t];if(typeof o==="function")return o();return o};if(e==="credentialScope"||t==="CredentialScope")return async()=>{let o=typeof r.credentials==="function"?await r.credentials():r.credentials;return o?.credentialScope??o?.CredentialScope};if(e==="accountId"||t==="AccountId")return async()=>{let o=typeof r.credentials==="function"?await r.credentials():r.credentials;return o?.accountId??o?.AccountId};if(e==="endpoint"||t==="endpoint")return async()=>{if(r.isCustomEndpoint===!1)return;let o=await a();if(o&&typeof o==="object"){if("url"in o)return o.url.href;if("hostname"in o){let{protocol:c,hostname:d,port:p,path:m}=o;return`${c}//${d}${p?":"+p:""}${m}`}}return o};return a},Lt=(e)=>{if(typeof e==="object"){if("url"in e){let t=Rr.parseUrl(e.url);if(e.headers){t.headers={};for(let[r,n]of Object.entries(e.headers))t.headers[r.toLowerCase()]=n.join(", ")}return t}return e}return Rr.parseUrl(e)},qr=async(e,t,r,n)=>{if(!r.isCustomEndpoint){let c;if(r.serviceConfiguredEndpoint)c=await r.serviceConfiguredEndpoint();else c=await Br.getEndpointFromConfig(r.serviceId);if(c)r.endpoint=()=>Promise.resolve(Lt(c)),r.isCustomEndpoint=!0}let a=await Hr(e,t,r);if(typeof r.endpointProvider!=="function")throw Error("config.endpointProvider is not set.");let o=r.endpointProvider(a,n);if(r.isCustomEndpoint&&r.endpoint){let c=await r.endpoint();if(c?.headers){o.headers??={};for(let[d,p]of Object.entries(c.headers))o.headers[d]=Array.isArray(p)?p:[p]}}return o},Hr=async(e,t,r)=>{let n={},a=t?.getEndpointParameterInstructions?.()||{};for(let[o,c]of Object.entries(a))switch(c.type){case"staticContextParams":n[o]=c.value;break;case"contextParams":n[o]=e[c.name];break;case"clientContextParams":case"builtInParams":n[o]=await Fh(c.name,o,r,c.type!=="builtInParams")();break;case"operationContextParams":n[o]=c.get(e);break;default:throw Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(c))}if(Object.keys(a).length===0)Object.assign(n,r);if(String(r.serviceId).toLowerCase()==="s3")await Hh(n);return n},kr=({config:e,instructions:t})=>{return(r,n)=>async(a)=>{if(e.isCustomEndpoint)Bh.setFeature(n,"ENDPOINT_OVERRIDE","N");let o=await qr(a.input,{getEndpointParameterInstructions(){return t}},{...e},n);n.endpointV2=o,n.authSchemes=o.properties?.authSchemes;let c=n.authSchemes?.[0];if(c){n.signing_region=c.signingRegion,n.signing_service=c.signingName;let p=Je.getSmithyContext(n)?.selectedHttpAuthScheme?.httpAuthOption;if(p)p.signingProperties=Object.assign(p.signingProperties||{},{signing_region:c.signingRegion,signingRegion:c.signingRegion,signing_service:c.signingName,signingName:c.signingName,signingRegionSet:c.signingRegionSet},c.properties)}return r({...a})}},Xr={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:qh.serializerMiddlewareOption.name},Wh=(e,t)=>({applyToStack:(r)=>{r.addRelativeTo(kr({config:e,instructions:t}),Xr)}}),jh=(e)=>{let t=e.tls??!0,{endpoint:r,useDualstackEndpoint:n,useFipsEndpoint:a}=e,o=r!=null?async()=>Lt(await Je.normalizeProvider(r)()):void 0,d=Object.assign(e,{endpoint:o,tls:t,isCustomEndpoint:!!r,useDualstackEndpoint:Je.normalizeProvider(n??!1),useFipsEndpoint:Je.normalizeProvider(a??!1)}),p=void 0;return d.serviceConfiguredEndpoint=async()=>{if(e.serviceId&&!p)p=Br.getEndpointFromConfig(e.serviceId);return p},d},Kh=(e)=>{let{endpoint:t}=e;if(t===void 0)e.endpoint=async()=>{throw Error("@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint.")};return e};Jh.endpointMiddleware=kr;Jh.endpointMiddlewareOptions=Xr;Jh.getEndpointFromInstructions=qr;Jh.getEndpointPlugin=Wh;Jh.resolveEndpointConfig=jh;Jh.resolveEndpointRequiredConfig=Kh;Jh.resolveParams=Hr;Jh.toEndpointV1=Lt});var Qr=L((Gr)=>{Object.defineProperty(Gr,"__esModule",{value:!0});Gr.isStreamingPayload=void 0;var oc=ee("stream"),ac=(e)=>e?.body instanceof oc.Readable||typeof ReadableStream<"u"&&e?.body instanceof ReadableStream;Gr.isStreamingPayload=ac});var Xc=L((Sc)=>{var q=It(),Ae=ce(),le=Ct(),Kr=hc(),Fr=Ze(),cc=jr(),lc=Qr(),uc=qt(),Jr=(e)=>{if(e instanceof Error)return e;if(e instanceof Object)return Object.assign(Error(),e);if(typeof e==="string")return Error(e);return Error(`AWS SDK error wrapper for ${e}`)},fc=(e,t)=>{let r=e,n=q.NO_RETRY_INCREMENT,a=q.RETRY_COST,o=q.TIMEOUT_RETRY_COST,c=e,d=(y)=>y.name==="TimeoutError"?o:a,p=(y)=>d(y)<=c;return Object.freeze({hasRetryTokens:p,retrieveRetryTokens:(y)=>{if(!p(y))throw Error("No retry token available");let b=d(y);return c-=b,b},releaseRetryTokens:(y)=>{c+=y??n,c=Math.min(c,r)}})},Zr=(e,t)=>Math.floor(Math.min(q.MAXIMUM_RETRY_DELAY,Math.random()*2**t*e)),Yr=(e)=>{if(!e)return!1;return le.isRetryableByTrait(e)||le.isClockSkewError(e)||le.isThrottlingError(e)||le.isTransientError(e)};class Ht{maxAttemptsProvider;retryDecider;delayDecider;retryQuota;mode=q.RETRY_MODES.STANDARD;constructor(e,t){this.maxAttemptsProvider=e,this.retryDecider=t?.retryDecider??Yr,this.delayDecider=t?.delayDecider??Zr,this.retryQuota=t?.retryQuota??fc(q.INITIAL_RETRY_TOKENS)}shouldRetry(e,t,r){return t<r&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)}async getMaxAttempts(){let e;try{e=await this.maxAttemptsProvider()}catch(t){e=q.DEFAULT_MAX_ATTEMPTS}return e}async retry(e,t,r){let n,a=0,o=0,c=await this.getMaxAttempts(),{request:d}=t;if(Ae.HttpRequest.isInstance(d))d.headers[q.INVOCATION_ID_HEADER]=Kr.v4();while(!0)try{if(Ae.HttpRequest.isInstance(d))d.headers[q.REQUEST_HEADER]=`attempt=${a+1}; max=${c}`;if(r?.beforeRequest)await r.beforeRequest();let{response:p,output:m}=await e(t);if(r?.afterRequest)r.afterRequest(p);return this.retryQuota.releaseRetryTokens(n),m.$metadata.attempts=a+1,m.$metadata.totalRetryDelay=o,{response:p,output:m}}catch(p){let m=Jr(p);if(a++,this.shouldRetry(m,a,c)){n=this.retryQuota.retrieveRetryTokens(m);let E=this.delayDecider(le.isThrottlingError(m)?q.THROTTLING_RETRY_DELAY_BASE:q.DEFAULT_RETRY_DELAY_BASE,a),y=dc(m.$response),b=Math.max(y||0,E);o+=b,await new Promise((S)=>setTimeout(S,b));continue}if(!m.$metadata)m.$metadata={};throw m.$metadata.attempts=a,m.$metadata.totalRetryDelay=o,m}}}var dc=(e)=>{if(!Ae.HttpResponse.isInstance(e))return;let t=Object.keys(e.headers).find((o)=>o.toLowerCase()==="retry-after");if(!t)return;let r=e.headers[t],n=Number(r);if(!Number.isNaN(n))return n*1000;return new Date(r).getTime()-Date.now()};class vr extends Ht{rateLimiter;constructor(e,t){let{rateLimiter:r,...n}=t??{};super(e,n);this.rateLimiter=r??new q.DefaultRateLimiter,this.mode=q.RETRY_MODES.ADAPTIVE}async retry(e,t){return super.retry(e,t,{beforeRequest:async()=>{return this.rateLimiter.getSendToken()},afterRequest:(r)=>{this.rateLimiter.updateClientSendingRate(r)}})}}var Rt="AWS_MAX_ATTEMPTS",Bt="max_attempts",pc={environmentVariableSelector:(e)=>{let t=e[Rt];if(!t)return;let r=parseInt(t);if(Number.isNaN(r))throw Error(`Environment variable ${Rt} mast be a number, got "${t}"`);return r},configFileSelector:(e)=>{let t=e[Bt];if(!t)return;let r=parseInt(t);if(Number.isNaN(r))throw Error(`Shared config file entry ${Bt} mast be a number, got "${t}"`);return r},default:q.DEFAULT_MAX_ATTEMPTS},gc=(e)=>{let{retryStrategy:t,retryMode:r}=e,n=Fr.normalizeProvider(e.maxAttempts??q.DEFAULT_MAX_ATTEMPTS),a=t?Promise.resolve(t):void 0,o=async()=>await Fr.normalizeProvider(r)()===q.RETRY_MODES.ADAPTIVE?new q.AdaptiveRetryStrategy(n):new q.StandardRetryStrategy(n);return Object.assign(e,{maxAttempts:n,retryStrategy:()=>a??=o()})},ei="AWS_RETRY_MODE",ti="retry_mode",mc={environmentVariableSelector:(e)=>e[ei],configFileSelector:(e)=>e[ti],default:q.DEFAULT_RETRY_MODE},si=()=>(e)=>async(t)=>{let{request:r}=t;if(Ae.HttpRequest.isInstance(r))delete r.headers[q.INVOCATION_ID_HEADER],delete r.headers[q.REQUEST_HEADER];return e(t)},ri={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},wc=(e)=>({applyToStack:(t)=>{t.addRelativeTo(si(),ri)}});function ii(e,t){if(!Ae.HttpResponse.isInstance(e))return;for(let r of Object.keys(e.headers)){let n=r.toLowerCase();if(n==="retry-after"){let a=e.headers[r],o=NaN;if(a.endsWith("GMT"))try{o=(uc.parseRfc7231DateTime(a).getTime()-Date.now())/1000}catch(c){t?.trace?.("Failed to parse retry-after header"),t?.trace?.(c)}else if(a.match(/ GMT, ((\d+)|(\d+\.\d+))$/))o=Number(a.match(/ GMT, ([\d.]+)$/)?.[1]);else if(a.match(/^((\d+)|(\d+\.\d+))$/))o=Number(a);else if(Date.parse(a)>=Date.now())o=(Date.parse(a)-Date.now())/1000;if(isNaN(o))return;return new Date(Date.now()+o*1000)}else if(n==="x-amz-retry-after"){let a=e.headers[r],o=Number(a);if(isNaN(o)){t?.trace?.(`Failed to parse x-amz-retry-after=${a}`);return}return new Date(Date.now()+o)}}}function Ec(e,t){return ii(e,t)}var ni=(e)=>(t,r)=>async(n)=>{let a=await e.retryStrategy(),o=await e.maxAttempts();if(Nc(a)){a=a;let c=await a.acquireInitialRetryToken((r.partition_id??"")+(r.__retryLongPoll?":longpoll":"")),d=Error(),p=0,m=0,{request:E}=n,y=Ae.HttpRequest.isInstance(E);if(y)E.headers[q.INVOCATION_ID_HEADER]=Kr.v4();while(!0)try{if(y)E.headers[q.REQUEST_HEADER]=`attempt=${p+1}; max=${o}`;let{response:b,output:S}=await t(n);return a.recordSuccess(c),S.$metadata.attempts=p+1,S.$metadata.totalRetryDelay=m,{response:b,output:S}}catch(b){let S=xc(b,e.logger);if(d=Jr(b),y&&lc.isStreamingPayload(E))throw(r.logger instanceof cc.NoOpLogger?console:r.logger)?.warn("An error was encountered in a non-retryable streaming request."),d;try{c=await a.refreshRetryTokenForRetry(c,S)}catch(P){if(typeof P.$backoff==="number")await Wr(P.$backoff);if(!d.$metadata)d.$metadata={};throw d.$metadata.attempts=p+1,d.$metadata.totalRetryDelay=m,d}p=c.getRetryCount();let I=c.getRetryDelay();m+=I,await Wr(I)}}else{if(a=a,a?.mode)r.userAgent=[...r.userAgent||[],["cfg/retry-mode",a.mode]];return a.retry(t,n)}},Wr=(e)=>new Promise((t)=>setTimeout(t,e)),Nc=(e)=>typeof e.acquireInitialRetryToken<"u"&&typeof e.refreshRetryTokenForRetry<"u"&&typeof e.recordSuccess<"u",xc=(e,t)=>{let r={error:e,errorType:yc(e)},n=ii(e.$response,t);if(n)r.retryAfterHint=n;return r},yc=(e)=>{if(le.isThrottlingError(e))return"THROTTLING";if(le.isTransientError(e))return"TRANSIENT";if(le.isServerError(e))return"SERVER_ERROR";return"CLIENT_ERROR"},oi={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},bc=(e)=>({applyToStack:(t)=>{t.add(ni(e),oi)}});Sc.AdaptiveRetryStrategy=vr;Sc.CONFIG_MAX_ATTEMPTS=Bt;Sc.CONFIG_RETRY_MODE=ti;Sc.ENV_MAX_ATTEMPTS=Rt;Sc.ENV_RETRY_MODE=ei;Sc.NODE_MAX_ATTEMPT_CONFIG_OPTIONS=pc;Sc.NODE_RETRY_MODE_CONFIG_OPTIONS=mc;Sc.StandardRetryStrategy=Ht;Sc.defaultDelayDecider=Zr;Sc.defaultRetryDecider=Yr;Sc.getOmitRetryHeadersPlugin=wc;Sc.getRetryAfterHint=Ec;Sc.getRetryPlugin=bc;Sc.omitRetryHeadersMiddleware=si;Sc.omitRetryHeadersMiddlewareOptions=ri;Sc.resolveRetryConfig=gc;Sc.retryMiddleware=ni;Sc.retryMiddlewareOptions=oi});var ci=L((hi)=>{Object.defineProperty(hi,"__esModule",{value:!0});hi.warning=void 0;hi.stsRegionDefaultResolver=Vc;var ai=kt(),Gc=zt();function Vc(e={}){return(0,Gc.loadConfig)({...ai.NODE_REGION_CONFIG_OPTIONS,async default(){if(!hi.warning.silence)console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.");return"us-east-1"}},{...ai.NODE_REGION_CONFIG_FILE_OPTIONS,...e})}hi.warning={silence:!1}});var tl=L((Be)=>{var Ye=ci(),qe=kt(),Fc=(e)=>{return{setRegion(t){e.region=t},region(){return e.region}}},Wc=(e)=>{return{region:e.region()}};Be.NODE_REGION_CONFIG_FILE_OPTIONS=qe.NODE_REGION_CONFIG_FILE_OPTIONS;Be.NODE_REGION_CONFIG_OPTIONS=qe.NODE_REGION_CONFIG_OPTIONS;Be.REGION_ENV_NAME=qe.REGION_ENV_NAME;Be.REGION_INI_NAME=qe.REGION_INI_NAME;Be.resolveRegionConfig=qe.resolveRegionConfig;Be.getAwsRegionExtensionConfiguration=Fc;Be.resolveAwsRegionExtensionConfiguration=Wc;Object.prototype.hasOwnProperty.call(Ye,"__proto__")&&!Object.prototype.hasOwnProperty.call(Be,"__proto__")&&Object.defineProperty(Be,"__proto__",{enumerable:!0,value:Ye.__proto__});Object.keys(Ye).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(Be,e))Be[e]=Ye[e]})});var Sl=L((ml)=>{var __dirname="/root/muxcode-source/node_modules/.bun/@aws-sdk+util-user-agent-node@3.973.15/node_modules/@aws-sdk/util-user-agent-node/dist-cjs",li=ee("os"),He=ee("process"),ui=sl(),fi=ee("fs/promises"),_e=ee("path"),rl=Nr(),il=()=>{let e=["deno","bun","llrt"];for(let t of e)if(He.versions[t])return[`md/${t}`,He.versions[t]];return["md/nodejs",He.versions.node]},nl=(e)=>{let t=process.cwd();if(!e)return[t];let r=_e.normalize(e),n=r.split(_e.sep),a=n.indexOf("node_modules"),o=a!==-1?n.slice(0,a).join(_e.sep):r;if(t===o)return[t];return[o,t]},ol=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/,di=(e="")=>{let t=e.match(ol);if(!t)return;let[r,n,a,o]=[t[1],t[2],t[3],t[4]];return o?`${r}.${n}.${a}-${o}`:`${r}.${n}.${a}`},al=["^","~",">=","<=",">","<"],hl=["latest","beta","dev","rc","insiders","next"],cl=(e="")=>{if(hl.includes(e))return e;let t=al.find((n)=>e.startsWith(n))??"",r=di(e.slice(t.length));if(!r)return;return`${t}${r}`},te,ll=_e.join("node_modules","typescript","package.json"),ul=async()=>{if(te===null)return;else if(typeof te==="string")return["md/tsc",te];let e=!1;try{e=ui.booleanSelector(process.env,"AWS_SDK_JS_TYPESCRIPT_DETECTION_DISABLED",ui.SelectorType.ENV)||!1}catch{}if(e){te=null;return}let r=nl(typeof __dirname<"u"?__dirname:void 0),n;for(let c of r)try{let d=_e.join(c,"package.json"),p=await fi.readFile(d,"utf-8"),{dependencies:m,devDependencies:E}=JSON.parse(p),y=E?.typescript??m?.typescript;if(typeof y!=="string")continue;n=y;break}catch{}if(!n){te=null;return}let a;for(let c of r)try{let d=_e.join(c,ll),p=await fi.readFile(d,"utf-8"),{version:m}=JSON.parse(p),E=di(m);if(typeof E!=="string")continue;a=E;break}catch{}if(a)return te=a,["md/tsc",te];let o=cl(n);if(typeof o!=="string"){te=null;return}return te=`dev_${o}`,["md/tsc",te]},pi={isCrtAvailable:!1},fl=()=>{if(pi.isCrtAvailable)return["md/crt-avail"];return null},gi=({serviceId:e,clientVersion:t})=>{let r=il();return async(n)=>{let a=[["aws-sdk-js",t],["ua","2.1"],[`os/${li.platform()}`,li.release()],["lang/js"],r],o=await ul();if(o)a.push(o);let c=fl();if(c)a.push(c);if(e)a.push([`api/${e}`,t]);if(He.env.AWS_EXECUTION_ENV)a.push([`exec-env/${He.env.AWS_EXECUTION_ENV}`]);let d=await n?.userAgentAppId?.();return d?[...a,[`app/${d}`]]:[...a]}},dl=gi,mi="AWS_SDK_UA_APP_ID",wi="sdk_ua_app_id",pl="sdk-ua-app-id",gl={environmentVariableSelector:(e)=>e[mi],configFileSelector:(e)=>e[wi]??e[pl],default:rl.DEFAULT_UA_APP_ID};ml.NODE_APP_ID_CONFIG_OPTIONS=gl;ml.UA_APP_ID_ENV_NAME=mi;ml.UA_APP_ID_INI_NAME=wi;ml.createDefaultUserAgentProvider=gi;ml.crtAvailability=pi;ml.defaultUserAgent=dl});var Ml=L((Cl)=>{var Gt=Tl(),Al=ve(),_l=ee("buffer"),Ei=ee("crypto");class xi{algorithmIdentifier;secret;hash;constructor(e,t){this.algorithmIdentifier=e,this.secret=t,this.reset()}update(e,t){this.hash.update(Al.toUint8Array(Ni(e,t)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?Ei.createHmac(this.algorithmIdentifier,Ni(this.secret)):Ei.createHash(this.algorithmIdentifier)}}function Ni(e,t){if(_l.Buffer.isBuffer(e))return e;if(typeof e==="string")return Gt.fromString(e,t);if(ArrayBuffer.isView(e))return Gt.fromArrayBuffer(e.buffer,e.byteOffset,e.byteLength);return Gt.fromArrayBuffer(e)}Cl.Hash=xi});var Dl=L((Il)=>{var Vt=ee("fs"),Ol=(e)=>{if(!e)return 0;if(typeof e==="string")return Buffer.byteLength(e);else if(typeof e.byteLength==="number")return e.byteLength;else if(typeof e.size==="number")return e.size;else if(typeof e.start==="number"&&typeof e.end==="number")return e.end+1-e.start;else if(e instanceof Vt.ReadStream){if(e.path!=null)return Vt.lstatSync(e.path).size;else if(typeof e.fd==="number")return Vt.fstatSync(e.fd).size}throw Error(`Body Length computation failed for ${e}`)};Il.calculateBodyLength=Ol});var Kl=L((Wl)=>{var Ul=kt(),yi=zt(),Ll=zl(),Rl="AWS_EXECUTION_ENV",bi="AWS_REGION",Si="AWS_DEFAULT_REGION",Bl="AWS_EC2_METADATA_DISABLED",ql=["in-region","cross-region","mobile","standard","legacy"],Hl="/latest/meta-data/placement/region",kl="AWS_DEFAULTS_MODE",Xl="defaults_mode",Gl={environmentVariableSelector:(e)=>{return e[kl]},configFileSelector:(e)=>{return e[Xl]},default:"legacy"},Vl=({region:e=yi.loadConfig(Ul.NODE_REGION_CONFIG_OPTIONS),defaultsMode:t=yi.loadConfig(Gl)}={})=>Ll.memoize(async()=>{let r=typeof t==="function"?await t():t;switch(r?.toLowerCase()){case"auto":return Ql(e);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(r?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw Error(`Invalid parameter for "defaultsMode", expect ${ql.join(", ")}, got ${r}`)}}),Ql=async(e)=>{if(e){let t=typeof e==="function"?await e():e,r=await Fl();if(!r)return"standard";if(t===r)return"in-region";else return"cross-region"}return"standard"},Fl=async()=>{if(process.env[Rl]&&(process.env[bi]||process.env[Si]))return process.env[bi]??process.env[Si];if(!process.env[Bl])try{let{getInstanceMetadataEndpoint:e,httpRequest:t}=await import("./chunk-b57avnse.js"),r=await e();return(await t({...r,path:Hl})).toString()}catch(e){}};Wl.resolveDefaultsModeConfig=Vl});var Ku=L((cu)=>{var ue=Jl(),Ne=ve(),vl=Zl(),$i=ce(),Ti=Ze(),et=Yl(),Mi="X-Amz-Algorithm",Oi="X-Amz-Credential",Wt="X-Amz-Date",Ii="X-Amz-SignedHeaders",Pi="X-Amz-Expires",jt="X-Amz-Signature",Kt="X-Amz-Security-Token",eu="X-Amz-Region-Set",Jt="authorization",Zt=Wt.toLowerCase(),Di="date",zi=[Jt,Zt,Di],Ui=jt.toLowerCase(),nt="x-amz-content-sha256",Li=Kt.toLowerCase(),tu="host",Ri={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Bi=/^proxy-/,qi=/^sec-/,su=[/^proxy-/i,/^sec-/i],tt="AWS4-HMAC-SHA256",ru="AWS4-ECDSA-P256-SHA256",Hi="AWS4-HMAC-SHA256-PAYLOAD",ki="UNSIGNED-PAYLOAD",Xi=50,Yt="aws4_request",Gi=604800,Ce={},st=[],rt=(e,t,r)=>`${e}/${t}/${r}/${Yt}`,Vi=async(e,t,r,n,a)=>{let o=await Ai(e,t.secretAccessKey,t.accessKeyId),c=`${r}:${n}:${a}:${ue.toHex(o)}:${t.sessionToken}`;if(c in Ce)return Ce[c];st.push(c);while(st.length>Xi)delete Ce[st.shift()];let d=`AWS4${t.secretAccessKey}`;for(let p of[r,n,a,Yt])d=await Ai(e,d,p);return Ce[c]=d},iu=()=>{st.length=0,Object.keys(Ce).forEach((e)=>{delete Ce[e]})},Ai=(e,t,r)=>{let n=new e(t);return n.update(Ne.toUint8Array(r)),n.digest()},Qt=({headers:e},t,r)=>{let n={};for(let a of Object.keys(e).sort()){if(e[a]==null)continue;let o=a.toLowerCase();if(o in Ri||t?.has(o)||Bi.test(o)||qi.test(o)){if(!r||r&&!r.has(o))continue}n[o]=e[a].trim().replace(/\s+/g," ")}return n},it=async({headers:e,body:t},r)=>{for(let n of Object.keys(e))if(n.toLowerCase()===nt)return e[n];if(t==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof t==="string"||ArrayBuffer.isView(t)||vl.isArrayBuffer(t)){let n=new r;return n.update(Ne.toUint8Array(t)),ue.toHex(await n.digest())}return ki};class Qi{format(e){let t=[];for(let a of Object.keys(e)){let o=Ne.fromUtf8(a);t.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(e[a]))}let r=new Uint8Array(t.reduce((a,o)=>a+o.byteLength,0)),n=0;for(let a of t)r.set(a,n),n+=a.byteLength;return r}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":let t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":let r=new DataView(new ArrayBuffer(5));return r.setUint8(0,4),r.setInt32(1,e.value,!1),new Uint8Array(r.buffer);case"long":let n=new Uint8Array(9);return n[0]=5,n.set(e.value.bytes,1),n;case"binary":let a=new DataView(new ArrayBuffer(3+e.value.byteLength));a.setUint8(0,6),a.setUint16(1,e.value.byteLength,!1);let o=new Uint8Array(a.buffer);return o.set(e.value,3),o;case"string":let c=Ne.fromUtf8(e.value),d=new DataView(new ArrayBuffer(3+c.byteLength));d.setUint8(0,7),d.setUint16(1,c.byteLength,!1);let p=new Uint8Array(d.buffer);return p.set(c,3),p;case"timestamp":let m=new Uint8Array(9);return m[0]=8,m.set(vt.fromNumber(e.value.valueOf()).bytes,1),m;case"uuid":if(!nu.test(e.value))throw Error(`Invalid UUID received: ${e.value}`);let E=new Uint8Array(17);return E[0]=9,E.set(ue.fromHex(e.value.replace(/\-/g,"")),1),E}}}var _i;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(_i||(_i={}));var nu=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class vt{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776000||e<-9223372036854776000)throw Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);let t=new Uint8Array(8);for(let r=7,n=Math.abs(Math.round(e));r>-1&&n>0;r--,n/=256)t[r]=n;if(e<0)Ci(t);return new vt(t)}valueOf(){let e=this.bytes.slice(0),t=e[0]&128;if(t)Ci(e);return parseInt(ue.toHex(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function Ci(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1;t--)if(e[t]++,e[t]!==0)break}var Fi=(e,t)=>{e=e.toLowerCase();for(let r of Object.keys(t))if(e===r.toLowerCase())return!0;return!1},Wi=(e,t={})=>{let{headers:r,query:n={}}=$i.HttpRequest.clone(e);for(let a of Object.keys(r)){let o=a.toLowerCase();if(o.slice(0,6)==="x-amz-"&&!t.unhoistableHeaders?.has(o)||t.hoistableHeaders?.has(o))n[a]=r[a],delete r[a]}return{...e,headers:r,query:n}},Ft=(e)=>{e=$i.HttpRequest.clone(e);for(let t of Object.keys(e.headers))if(zi.indexOf(t.toLowerCase())>-1)delete e.headers[t];return e},ji=({query:e={}})=>{let t=[],r={};for(let n of Object.keys(e)){if(n.toLowerCase()===Ui)continue;let a=et.escapeUri(n);t.push(a);let o=e[n];if(typeof o==="string")r[a]=`${a}=${et.escapeUri(o)}`;else if(Array.isArray(o))r[a]=o.slice(0).reduce((c,d)=>c.concat([`${a}=${et.escapeUri(d)}`]),[]).sort().join("&")}return t.sort().map((n)=>r[n]).filter((n)=>n).join("&")},ou=(e)=>au(e).toISOString().replace(/\.\d{3}Z$/,"Z"),au=(e)=>{if(typeof e==="number")return new Date(e*1000);if(typeof e==="string"){if(Number(e))return new Date(Number(e)*1000);return new Date(e)}return e};class es{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:r,service:n,sha256:a,uriEscapePath:o=!0}){this.service=n,this.sha256=a,this.uriEscapePath=o,this.applyChecksum=typeof e==="boolean"?e:!0,this.regionProvider=Ti.normalizeProvider(r),this.credentialProvider=Ti.normalizeProvider(t)}createCanonicalRequest(e,t,r){let n=Object.keys(t).sort();return`${e.method}
4
+ ${this.getCanonicalPath(e)}
5
+ ${ji(e)}
6
+ ${n.map((a)=>`${a}:${t[a]}`).join(`
7
+ `)}
8
+
9
+ ${n.join(";")}
10
+ ${r}`}async createStringToSign(e,t,r,n){let a=new this.sha256;a.update(Ne.toUint8Array(r));let o=await a.digest();return`${n}
11
+ ${e}
12
+ ${t}
13
+ ${ue.toHex(o)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){let t=[];for(let a of e.split("/")){if(a?.length===0)continue;if(a===".")continue;if(a==="..")t.pop();else t.push(a)}let r=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return et.escapeUri(r).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!=="object"||typeof e.accessKeyId!=="string"||typeof e.secretAccessKey!=="string")throw Error("Resolved credential object is not valid")}formatDate(e){let t=ou(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}class Ki extends es{headerFormatter=new Qi;constructor({applyChecksum:e,credentials:t,region:r,service:n,sha256:a,uriEscapePath:o=!0}){super({applyChecksum:e,credentials:t,region:r,service:n,sha256:a,uriEscapePath:o})}async presign(e,t={}){let{signingDate:r=new Date,expiresIn:n=3600,unsignableHeaders:a,unhoistableHeaders:o,signableHeaders:c,hoistableHeaders:d,signingRegion:p,signingService:m}=t,E=await this.credentialProvider();this.validateResolvedCredentials(E);let y=p??await this.regionProvider(),{longDate:b,shortDate:S}=this.formatDate(r);if(n>Gi)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let I=rt(S,y,m??this.service),P=Wi(Ft(e),{unhoistableHeaders:o,hoistableHeaders:d});if(E.sessionToken)P.query[Kt]=E.sessionToken;P.query[Mi]=tt,P.query[Oi]=`${E.accessKeyId}/${I}`,P.query[Wt]=b,P.query[Pi]=n.toString(10);let F=Qt(P,a,c);return P.query[Ii]=this.getCanonicalHeaderList(F),P.query[jt]=await this.getSignature(b,I,this.getSigningKey(E,y,S,m),this.createCanonicalRequest(P,F,await it(e,this.sha256))),P}async sign(e,t){if(typeof e==="string")return this.signString(e,t);else if(e.headers&&e.payload)return this.signEvent(e,t);else if(e.message)return this.signMessage(e,t);else return this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:r=new Date,priorSignature:n,signingRegion:a,signingService:o}){let c=a??await this.regionProvider(),{shortDate:d,longDate:p}=this.formatDate(r),m=rt(d,c,o??this.service),E=await it({headers:{},body:t},this.sha256),y=new this.sha256;y.update(e);let b=ue.toHex(await y.digest()),S=[Hi,p,m,n,b,E].join(`
14
+ `);return this.signString(S,{signingDate:r,signingRegion:c,signingService:o})}async signMessage(e,{signingDate:t=new Date,signingRegion:r,signingService:n}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:r,signingService:n,priorSignature:e.priorSignature}).then((o)=>{return{message:e.message,signature:o}})}async signString(e,{signingDate:t=new Date,signingRegion:r,signingService:n}={}){let a=await this.credentialProvider();this.validateResolvedCredentials(a);let o=r??await this.regionProvider(),{shortDate:c}=this.formatDate(t),d=new this.sha256(await this.getSigningKey(a,o,c,n));return d.update(Ne.toUint8Array(e)),ue.toHex(await d.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:r,unsignableHeaders:n,signingRegion:a,signingService:o}={}){let c=await this.credentialProvider();this.validateResolvedCredentials(c);let d=a??await this.regionProvider(),p=Ft(e),{longDate:m,shortDate:E}=this.formatDate(t),y=rt(E,d,o??this.service);if(p.headers[Zt]=m,c.sessionToken)p.headers[Li]=c.sessionToken;let b=await it(p,this.sha256);if(!Fi(nt,p.headers)&&this.applyChecksum)p.headers[nt]=b;let S=Qt(p,n,r),I=await this.getSignature(m,y,this.getSigningKey(c,d,E,o),this.createCanonicalRequest(p,S,b));return p.headers[Jt]=`${tt} Credential=${c.accessKeyId}/${y}, SignedHeaders=${this.getCanonicalHeaderList(S)}, Signature=${I}`,p}async getSignature(e,t,r,n){let a=await this.createStringToSign(e,t,n,tt),o=new this.sha256(await r);return o.update(Ne.toUint8Array(a)),ue.toHex(await o.digest())}getSigningKey(e,t,r,n){return Vi(this.sha256,e,r,t,n||this.service)}}var hu={SignatureV4a:null};cu.ALGORITHM_IDENTIFIER=tt;cu.ALGORITHM_IDENTIFIER_V4A=ru;cu.ALGORITHM_QUERY_PARAM=Mi;cu.ALWAYS_UNSIGNABLE_HEADERS=Ri;cu.AMZ_DATE_HEADER=Zt;cu.AMZ_DATE_QUERY_PARAM=Wt;cu.AUTH_HEADER=Jt;cu.CREDENTIAL_QUERY_PARAM=Oi;cu.DATE_HEADER=Di;cu.EVENT_ALGORITHM_IDENTIFIER=Hi;cu.EXPIRES_QUERY_PARAM=Pi;cu.GENERATED_HEADERS=zi;cu.HOST_HEADER=tu;cu.KEY_TYPE_IDENTIFIER=Yt;cu.MAX_CACHE_SIZE=Xi;cu.MAX_PRESIGNED_TTL=Gi;cu.PROXY_HEADER_PATTERN=Bi;cu.REGION_SET_PARAM=eu;cu.SEC_HEADER_PATTERN=qi;cu.SHA256_HEADER=nt;cu.SIGNATURE_HEADER=Ui;cu.SIGNATURE_QUERY_PARAM=jt;cu.SIGNED_HEADERS_QUERY_PARAM=Ii;cu.SignatureV4=Ki;cu.SignatureV4Base=es;cu.TOKEN_HEADER=Li;cu.TOKEN_QUERY_PARAM=Kt;cu.UNSIGNABLE_PATTERNS=su;cu.UNSIGNED_PAYLOAD=ki;cu.clearCredentialCache=iu;cu.createScope=rt;cu.getCanonicalHeaders=Qt;cu.getCanonicalQuery=ji;cu.getPayloadHash=it;cu.getSigningKey=Vi;cu.hasHeader=Fi;cu.moveHeadersToQuery=Wi;cu.prepareRequest=Ft;cu.signatureV4aContainer=hu});var Zi=L((Zu)=>{var Ji=typeof TextEncoder=="function"?new TextEncoder:null,Ju=(e)=>{if(typeof e==="string"){if(Ji)return Ji.encode(e).byteLength;let t=e.length;for(let r=t-1;r>=0;r--){let n=e.charCodeAt(r);if(n>127&&n<=2047)t++;else if(n>2047&&n<=65535)t+=2;if(n>=56320&&n<=57343)r--}return t}else if(typeof e.byteLength==="number")return e.byteLength;else if(typeof e.size==="number")return e.size;throw Error(`Body Length computation failed for ${e}`)};Zu.calculateBodyLength=Ju});var gn=L((bf)=>{var Me=qt(),nn=ve(),Xe=rn(),vu=ce(),ef=Zi(),$e=sn(),tf=Ze(),on=tn(),ht=0,ct=1,xe=2,fe=3,ke=4,ot=5,an=6,ts=7,hn=20,is=21,cn=22,sf=23,os=24,ye=25,be=26,de=27,as=31;function Oe(e){return typeof Buffer<"u"?Buffer.alloc(e):new Uint8Array(e)}var hs=Symbol("@smithy/core/cbor::tagSymbol");function cs(e){return e[hs]=!0,e}var rf=typeof TextDecoder<"u",nf=typeof Buffer<"u",R=Oe(0),oe=new DataView(R.buffer,R.byteOffset,R.byteLength),Yi=rf?new TextDecoder:null,M=0;function of(e){R=e,oe=new DataView(R.buffer,R.byteOffset,R.byteLength)}function ae(e,t){if(e>=t)throw Error("unexpected end of (decode) payload.");let r=(R[e]&224)>>5,n=R[e]&31;switch(r){case ht:case ct:case an:let a,o;if(n<24)a=n,o=1;else switch(n){case os:case ye:case be:case de:let c=un[n],d=c+1;if(o=d,t-e<d)throw Error(`countLength ${c} greater than remaining buf len.`);let p=e+1;if(c===1)a=R[p];else if(c===2)a=oe.getUint16(p);else if(c===4)a=oe.getUint32(p);else a=oe.getBigUint64(p);break;default:throw Error(`unexpected minor value ${n}.`)}if(r===ht)return M=o,ss(a);else if(r===ct){let c;if(typeof a==="bigint")c=BigInt(-1)-a;else c=-1-a;return M=o,ss(c)}else if(n===2||n===3){let c=Ge(e+o,t),d=BigInt(0),p=e+o+M;for(let m=p;m<p+c;++m)d=d<<BigInt(8)|BigInt(R[m]);return M=o+M+c,n===3?-d-BigInt(1):d}else if(n===4){let c=ae(e+o,t),[d,p]=c,m=p<0?-1:1,E="0".repeat(Math.abs(d)+1)+String(BigInt(m)*BigInt(p)),y,b=p<0?"-":"";if(y=d===0?E:E.slice(0,E.length+d)+"."+E.slice(d),y=y.replace(/^0+/g,""),y==="")y="0";if(y[0]===".")y="0"+y;return y=b+y,M=o+M,Me.nv(y)}else{let c=ae(e+o,t);return M=o+M,cs({tag:ss(a),value:c})}case fe:case ot:case ke:case xe:if(n===as)switch(r){case fe:return lf(e,t);case ot:return gf(e,t);case ke:return df(e,t);case xe:return uf(e,t)}else switch(r){case fe:return cf(e,t);case ot:return pf(e,t);case ke:return ff(e,t);case xe:return ls(e,t)}default:return mf(e,t)}}function ln(e,t,r){if(nf&&e.constructor?.name==="Buffer")return e.toString("utf-8",t,r);if(Yi)return Yi.decode(e.subarray(t,r));return nn.toUtf8(e.subarray(t,r))}function af(e){let t=Number(e);if(t<Number.MIN_SAFE_INTEGER||Number.MAX_SAFE_INTEGER<t)console.warn(Error(`@smithy/core/cbor - truncating BigInt(${e}) to ${t} with loss of precision.`));return t}var un={[os]:1,[ye]:2,[be]:4,[de]:8};function hf(e,t){let r=e>>7,n=(e&124)>>2,a=(e&3)<<8|t,o=r===0?1:-1,c,d;if(n===0)if(a===0)return 0;else c=Math.pow(2,-14),d=0;else if(n===31)if(a===0)return o*(1/0);else return NaN;else c=Math.pow(2,n-15),d=1;return d+=a/1024,o*(c*d)}function Ge(e,t){let r=R[e]&31;if(r<24)return M=1,r;if(r===os||r===ye||r===be||r===de){let n=un[r];if(M=n+1,t-e<M)throw Error(`countLength ${n} greater than remaining buf len.`);let a=e+1;if(n===1)return R[a];else if(n===2)return oe.getUint16(a);else if(n===4)return oe.getUint32(a);return af(oe.getBigUint64(a))}throw Error(`unexpected minor value ${r}.`)}function cf(e,t){let r=Ge(e,t),n=M;if(e+=n,t-e<r)throw Error(`string len ${r} greater than remaining buf len.`);let a=ln(R,e,e+r);return M=n+r,a}function lf(e,t){e+=1;let r=[];for(let n=e;e<t;){if(R[e]===255){let p=Oe(r.length);return p.set(r,0),M=e-n+2,ln(p,0,p.length)}let a=(R[e]&224)>>5,o=R[e]&31;if(a!==fe)throw Error(`unexpected major type ${a} in indefinite string.`);if(o===as)throw Error("nested indefinite string.");let c=ls(e,t);e+=M;for(let p=0;p<c.length;++p)r.push(c[p])}throw Error("expected break marker.")}function ls(e,t){let r=Ge(e,t),n=M;if(e+=n,t-e<r)throw Error(`unstructured byte string len ${r} greater than remaining buf len.`);let a=R.subarray(e,e+r);return M=n+r,a}function uf(e,t){e+=1;let r=[];for(let n=e;e<t;){if(R[e]===255){let p=Oe(r.length);return p.set(r,0),M=e-n+2,p}let a=(R[e]&224)>>5,o=R[e]&31;if(a!==xe)throw Error(`unexpected major type ${a} in indefinite string.`);if(o===as)throw Error("nested indefinite string.");let c=ls(e,t);e+=M;for(let p=0;p<c.length;++p)r.push(c[p])}throw Error("expected break marker.")}function ff(e,t){let r=Ge(e,t),n=M;e+=n;let a=e,o=Array(r);for(let c=0;c<r;++c){let d=ae(e,t),p=M;o[c]=d,e+=p}return M=n+(e-a),o}function df(e,t){e+=1;let r=[];for(let n=e;e<t;){if(R[e]===255)return M=e-n+2,r;let a=ae(e,t);e+=M,r.push(a)}throw Error("expected break marker.")}function pf(e,t){let r=Ge(e,t),n=M;e+=n;let a=e,o={};for(let c=0;c<r;++c){if(e>=t)throw Error("unexpected end of map payload.");let d=(R[e]&224)>>5;if(d!==fe)throw Error(`unexpected major type ${d} for map key at index ${e}.`);let p=ae(e,t);e+=M;let m=ae(e,t);e+=M,o[p]=m}return M=n+(e-a),o}function gf(e,t){e+=1;let r=e,n={};for(;e<t;){if(e>=t)throw Error("unexpected end of map payload.");if(R[e]===255)return M=e-r+2,n;let a=(R[e]&224)>>5;if(a!==fe)throw Error(`unexpected major type ${a} for map key.`);let o=ae(e,t);e+=M;let c=ae(e,t);e+=M,n[o]=c}throw Error("expected break marker.")}function mf(e,t){let r=R[e]&31;switch(r){case is:case hn:return M=1,r===is;case cn:return M=1,null;case sf:return M=1,null;case ye:if(t-e<3)throw Error("incomplete float16 at end of buf.");return M=3,hf(R[e+1],R[e+2]);case be:if(t-e<5)throw Error("incomplete float32 at end of buf.");return M=5,oe.getFloat32(e+1);case de:if(t-e<9)throw Error("incomplete float64 at end of buf.");return M=9,oe.getFloat64(e+1);default:throw Error(`unexpected minor value ${r}.`)}}function ss(e){if(typeof e==="number")return e;let t=Number(e);if(Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER)return t;return e}var vi=typeof Buffer<"u",wf=2048,C=Oe(wf),ne=new DataView(C.buffer,C.byteOffset,C.byteLength),_=0;function rs(e){if(C.byteLength-_<e)if(_<16000000)ns(Math.max(C.byteLength*4,C.byteLength+e));else ns(C.byteLength+e+16000000)}function en(){let e=Oe(_);return e.set(C.subarray(0,_),0),_=0,e}function ns(e){let t=C;if(C=Oe(e),t)if(t.copy)t.copy(C,0,0,t.byteLength);else C.set(t,0);ne=new DataView(C.buffer,C.byteOffset,C.byteLength)}function ie(e,t){if(t<24)C[_++]=e<<5|t;else if(t<256)C[_++]=e<<5|24,C[_++]=t;else if(t<65536)C[_++]=e<<5|ye,ne.setUint16(_,t),_+=2;else if(t<4294967296)C[_++]=e<<5|be,ne.setUint32(_,t),_+=4;else C[_++]=e<<5|de,ne.setBigUint64(_,typeof t==="bigint"?t:BigInt(t)),_+=8}function Ef(e){let t=[e];while(t.length){let r=t.pop();if(rs(typeof r==="string"?r.length*4:64),typeof r==="string"){if(vi)ie(fe,Buffer.byteLength(r)),_+=C.write(r,_);else{let n=nn.fromUtf8(r);ie(fe,n.byteLength),C.set(n,_),_+=n.byteLength}continue}else if(typeof r==="number"){if(Number.isInteger(r)){let n=r>=0,a=n?ht:ct,o=n?r:-r-1;if(o<24)C[_++]=a<<5|o;else if(o<256)C[_++]=a<<5|24,C[_++]=o;else if(o<65536)C[_++]=a<<5|ye,C[_++]=o>>8,C[_++]=o;else if(o<4294967296)C[_++]=a<<5|be,ne.setUint32(_,o),_+=4;else C[_++]=a<<5|de,ne.setBigUint64(_,BigInt(o)),_+=8;continue}C[_++]=ts<<5|de,ne.setFloat64(_,r),_+=8;continue}else if(typeof r==="bigint"){let n=r>=0,a=n?ht:ct,o=n?r:-r-BigInt(1),c=Number(o);if(c<24)C[_++]=a<<5|c;else if(c<256)C[_++]=a<<5|24,C[_++]=c;else if(c<65536)C[_++]=a<<5|ye,C[_++]=c>>8,C[_++]=c&255;else if(c<4294967296)C[_++]=a<<5|be,ne.setUint32(_,c),_+=4;else if(o<BigInt("18446744073709551616"))C[_++]=a<<5|de,ne.setBigUint64(_,o),_+=8;else{let d=o.toString(2),p=new Uint8Array(Math.ceil(d.length/8)),m=o,E=0;while(p.byteLength-++E>=0)p[p.byteLength-E]=Number(m&BigInt(255)),m>>=BigInt(8);if(rs(p.byteLength*2),C[_++]=n?194:195,vi)ie(xe,Buffer.byteLength(p));else ie(xe,p.byteLength);C.set(p,_),_+=p.byteLength}continue}else if(r===null){C[_++]=ts<<5|cn;continue}else if(typeof r==="boolean"){C[_++]=ts<<5|(r?is:hn);continue}else if(typeof r>"u")throw Error("@smithy/core/cbor: client may not serialize undefined value.");else if(Array.isArray(r)){for(let n=r.length-1;n>=0;--n)t.push(r[n]);ie(ke,r.length);continue}else if(typeof r.byteLength==="number"){rs(r.length*2),ie(xe,r.length),C.set(r,_),_+=r.byteLength;continue}else if(typeof r==="object"){if(r instanceof Me.NumericValue){let a=r.string.indexOf("."),o=a===-1?0:a-r.string.length+1,c=BigInt(r.string.replace(".",""));C[_++]=196,t.push(c),t.push(o),ie(ke,2);continue}if(r[hs])if("tag"in r&&"value"in r){t.push(r.value),ie(an,r.tag);continue}else throw Error("tag encountered with missing fields, need 'tag' and 'value', found: "+JSON.stringify(r));let n=Object.keys(r);for(let a=n.length-1;a>=0;--a){let o=n[a];t.push(r[o]),t.push(o)}ie(ot,n.length);continue}throw Error(`data type ${r?.constructor?.name??typeof r} not compatible for encoding.`)}}var lt={deserialize(e){return of(e),ae(0,e.length)},serialize(e){try{return Ef(e),en()}catch(t){throw en(),t}},resizeEncodingBuffer(e){ns(e)}},fn=(e,t)=>{return Xe.collectBody(e,t).then(async(r)=>{if(r.length)try{return lt.deserialize(r)}catch(n){throw Object.defineProperty(n,"$responseBodyText",{value:t.utf8Encoder(r)}),n}return{}})},at=(e)=>{return cs({tag:1,value:e.getTime()/1000})},Nf=async(e,t)=>{let r=await fn(e,t);return r.message=r.message??r.Message,r},dn=(e,t)=>{let r=(a)=>{let o=a;if(typeof o==="number")o=o.toString();if(o.indexOf(",")>=0)o=o.split(",")[0];if(o.indexOf(":")>=0)o=o.split(":")[0];if(o.indexOf("#")>=0)o=o.split("#")[1];return o};if(t.__type!==void 0)return r(t.__type);let n=Object.keys(t).find((a)=>a.toLowerCase()==="code");if(n&&t[n]!==void 0)return r(t[n])},xf=(e)=>{if(String(e.headers["smithy-protocol"]).toLowerCase()!=="rpc-v2-cbor")throw Error("Malformed RPCv2 CBOR response, status: "+e.statusCode)},yf=async(e,t,r,n,a)=>{let o=await e.endpoint(),{hostname:c,protocol:d="https",port:p,path:m}=o,E={protocol:d,hostname:c,port:p,method:"POST",path:m.endsWith("/")?m.slice(0,-1)+r:m+r,headers:{...t}};if(n!==void 0)E.hostname=n;if(o.headers)for(let[y,b]of Object.entries(o.headers))E.headers[y]=b;if(a!==void 0){E.body=a;try{E.headers["content-length"]=String(ef.calculateBodyLength(a))}catch(y){}}return new vu.HttpRequest(E)};class us extends Xe.SerdeContext{createSerializer(){let e=new fs;return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new ds;return e.setSerdeContext(this.serdeContext),e}}class fs extends Xe.SerdeContext{value;write(e,t){this.value=this.serialize(e,t)}serialize(e,t){let r=$e.NormalizedSchema.of(e);if(t==null){if(r.isIdempotencyToken())return Me.generateIdempotencyToken();return t}if(r.isBlobSchema()){if(typeof t==="string")return(this.serdeContext?.base64Decoder??on.fromBase64)(t);return t}if(r.isTimestampSchema()){if(typeof t==="number"||typeof t==="bigint")return at(new Date(Number(t)/1000|0));return at(t)}if(typeof t==="function"||typeof t==="object"){let n=t;if(r.isListSchema()&&Array.isArray(n)){let o=!!r.getMergedTraits().sparse,c=[],d=0;for(let p of n){let m=this.serialize(r.getValueSchema(),p);if(m!=null||o)c[d++]=m}return c}if(n instanceof Date)return at(n);let a={};if(r.isMapSchema()){let o=!!r.getMergedTraits().sparse;for(let c of Object.keys(n)){let d=this.serialize(r.getValueSchema(),n[c]);if(d!=null||o)a[c]=d}}else if(r.isStructSchema()){for(let[c,d]of r.structIterator()){let p=this.serialize(d,n[c]);if(p!=null)a[c]=p}if(r.isUnionSchema()&&Array.isArray(n.$unknown)){let[c,d]=n.$unknown;a[c]=d}else if(typeof n.__type==="string"){for(let[c,d]of Object.entries(n))if(!(c in a))a[c]=this.serialize(15,d)}}else if(r.isDocumentSchema())for(let o of Object.keys(n))a[o]=this.serialize(r.getValueSchema(),n[o]);else if(r.isBigDecimalSchema())return n;return a}return t}flush(){let e=lt.serialize(this.value);return this.value=void 0,e}}class ds extends Xe.SerdeContext{read(e,t){let r=lt.deserialize(t);return this.readValue(e,r)}readValue(e,t){let r=$e.NormalizedSchema.of(e);if(r.isTimestampSchema()){if(typeof t==="number")return Me._parseEpochTimestamp(t);if(typeof t==="object"){if(t.tag===1&&"value"in t)return Me._parseEpochTimestamp(t.value)}}if(r.isBlobSchema()){if(typeof t==="string")return(this.serdeContext?.base64Decoder??on.fromBase64)(t);return t}if(typeof t>"u"||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="bigint"||typeof t==="symbol")return t;else if(typeof t==="object"){if(t===null)return null;if("byteLength"in t)return t;if(t instanceof Date)return t;if(r.isDocumentSchema())return t;if(r.isListSchema()){let a=[],o=r.getValueSchema();for(let c of t){let d=this.readValue(o,c);a.push(d)}return a}let n={};if(r.isMapSchema()){let a=r.getValueSchema();for(let o of Object.keys(t)){let c=this.readValue(a,t[o]);n[o]=c}}else if(r.isStructSchema()){let a=r.isUnionSchema(),o;if(a)o=new Set(Object.keys(t).filter((c)=>c!=="__type"));for(let[c,d]of r.structIterator()){if(a)o.delete(c);if(t[c]!=null)n[c]=this.readValue(d,t[c])}if(a&&o?.size===1&&Object.keys(n).length===0){let c=o.values().next().value;n.$unknown=[c,t[c]]}else if(typeof t.__type==="string"){for(let[c,d]of Object.entries(t))if(!(c in n))n[c]=d}}else if(t instanceof Me.NumericValue)return t;return n}else return t}}class pn extends Xe.RpcProtocol{codec=new us;serializer=this.codec.createSerializer();deserializer=this.codec.createDeserializer();constructor({defaultNamespace:e,errorTypeRegistries:t}){super({defaultNamespace:e,errorTypeRegistries:t})}getShapeId(){return"smithy.protocols#rpcv2Cbor"}getPayloadCodec(){return this.codec}async serializeRequest(e,t,r){let n=await super.serializeRequest(e,t,r);if(Object.assign(n.headers,{"content-type":this.getDefaultContentType(),"smithy-protocol":"rpc-v2-cbor",accept:this.getDefaultContentType()}),$e.deref(e.input)==="unit")delete n.body,delete n.headers["content-type"];else{if(!n.body)this.serializer.write(15,{}),n.body=this.serializer.flush();try{n.headers["content-length"]=String(n.body.byteLength)}catch(d){}}let{service:a,operation:o}=tf.getSmithyContext(r),c=`/service/${a}/operation/${o}`;if(n.path.endsWith("/"))n.path+=c.slice(1);else n.path+=c;return n}async deserializeResponse(e,t,r){return super.deserializeResponse(e,t,r)}async handleError(e,t,r,n,a){let o=dn(r,n)??"Unknown",c={$metadata:a,$fault:r.statusCode<=500?"client":"server"},d=this.options.defaultNamespace;if(o.includes("#"))[d]=o.split("#");let p=this.compositeErrorRegistry,m=$e.TypeRegistry.for(d);p.copyFrom(m);let E;try{E=p.getSchema(o)}catch(F){if(n.Message)n.message=n.Message;let k=$e.TypeRegistry.for("smithy.ts.sdk.synthetic."+d);p.copyFrom(k);let Z=p.getBaseException();if(Z){let D=p.getErrorCtor(Z);throw Object.assign(new D({name:o}),c,n)}throw Object.assign(Error(o),c,n)}let y=$e.NormalizedSchema.of(E),b=p.getErrorCtor(E),S=n.message??n.Message??"Unknown",I=new b(S),P={};for(let[F,k]of y.structIterator())P[F]=this.deserializer.readValue(k,n[F]);throw Object.assign(I,c,{$fault:y.getMergedTraits().error,message:S},P)}getDefaultContentType(){return"application/cbor"}}bf.CborCodec=us;bf.CborShapeDeserializer=ds;bf.CborShapeSerializer=fs;bf.SmithyRpcV2CborProtocol=pn;bf.buildHttpRpcRequest=yf;bf.cbor=lt;bf.checkCborResponse=xf;bf.dateToTag=at;bf.loadSmithyRpcV2CborErrorCode=dn;bf.parseCborBody=fn;bf.parseCborErrorBody=Nf;bf.tag=cs;bf.tagSymbol=hs});var wn=L((tp,mn)=>{(()=>{var e={d:(s,i)=>{for(var h in i)e.o(i,h)&&!e.o(s,h)&&Object.defineProperty(s,h,{enumerable:!0,get:i[h]})},o:(s,i)=>Object.prototype.hasOwnProperty.call(s,i),r:(s)=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{XMLBuilder:()=>go,XMLParser:()=>Ds,XMLValidator:()=>mo});let r=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=new RegExp("^["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function a(s,i){let h=[],l=i.exec(s);for(;l;){let f=[];f.startIndex=i.lastIndex-l[0].length;let u=l.length;for(let N=0;N<u;N++)f.push(l[N]);h.push(f),l=i.exec(s)}return h}let o=function(s){return n.exec(s)!=null},c=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],d=["__proto__","constructor","prototype"],p={allowBooleanAttributes:!1,unpairedTags:[]};function m(s,i){i=Object.assign({},p,i);let h=[],l=!1,f=!1;s[0]==="\uFEFF"&&(s=s.substr(1));for(let u=0;u<s.length;u++)if(s[u]==="<"&&s[u+1]==="?"){if(u+=2,u=y(s,u),u.err)return u}else{if(s[u]!=="<"){if(E(s[u]))continue;return D("InvalidChar","char '"+s[u]+"' is not expected.",X(s,u))}{let N=u;if(u++,s[u]==="!"){u=b(s,u);continue}{let g=!1;s[u]==="/"&&(g=!0,u++);let w="";for(;u<s.length&&s[u]!==">"&&s[u]!==" "&&s[u]!=="\t"&&s[u]!==`
15
+ `&&s[u]!=="\r";u++)w+=s[u];if(w=w.trim(),w[w.length-1]==="/"&&(w=w.substring(0,w.length-1),u--),!pt(w)){let T;return T=w.trim().length===0?"Invalid space after '<'.":"Tag '"+w+"' is an invalid name.",D("InvalidTag",T,X(s,u))}let x=P(s,u);if(x===!1)return D("InvalidAttr","Attributes for '"+w+"' have open quote.",X(s,u));let A=x.value;if(u=x.index,A[A.length-1]==="/"){let T=u-A.length;A=A.substring(0,A.length-1);let z=k(A,i);if(z!==!0)return D(z.err.code,z.err.msg,X(s,T+z.err.line));l=!0}else if(g){if(!x.tagClosed)return D("InvalidTag","Closing tag '"+w+"' doesn't have proper closing.",X(s,u));if(A.trim().length>0)return D("InvalidTag","Closing tag '"+w+"' can't have attributes or invalid starting.",X(s,N));if(h.length===0)return D("InvalidTag","Closing tag '"+w+"' has not been opened.",X(s,N));{let T=h.pop();if(w!==T.tagName){let z=X(s,T.tagStartPos);return D("InvalidTag","Expected closing tag '"+T.tagName+"' (opened in line "+z.line+", col "+z.col+") instead of closing tag '"+w+"'.",X(s,N))}h.length==0&&(f=!0)}}else{let T=k(A,i);if(T!==!0)return D(T.err.code,T.err.msg,X(s,u-A.length+T.err.line));if(f===!0)return D("InvalidXml","Multiple possible root nodes found.",X(s,u));i.unpairedTags.indexOf(w)!==-1||h.push({tagName:w,tagStartPos:N}),l=!0}for(u++;u<s.length;u++)if(s[u]==="<"){if(s[u+1]==="!"){u++,u=b(s,u);continue}if(s[u+1]!=="?")break;if(u=y(s,++u),u.err)return u}else if(s[u]==="&"){let T=Z(s,u);if(T==-1)return D("InvalidChar","char '&' is not expected.",X(s,u));u=T}else if(f===!0&&!E(s[u]))return D("InvalidXml","Extra text at the end",X(s,u));s[u]==="<"&&u--}}}return l?h.length==1?D("InvalidTag","Unclosed tag '"+h[0].tagName+"'.",X(s,h[0].tagStartPos)):!(h.length>0)||D("InvalidXml","Invalid '"+JSON.stringify(h.map((u)=>u.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):D("InvalidXml","Start tag expected.",1)}function E(s){return s===" "||s==="\t"||s===`
16
+ `||s==="\r"}function y(s,i){let h=i;for(;i<s.length;i++)if(s[i]=="?"||s[i]==" "){let l=s.substr(h,i-h);if(i>5&&l==="xml")return D("InvalidXml","XML declaration allowed only at the start of the document.",X(s,i));if(s[i]=="?"&&s[i+1]==">"){i++;break}continue}return i}function b(s,i){if(s.length>i+5&&s[i+1]==="-"&&s[i+2]==="-"){for(i+=3;i<s.length;i++)if(s[i]==="-"&&s[i+1]==="-"&&s[i+2]===">"){i+=2;break}}else if(s.length>i+8&&s[i+1]==="D"&&s[i+2]==="O"&&s[i+3]==="C"&&s[i+4]==="T"&&s[i+5]==="Y"&&s[i+6]==="P"&&s[i+7]==="E"){let h=1;for(i+=8;i<s.length;i++)if(s[i]==="<")h++;else if(s[i]===">"&&(h--,h===0))break}else if(s.length>i+9&&s[i+1]==="["&&s[i+2]==="C"&&s[i+3]==="D"&&s[i+4]==="A"&&s[i+5]==="T"&&s[i+6]==="A"&&s[i+7]==="["){for(i+=8;i<s.length;i++)if(s[i]==="]"&&s[i+1]==="]"&&s[i+2]===">"){i+=2;break}}return i}let S='"',I="'";function P(s,i){let h="",l="",f=!1;for(;i<s.length;i++){if(s[i]===S||s[i]===I)l===""?l=s[i]:l!==s[i]||(l="");else if(s[i]===">"&&l===""){f=!0;break}h+=s[i]}return l===""&&{value:h,index:i,tagClosed:f}}let F=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function k(s,i){let h=a(s,F),l={};for(let f=0;f<h.length;f++){if(h[f][1].length===0)return D("InvalidAttr","Attribute '"+h[f][2]+"' has no space in starting.",Y(h[f]));if(h[f][3]!==void 0&&h[f][4]===void 0)return D("InvalidAttr","Attribute '"+h[f][2]+"' is without value.",Y(h[f]));if(h[f][3]===void 0&&!i.allowBooleanAttributes)return D("InvalidAttr","boolean attribute '"+h[f][2]+"' is not allowed.",Y(h[f]));let u=h[f][2];if(!ge(u))return D("InvalidAttr","Attribute '"+u+"' is an invalid name.",Y(h[f]));if(Object.prototype.hasOwnProperty.call(l,u))return D("InvalidAttr","Attribute '"+u+"' is repeated.",Y(h[f]));l[u]=1}return!0}function Z(s,i){if(s[++i]===";")return-1;if(s[i]==="#")return function(l,f){let u=/\d/;for(l[f]==="x"&&(f++,u=/[\da-fA-F]/);f<l.length;f++){if(l[f]===";")return f;if(!l[f].match(u))break}return-1}(s,++i);let h=0;for(;i<s.length;i++,h++)if(!(s[i].match(/\w/)&&h<20)){if(s[i]===";")break;return-1}return i}function D(s,i,h){return{err:{code:s,msg:i,line:h.line||h,col:h.col}}}function ge(s){return o(s)}function pt(s){return o(s)}function X(s,i){let h=s.substring(0,i).split(/\r?\n/);return{line:h.length,col:h[h.length-1].length+1}}function Y(s){return s.startIndex+s[1].length}let As=(s)=>c.includes(s)?"__"+s:s,zn={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(s,i){return i},attributeValueProcessor:function(s,i){return i},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(s,i,h){return s},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:As};function Un(s,i){if(typeof s!="string")return;let h=s.toLowerCase();if(c.some((l)=>h===l.toLowerCase()))throw Error(`[SECURITY] Invalid ${i}: "${s}" is a reserved JavaScript keyword that could cause prototype pollution`);if(d.some((l)=>h===l.toLowerCase()))throw Error(`[SECURITY] Invalid ${i}: "${s}" is a reserved JavaScript keyword that could cause prototype pollution`)}function _s(s){return typeof s=="boolean"?{enabled:s,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1000,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:typeof s=="object"&&s!==null?{enabled:s.enabled!==!1,maxEntitySize:Math.max(1,s.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,s.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,s.maxTotalExpansions??1000),maxExpandedLength:Math.max(1,s.maxExpandedLength??1e5),maxEntityCount:Math.max(1,s.maxEntityCount??100),allowedTags:s.allowedTags??null,tagFilter:s.tagFilter??null}:_s(!0)}let Ln=function(s){let i=Object.assign({},zn,s),h=[{value:i.attributeNamePrefix,name:"attributeNamePrefix"},{value:i.attributesGroupName,name:"attributesGroupName"},{value:i.textNodeName,name:"textNodeName"},{value:i.cdataPropName,name:"cdataPropName"},{value:i.commentPropName,name:"commentPropName"}];for(let{value:l,name:f}of h)l&&Un(l,f);return i.onDangerousProperty===null&&(i.onDangerousProperty=As),i.processEntities=_s(i.processEntities),i.stopNodes&&Array.isArray(i.stopNodes)&&(i.stopNodes=i.stopNodes.map((l)=>typeof l=="string"&&l.startsWith("*.")?".."+l.substring(2):l)),i},gt;gt=typeof Symbol!="function"?"@@xmlMetadata":Symbol("XML Node Metadata");class se{constructor(s){this.tagname=s,this.child=[],this[":@"]=Object.create(null)}add(s,i){s==="__proto__"&&(s="#__proto__"),this.child.push({[s]:i})}addChild(s,i){s.tagname==="__proto__"&&(s.tagname="#__proto__"),s[":@"]&&Object.keys(s[":@"]).length>0?this.child.push({[s.tagname]:s.child,":@":s[":@"]}):this.child.push({[s.tagname]:s.child}),i!==void 0&&(this.child[this.child.length-1][gt]={startIndex:i})}static getMetaDataSymbol(){return gt}}class Cs{constructor(s){this.suppressValidationErr=!s,this.options=s}readDocType(s,i){let h=Object.create(null),l=0;if(s[i+3]!=="O"||s[i+4]!=="C"||s[i+5]!=="T"||s[i+6]!=="Y"||s[i+7]!=="P"||s[i+8]!=="E")throw Error("Invalid Tag instead of DOCTYPE");{i+=9;let f=1,u=!1,N=!1,g="";for(;i<s.length;i++)if(s[i]!=="<"||N)if(s[i]===">"){if(N?s[i-1]==="-"&&s[i-2]==="-"&&(N=!1,f--):f--,f===0)break}else s[i]==="["?u=!0:g+=s[i];else{if(u&&me(s,"!ENTITY",i)){let w,x;if(i+=7,[w,x,i]=this.readEntityExp(s,i+1,this.suppressValidationErr),x.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&l>=this.options.maxEntityCount)throw Error(`Entity count (${l+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);let A=w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");h[w]={regx:RegExp(`&${A};`,"g"),val:x},l++}}else if(u&&me(s,"!ELEMENT",i)){i+=8;let{index:w}=this.readElementExp(s,i+1);i=w}else if(u&&me(s,"!ATTLIST",i))i+=8;else if(u&&me(s,"!NOTATION",i)){i+=9;let{index:w}=this.readNotationExp(s,i+1,this.suppressValidationErr);i=w}else{if(!me(s,"!--",i))throw Error("Invalid DOCTYPE");N=!0}f++,g=""}if(f!==0)throw Error("Unclosed DOCTYPE")}return{entities:h,i}}readEntityExp(s,i){let h=i=j(s,i);for(;i<s.length&&!/\s/.test(s[i])&&s[i]!=='"'&&s[i]!=="'";)i++;let l=s.substring(h,i);if(De(l),i=j(s,i),!this.suppressValidationErr){if(s.substring(i,i+6).toUpperCase()==="SYSTEM")throw Error("External entities are not supported");if(s[i]==="%")throw Error("Parameter entities are not supported")}let f="";if([i,f]=this.readIdentifierVal(s,i,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&f.length>this.options.maxEntitySize)throw Error(`Entity "${l}" size (${f.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[l,f,--i]}readNotationExp(s,i){let h=i=j(s,i);for(;i<s.length&&!/\s/.test(s[i]);)i++;let l=s.substring(h,i);!this.suppressValidationErr&&De(l),i=j(s,i);let f=s.substring(i,i+6).toUpperCase();if(!this.suppressValidationErr&&f!=="SYSTEM"&&f!=="PUBLIC")throw Error(`Expected SYSTEM or PUBLIC, found "${f}"`);i+=f.length,i=j(s,i);let u=null,N=null;if(f==="PUBLIC")[i,u]=this.readIdentifierVal(s,i,"publicIdentifier"),s[i=j(s,i)]!=='"'&&s[i]!=="'"||([i,N]=this.readIdentifierVal(s,i,"systemIdentifier"));else if(f==="SYSTEM"&&([i,N]=this.readIdentifierVal(s,i,"systemIdentifier"),!this.suppressValidationErr&&!N))throw Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:l,publicIdentifier:u,systemIdentifier:N,index:--i}}readIdentifierVal(s,i,h){let l="",f=s[i];if(f!=='"'&&f!=="'")throw Error(`Expected quoted string, found "${f}"`);let u=++i;for(;i<s.length&&s[i]!==f;)i++;if(l=s.substring(u,i),s[i]!==f)throw Error(`Unterminated ${h} value`);return[++i,l]}readElementExp(s,i){let h=i=j(s,i);for(;i<s.length&&!/\s/.test(s[i]);)i++;let l=s.substring(h,i);if(!this.suppressValidationErr&&!o(l))throw Error(`Invalid element name: "${l}"`);let f="";if(s[i=j(s,i)]==="E"&&me(s,"MPTY",i))i+=4;else if(s[i]==="A"&&me(s,"NY",i))i+=2;else if(s[i]==="("){let u=++i;for(;i<s.length&&s[i]!==")";)i++;if(f=s.substring(u,i),s[i]!==")")throw Error("Unterminated content model")}else if(!this.suppressValidationErr)throw Error(`Invalid Element Expression, found "${s[i]}"`);return{elementName:l,contentModel:f.trim(),index:i}}readAttlistExp(s,i){let h=i=j(s,i);for(;i<s.length&&!/\s/.test(s[i]);)i++;let l=s.substring(h,i);for(De(l),h=i=j(s,i);i<s.length&&!/\s/.test(s[i]);)i++;let f=s.substring(h,i);if(!De(f))throw Error(`Invalid attribute name: "${f}"`);i=j(s,i);let u="";if(s.substring(i,i+8).toUpperCase()==="NOTATION"){if(u="NOTATION",s[i=j(s,i+=8)]!=="(")throw Error(`Expected '(', found "${s[i]}"`);i++;let g=[];for(;i<s.length&&s[i]!==")";){let w=i;for(;i<s.length&&s[i]!=="|"&&s[i]!==")";)i++;let x=s.substring(w,i);if(x=x.trim(),!De(x))throw Error(`Invalid notation name: "${x}"`);g.push(x),s[i]==="|"&&(i++,i=j(s,i))}if(s[i]!==")")throw Error("Unterminated list of notations");i++,u+=" ("+g.join("|")+")"}else{let g=i;for(;i<s.length&&!/\s/.test(s[i]);)i++;u+=s.substring(g,i);let w=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!w.includes(u.toUpperCase()))throw Error(`Invalid attribute type: "${u}"`)}i=j(s,i);let N="";return s.substring(i,i+8).toUpperCase()==="#REQUIRED"?(N="#REQUIRED",i+=8):s.substring(i,i+7).toUpperCase()==="#IMPLIED"?(N="#IMPLIED",i+=7):[i,N]=this.readIdentifierVal(s,i,"ATTLIST"),{elementName:l,attributeName:f,attributeType:u,defaultValue:N,index:i}}}let j=(s,i)=>{for(;i<s.length&&/\s/.test(s[i]);)i++;return i};function me(s,i,h){for(let l=0;l<i.length;l++)if(i[l]!==s[h+l+1])return!1;return!0}function De(s){if(o(s))return s;throw Error(`Invalid entity name ${s}`)}let Rn=/^[-+]?0x[a-fA-F0-9]+$/,Bn=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,qn={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"},Hn=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/,kn=new Set(["push","pop","reset","updateCurrent","restore"]);class Qe{constructor(s={}){this.separator=s.separator||".",this.path=[],this.siblingStacks=[]}push(s,i=null,h=null){this.path.length>0&&(this.path[this.path.length-1].values=void 0);let l=this.path.length;this.siblingStacks[l]||(this.siblingStacks[l]=new Map);let f=this.siblingStacks[l],u=h?`${h}:${s}`:s,N=f.get(u)||0,g=0;for(let x of f.values())g+=x;f.set(u,N+1);let w={tag:s,position:g,counter:N};h!=null&&(w.namespace=h),i!=null&&(w.values=i),this.path.push(w)}pop(){if(this.path.length===0)return;let s=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),s}updateCurrent(s){if(this.path.length>0){let i=this.path[this.path.length-1];s!=null&&(i.values=s)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(s){if(this.path.length===0)return;return this.path[this.path.length-1].values?.[s]}hasAttr(s){if(this.path.length===0)return!1;let i=this.path[this.path.length-1];return i.values!==void 0&&s in i.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(s,i=!0){let h=s||this.separator;return this.path.map((l)=>i&&l.namespace?`${l.namespace}:${l.tag}`:l.tag).join(h)}toArray(){return this.path.map((s)=>s.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(s){let i=s.segments;return i.length!==0&&(s.hasDeepWildcard()?this._matchWithDeepWildcard(i):this._matchSimple(i))}_matchSimple(s){if(this.path.length!==s.length)return!1;for(let i=0;i<s.length;i++){let h=s[i],l=this.path[i],f=i===this.path.length-1;if(!this._matchSegment(h,l,f))return!1}return!0}_matchWithDeepWildcard(s){let i=this.path.length-1,h=s.length-1;for(;h>=0&&i>=0;){let l=s[h];if(l.type==="deep-wildcard"){if(h--,h<0)return!0;let f=s[h],u=!1;for(let N=i;N>=0;N--){let g=N===this.path.length-1;if(this._matchSegment(f,this.path[N],g)){i=N-1,h--,u=!0;break}}if(!u)return!1}else{let f=i===this.path.length-1;if(!this._matchSegment(l,this.path[i],f))return!1;i--,h--}}return h<0}_matchSegment(s,i,h){if(s.tag!=="*"&&s.tag!==i.tag)return!1;if(s.namespace!==void 0&&s.namespace!=="*"&&s.namespace!==i.namespace)return!1;if(s.attrName!==void 0){if(!h)return!1;if(!i.values||!(s.attrName in i.values))return!1;if(s.attrValue!==void 0){let l=i.values[s.attrName];if(String(l)!==String(s.attrValue))return!1}}if(s.position!==void 0){if(!h)return!1;let l=i.counter??0;if(s.position==="first"&&l!==0)return!1;if(s.position==="odd"&&l%2!=1)return!1;if(s.position==="even"&&l%2!=0)return!1;if(s.position==="nth"&&l!==s.positionValue)return!1}return!0}snapshot(){return{path:this.path.map((s)=>({...s})),siblingStacks:this.siblingStacks.map((s)=>new Map(s))}}restore(s){this.path=s.path.map((i)=>({...i})),this.siblingStacks=s.siblingStacks.map((i)=>new Map(i))}readOnly(){return new Proxy(this,{get(s,i,h){if(kn.has(i))return()=>{throw TypeError(`Cannot call '${i}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};let l=Reflect.get(s,i,h);return i==="path"||i==="siblingStacks"?Object.freeze(Array.isArray(l)?l.map((f)=>f instanceof Map?Object.freeze(new Map(f)):Object.freeze({...f})):l):typeof l=="function"?l.bind(s):l},set(s,i){throw TypeError(`Cannot set property '${String(i)}' on a read-only Matcher.`)},deleteProperty(s,i){throw TypeError(`Cannot delete property '${String(i)}' from a read-only Matcher.`)}})}}class we{constructor(s,i={}){this.pattern=s,this.separator=i.separator||".",this.segments=this._parse(s),this._hasDeepWildcard=this.segments.some((h)=>h.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some((h)=>h.attrName!==void 0),this._hasPositionSelector=this.segments.some((h)=>h.position!==void 0)}_parse(s){let i=[],h=0,l="";for(;h<s.length;)s[h]===this.separator?h+1<s.length&&s[h+1]===this.separator?(l.trim()&&(i.push(this._parseSegment(l.trim())),l=""),i.push({type:"deep-wildcard"}),h+=2):(l.trim()&&i.push(this._parseSegment(l.trim())),l="",h++):(l+=s[h],h++);return l.trim()&&i.push(this._parseSegment(l.trim())),i}_parseSegment(s){let i={type:"tag"},h=null,l=s,f=s.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(f&&(l=f[1]+f[3],f[2])){let x=f[2].slice(1,-1);x&&(h=x)}let u,N,g=l;if(l.includes("::")){let x=l.indexOf("::");if(u=l.substring(0,x).trim(),g=l.substring(x+2).trim(),!u)throw Error(`Invalid namespace in pattern: ${s}`)}let w=null;if(g.includes(":")){let x=g.lastIndexOf(":"),A=g.substring(0,x).trim(),T=g.substring(x+1).trim();["first","last","odd","even"].includes(T)||/^nth\(\d+\)$/.test(T)?(N=A,w=T):N=g}else N=g;if(!N)throw Error(`Invalid segment pattern: ${s}`);if(i.tag=N,u&&(i.namespace=u),h)if(h.includes("=")){let x=h.indexOf("=");i.attrName=h.substring(0,x).trim(),i.attrValue=h.substring(x+1).trim()}else i.attrName=h.trim();if(w){let x=w.match(/^nth\((\d+)\)$/);x?(i.position="nth",i.positionValue=parseInt(x[1],10)):i.position=w}return i}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}function Xn(s,i){if(!s)return{};let h=i.attributesGroupName?s[i.attributesGroupName]:s;if(!h)return{};let l={};for(let f in h)f.startsWith(i.attributeNamePrefix)?l[f.substring(i.attributeNamePrefix.length)]=h[f]:l[f]=h[f];return l}function Gn(s){if(!s||typeof s!="string")return;let i=s.indexOf(":");if(i!==-1&&i>0){let h=s.substring(0,i);if(h!=="xmlns")return h}}class $s{constructor(s){var i;if(this.options=s,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(h,l)=>Os(l,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(h,l)=>Os(l,16,"&#x")}},this.addExternalEntities=Vn,this.parseXml=Kn,this.parseTextData=Qn,this.resolveNameSpace=Fn,this.buildAttributesMap=jn,this.isItStopNode=vn,this.replaceEntitiesValue=Zn,this.readStopNodeData=eo,this.saveTextToParentTag=Yn,this.addChild=Jn,this.ignoreAttributesFn=typeof(i=this.options.ignoreAttributes)=="function"?i:Array.isArray(i)?(h)=>{for(let l of i){if(typeof l=="string"&&h===l)return!0;if(l instanceof RegExp&&l.test(h))return!0}}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new Qe,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let h=0;h<this.options.stopNodes.length;h++){let l=this.options.stopNodes[h];typeof l=="string"?this.stopNodeExpressions.push(new we(l)):l instanceof we&&this.stopNodeExpressions.push(l)}}}}function Vn(s){let i=Object.keys(s);for(let h=0;h<i.length;h++){let l=i[h],f=l.replace(/[.\-+*:]/g,"\\.");this.lastEntities[l]={regex:new RegExp("&"+f+";","g"),val:s[l]}}}function Qn(s,i,h,l,f,u,N){if(s!==void 0&&(this.options.trimValues&&!l&&(s=s.trim()),s.length>0)){N||(s=this.replaceEntitiesValue(s,i,h));let g=this.options.jPath?h.toString():h,w=this.options.tagValueProcessor(i,s,g,f,u);return w==null?s:typeof w!=typeof s||w!==s?w:this.options.trimValues||s.trim()===s?Ms(s,this.options.parseTagValue,this.options.numberParseOptions):s}}function Fn(s){if(this.options.removeNSPrefix){let i=s.split(":"),h=s.charAt(0)==="/"?"/":"";if(i[0]==="xmlns")return"";i.length===2&&(s=h+i[1])}return s}let Wn=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function jn(s,i,h){if(this.options.ignoreAttributes!==!0&&typeof s=="string"){let l=a(s,Wn),f=l.length,u={},N={};for(let g=0;g<f;g++){let w=this.resolveNameSpace(l[g][1]),x=l[g][4];if(w.length&&x!==void 0){let A=x;this.options.trimValues&&(A=A.trim()),A=this.replaceEntitiesValue(A,h,this.readonlyMatcher),N[w]=A}}Object.keys(N).length>0&&typeof i=="object"&&i.updateCurrent&&i.updateCurrent(N);for(let g=0;g<f;g++){let w=this.resolveNameSpace(l[g][1]),x=this.options.jPath?i.toString():this.readonlyMatcher;if(this.ignoreAttributesFn(w,x))continue;let A=l[g][4],T=this.options.attributeNamePrefix+w;if(w.length)if(this.options.transformAttributeName&&(T=this.options.transformAttributeName(T)),T=Is(T,this.options),A!==void 0){this.options.trimValues&&(A=A.trim()),A=this.replaceEntitiesValue(A,h,this.readonlyMatcher);let z=this.options.jPath?i.toString():this.readonlyMatcher,$=this.options.attributeValueProcessor(w,A,z);u[T]=$==null?A:typeof $!=typeof A||$!==A?$:Ms(A,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(u[T]=!0)}if(!Object.keys(u).length)return;if(this.options.attributesGroupName){let g={};return g[this.options.attributesGroupName]=u,g}return u}}let Kn=function(s){s=s.replace(/\r\n?/g,`
17
+ `);let i=new se("!xml"),h=i,l="";this.matcher.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let f=new Cs(this.options.processEntities);for(let u=0;u<s.length;u++)if(s[u]==="<")if(s[u+1]==="/"){let N=Ee(s,">",u,"Closing Tag is not closed."),g=s.substring(u+2,N).trim();if(this.options.removeNSPrefix){let x=g.indexOf(":");x!==-1&&(g=g.substr(x+1))}g=wt(this.options.transformTagName,g,"",this.options).tagName,h&&(l=this.saveTextToParentTag(l,h,this.readonlyMatcher));let w=this.matcher.getCurrentTag();if(g&&this.options.unpairedTags.indexOf(g)!==-1)throw Error(`Unpaired tag can not be used as closing tag: </${g}>`);w&&this.options.unpairedTags.indexOf(w)!==-1&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,h=this.tagsNodeStack.pop(),l="",u=N}else if(s[u+1]==="?"){let N=mt(s,u,!1,"?>");if(!N)throw Error("Pi Tag is not closed.");if(l=this.saveTextToParentTag(l,h,this.readonlyMatcher),this.options.ignoreDeclaration&&N.tagName==="?xml"||this.options.ignorePiTags);else{let g=new se(N.tagName);g.add(this.options.textNodeName,""),N.tagName!==N.tagExp&&N.attrExpPresent&&(g[":@"]=this.buildAttributesMap(N.tagExp,this.matcher,N.tagName)),this.addChild(h,g,this.readonlyMatcher,u)}u=N.closeIndex+1}else if(s.substr(u+1,3)==="!--"){let N=Ee(s,"-->",u+4,"Comment is not closed.");if(this.options.commentPropName){let g=s.substring(u+4,N-2);l=this.saveTextToParentTag(l,h,this.readonlyMatcher),h.add(this.options.commentPropName,[{[this.options.textNodeName]:g}])}u=N}else if(s.substr(u+1,2)==="!D"){let N=f.readDocType(s,u);this.docTypeEntities=N.entities,u=N.i}else if(s.substr(u+1,2)==="!["){let N=Ee(s,"]]>",u,"CDATA is not closed.")-2,g=s.substring(u+9,N);l=this.saveTextToParentTag(l,h,this.readonlyMatcher);let w=this.parseTextData(g,h.tagname,this.readonlyMatcher,!0,!1,!0,!0);w==null&&(w=""),this.options.cdataPropName?h.add(this.options.cdataPropName,[{[this.options.textNodeName]:g}]):h.add(this.options.textNodeName,w),u=N+2}else{let N=mt(s,u,this.options.removeNSPrefix);if(!N){let K=s.substring(Math.max(0,u-50),Math.min(s.length,u+50));throw Error(`readTagExp returned undefined at position ${u}. Context: "${K}"`)}let{tagName:g,rawTagName:w,tagExp:x,attrExpPresent:A,closeIndex:T}=N;if({tagName:g,tagExp:x}=wt(this.options.transformTagName,g,x,this.options),this.options.strictReservedNames&&(g===this.options.commentPropName||g===this.options.cdataPropName||g===this.options.textNodeName||g===this.options.attributesGroupName))throw Error(`Invalid tag name: ${g}`);h&&l&&h.tagname!=="!xml"&&(l=this.saveTextToParentTag(l,h,this.readonlyMatcher,!1));let z=h;z&&this.options.unpairedTags.indexOf(z.tagname)!==-1&&(h=this.tagsNodeStack.pop(),this.matcher.pop());let $=!1;x.length>0&&x.lastIndexOf("/")===x.length-1&&($=!0,g[g.length-1]==="/"?(g=g.substr(0,g.length-1),x=g):x=x.substr(0,x.length-1),A=g!==x);let O,U=null,v={};O=Gn(w),g!==i.tagname&&this.matcher.push(g,{},O),g!==x&&A&&(U=this.buildAttributesMap(x,this.matcher,g),U&&(v=Xn(U,this.options))),g!==i.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));let G=u;if(this.isCurrentNodeStopNode){let K="";if($)u=N.closeIndex;else if(this.options.unpairedTags.indexOf(g)!==-1)u=N.closeIndex;else{let yt=this.readStopNodeData(s,w,T+1);if(!yt)throw Error(`Unexpected end of ${w}`);u=yt.i,K=yt.tagContent}let xt=new se(g);U&&(xt[":@"]=U),xt.add(this.options.textNodeName,K),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(h,xt,this.readonlyMatcher,G)}else{if($){({tagName:g,tagExp:x}=wt(this.options.transformTagName,g,x,this.options));let K=new se(g);U&&(K[":@"]=U),this.addChild(h,K,this.readonlyMatcher,G),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(this.options.unpairedTags.indexOf(g)!==-1){let K=new se(g);U&&(K[":@"]=U),this.addChild(h,K,this.readonlyMatcher,G),this.matcher.pop(),this.isCurrentNodeStopNode=!1,u=N.closeIndex;continue}{let K=new se(g);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw Error("Maximum nested tags exceeded");this.tagsNodeStack.push(h),U&&(K[":@"]=U),this.addChild(h,K,this.readonlyMatcher,G),h=K}}l="",u=T}}else l+=s[u];return i.child};function Jn(s,i,h,l){this.options.captureMetaData||(l=void 0);let f=this.options.jPath?h.toString():h,u=this.options.updateTag(i.tagname,f,i[":@"]);u===!1||(typeof u=="string"?(i.tagname=u,s.addChild(i,l)):s.addChild(i,l))}function Zn(s,i,h){let l=this.options.processEntities;if(!l||!l.enabled)return s;if(l.allowedTags){let f=this.options.jPath?h.toString():h;if(!(Array.isArray(l.allowedTags)?l.allowedTags.includes(i):l.allowedTags(i,f)))return s}if(l.tagFilter){let f=this.options.jPath?h.toString():h;if(!l.tagFilter(i,f))return s}for(let f of Object.keys(this.docTypeEntities)){let u=this.docTypeEntities[f],N=s.match(u.regx);if(N){if(this.entityExpansionCount+=N.length,l.maxTotalExpansions&&this.entityExpansionCount>l.maxTotalExpansions)throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${l.maxTotalExpansions}`);let g=s.length;if(s=s.replace(u.regx,u.val),l.maxExpandedLength&&(this.currentExpandedLength+=s.length-g,this.currentExpandedLength>l.maxExpandedLength))throw Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${l.maxExpandedLength}`)}}for(let f of Object.keys(this.lastEntities)){let u=this.lastEntities[f],N=s.match(u.regex);if(N&&(this.entityExpansionCount+=N.length,l.maxTotalExpansions&&this.entityExpansionCount>l.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${l.maxTotalExpansions}`);s=s.replace(u.regex,u.val)}if(s.indexOf("&")===-1)return s;if(this.options.htmlEntities)for(let f of Object.keys(this.htmlEntities)){let u=this.htmlEntities[f],N=s.match(u.regex);if(N&&(this.entityExpansionCount+=N.length,l.maxTotalExpansions&&this.entityExpansionCount>l.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${l.maxTotalExpansions}`);s=s.replace(u.regex,u.val)}return s.replace(this.ampEntity.regex,this.ampEntity.val)}function Yn(s,i,h,l){return s&&(l===void 0&&(l=i.child.length===0),(s=this.parseTextData(s,i.tagname,h,!1,!!i[":@"]&&Object.keys(i[":@"]).length!==0,l))!==void 0&&s!==""&&i.add(this.options.textNodeName,s),s=""),s}function vn(s,i){if(!s||s.length===0)return!1;for(let h=0;h<s.length;h++)if(i.matches(s[h]))return!0;return!1}function Ee(s,i,h,l){let f=s.indexOf(i,h);if(f===-1)throw Error(l);return f+i.length-1}function mt(s,i,h,l=">"){let f=function(T,z,$=">"){let O,U="";for(let v=z;v<T.length;v++){let G=T[v];if(O)G===O&&(O="");else if(G==='"'||G==="'")O=G;else if(G===$[0]){if(!$[1])return{data:U,index:v};if(T[v+1]===$[1])return{data:U,index:v}}else G==="\t"&&(G=" ");U+=G}}(s,i+1,l);if(!f)return;let{data:u,index:N}=f,g=u.search(/\s/),w=u,x=!0;g!==-1&&(w=u.substring(0,g),u=u.substring(g+1).trimStart());let A=w;if(h){let T=w.indexOf(":");T!==-1&&(w=w.substr(T+1),x=w!==f.data.substr(T+1))}return{tagName:w,tagExp:u,closeIndex:N,attrExpPresent:x,rawTagName:A}}function eo(s,i,h){let l=h,f=1;for(;h<s.length;h++)if(s[h]==="<")if(s[h+1]==="/"){let u=Ee(s,">",h,`${i} is not closed`);if(s.substring(h+2,u).trim()===i&&(f--,f===0))return{tagContent:s.substring(l,h),i:u};h=u}else if(s[h+1]==="?")h=Ee(s,"?>",h+1,"StopNode is not closed.");else if(s.substr(h+1,3)==="!--")h=Ee(s,"-->",h+3,"StopNode is not closed.");else if(s.substr(h+1,2)==="![")h=Ee(s,"]]>",h,"StopNode is not closed.")-2;else{let u=mt(s,h,">");u&&((u&&u.tagName)===i&&u.tagExp[u.tagExp.length-1]!=="/"&&f++,h=u.closeIndex)}}function Ms(s,i,h){if(i&&typeof s=="string"){let l=s.trim();return l==="true"||l!=="false"&&function(f,u={}){if(u=Object.assign({},qn,u),!f||typeof f!="string")return f;let N=f.trim();if(u.skipLike!==void 0&&u.skipLike.test(N))return f;if(f==="0")return 0;if(u.hex&&Rn.test(N))return function(w){if(parseInt)return parseInt(w,16);if(Number.parseInt)return Number.parseInt(w,16);if(window&&window.parseInt)return window.parseInt(w,16);throw Error("parseInt, Number.parseInt, window.parseInt are not supported")}(N);if(isFinite(N)){if(N.includes("e")||N.includes("E"))return function(w,x,A){if(!A.eNotation)return w;let T=x.match(Hn);if(T){let z=T[1]||"",$=T[3].indexOf("e")===-1?"E":"e",O=T[2],U=z?w[O.length+1]===$:w[O.length]===$;return O.length>1&&U?w:(O.length!==1||!T[3].startsWith(`.${$}`)&&T[3][0]!==$)&&O.length>0?A.leadingZeros&&!U?(x=(T[1]||"")+T[3],Number(x)):w:Number(x)}return w}(f,N,u);{let w=Bn.exec(N);if(w){let x=w[1]||"",A=w[2],T=(g=w[3])&&g.indexOf(".")!==-1?((g=g.replace(/0+$/,""))==="."?g="0":g[0]==="."?g="0"+g:g[g.length-1]==="."&&(g=g.substring(0,g.length-1)),g):g,z=x?f[A.length+1]===".":f[A.length]===".";if(!u.leadingZeros&&(A.length>1||A.length===1&&!z))return f;{let $=Number(N),O=String($);if($===0)return $;if(O.search(/[eE]/)!==-1)return u.eNotation?$:f;if(N.indexOf(".")!==-1)return O==="0"||O===T||O===`${x}${T}`?$:f;let U=A?T:N;return A?U===O||x+U===O?$:f:U===O||U===x+O?$:f}}return f}}var g;return function(w,x,A){let T=x===1/0;switch(A.infinity.toLowerCase()){case"null":return null;case"infinity":return x;case"string":return T?"Infinity":"-Infinity";default:return w}}(f,Number(N),u)}(s,h)}return s!==void 0?s:""}function Os(s,i,h){let l=Number.parseInt(s,i);return l>=0&&l<=1114111?String.fromCodePoint(l):h+s+";"}function wt(s,i,h,l){if(s){let f=s(i);h===i&&(h=f),i=f}return{tagName:i=Is(i,l),tagExp:h}}function Is(s,i){if(d.includes(s))throw Error(`[SECURITY] Invalid name: "${s}" is a reserved JavaScript keyword that could cause prototype pollution`);return c.includes(s)?i.onDangerousProperty(s):s}let Et=se.getMetaDataSymbol();function to(s,i){if(!s||typeof s!="object")return{};if(!i)return s;let h={};for(let l in s)l.startsWith(i)?h[l.substring(i.length)]=s[l]:h[l]=s[l];return h}function so(s,i,h,l){return Ps(s,i,h,l)}function Ps(s,i,h,l){let f,u={};for(let N=0;N<s.length;N++){let g=s[N],w=ro(g);if(w!==void 0&&w!==i.textNodeName){let x=to(g[":@"]||{},i.attributeNamePrefix);h.push(w,x)}if(w===i.textNodeName)f===void 0?f=g[w]:f+=""+g[w];else{if(w===void 0)continue;if(g[w]){let x=Ps(g[w],i,h,l),A=no(x,i);if(g[":@"]?io(x,g[":@"],l,i):Object.keys(x).length!==1||x[i.textNodeName]===void 0||i.alwaysCreateTextNode?Object.keys(x).length===0&&(i.alwaysCreateTextNode?x[i.textNodeName]="":x=""):x=x[i.textNodeName],g[Et]!==void 0&&typeof x=="object"&&x!==null&&(x[Et]=g[Et]),u[w]!==void 0&&Object.prototype.hasOwnProperty.call(u,w))Array.isArray(u[w])||(u[w]=[u[w]]),u[w].push(x);else{let T=i.jPath?l.toString():l;i.isArray(w,T,A)?u[w]=[x]:u[w]=x}w!==void 0&&w!==i.textNodeName&&h.pop()}}}return typeof f=="string"?f.length>0&&(u[i.textNodeName]=f):f!==void 0&&(u[i.textNodeName]=f),u}function ro(s){let i=Object.keys(s);for(let h=0;h<i.length;h++){let l=i[h];if(l!==":@")return l}}function io(s,i,h,l){if(i){let f=Object.keys(i),u=f.length;for(let N=0;N<u;N++){let g=f[N],w=g.startsWith(l.attributeNamePrefix)?g.substring(l.attributeNamePrefix.length):g,x=l.jPath?h.toString()+"."+w:h;l.isArray(g,x,!0,!0)?s[g]=[i[g]]:s[g]=i[g]}}}function no(s,i){let{textNodeName:h}=i,l=Object.keys(s).length;return l===0||!(l!==1||!s[h]&&typeof s[h]!="boolean"&&s[h]!==0)}class Ds{constructor(s){this.externalEntities={},this.options=Ln(s)}parse(s,i){if(typeof s!="string"&&s.toString)s=s.toString();else if(typeof s!="string")throw Error("XML data is accepted in String or Bytes[] form.");if(i){i===!0&&(i={});let f=m(s,i);if(f!==!0)throw Error(`${f.err.msg}:${f.err.line}:${f.err.col}`)}let h=new $s(this.options);h.addExternalEntities(this.externalEntities);let l=h.parseXml(s);return this.options.preserveOrder||l===void 0?l:so(l,this.options,h.matcher,h.readonlyMatcher)}addEntity(s,i){if(i.indexOf("&")!==-1)throw Error("Entity value can't have '&'");if(s.indexOf("&")!==-1||s.indexOf(";")!==-1)throw Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(i==="&")throw Error("An entity with value '&' is not permitted");this.externalEntities[s]=i}static getMetaDataSymbol(){return se.getMetaDataSymbol()}}function oo(s,i){let h="";i.format&&i.indentBy.length>0&&(h=`
18
+ `);let l=[];if(i.stopNodes&&Array.isArray(i.stopNodes))for(let f=0;f<i.stopNodes.length;f++){let u=i.stopNodes[f];typeof u=="string"?l.push(new we(u)):u instanceof we&&l.push(u)}return zs(s,i,h,new Qe,l)}function zs(s,i,h,l,f){let u="",N=!1;if(i.maxNestedTags&&l.getDepth()>i.maxNestedTags)throw Error("Maximum nested tags exceeded");if(!Array.isArray(s)){if(s!=null){let g=s.toString();return g=Nt(g,i),g}return""}for(let g=0;g<s.length;g++){let w=s[g],x=Ls(w);if(x===void 0)continue;let A=ao(w[":@"],i);l.push(x,A);let T=co(l,f);if(x===i.textNodeName){let U=w[x];T||(U=i.tagValueProcessor(x,U),U=Nt(U,i)),N&&(u+=h),u+=U,N=!1,l.pop();continue}if(x===i.cdataPropName){N&&(u+=h),u+=`<![CDATA[${w[x][0][i.textNodeName]}]]>`,N=!1,l.pop();continue}if(x===i.commentPropName){u+=h+`<!--${w[x][0][i.textNodeName]}-->`,N=!0,l.pop();continue}if(x[0]==="?"){let U=Rs(w[":@"],i,T),v=x==="?xml"?"":h,G=w[x][0][i.textNodeName];G=G.length!==0?" "+G:"",u+=v+`<${x}${G}${U}?>`,N=!0,l.pop();continue}let z=h;z!==""&&(z+=i.indentBy);let $=h+`<${x}${Rs(w[":@"],i,T)}`,O;O=T?Us(w[x],i):zs(w[x],i,z,l,f),i.unpairedTags.indexOf(x)!==-1?i.suppressUnpairedNode?u+=$+">":u+=$+"/>":O&&O.length!==0||!i.suppressEmptyNode?O&&O.endsWith(">")?u+=$+`>${O}${h}</${x}>`:(u+=$+">",O&&h!==""&&(O.includes("/>")||O.includes("</"))?u+=h+i.indentBy+O+h:u+=O,u+=`</${x}>`):u+=$+"/>",N=!0,l.pop()}return u}function ao(s,i){if(!s||i.ignoreAttributes)return null;let h={},l=!1;for(let f in s)Object.prototype.hasOwnProperty.call(s,f)&&(h[f.startsWith(i.attributeNamePrefix)?f.substr(i.attributeNamePrefix.length):f]=s[f],l=!0);return l?h:null}function Us(s,i){if(!Array.isArray(s))return s!=null?s.toString():"";let h="";for(let l=0;l<s.length;l++){let f=s[l],u=Ls(f);if(u===i.textNodeName)h+=f[u];else if(u===i.cdataPropName)h+=f[u][0][i.textNodeName];else if(u===i.commentPropName)h+=f[u][0][i.textNodeName];else{if(u&&u[0]==="?")continue;if(u){let N=ho(f[":@"],i),g=Us(f[u],i);g&&g.length!==0?h+=`<${u}${N}>${g}</${u}>`:h+=`<${u}${N}/>`}}}return h}function ho(s,i){let h="";if(s&&!i.ignoreAttributes)for(let l in s){if(!Object.prototype.hasOwnProperty.call(s,l))continue;let f=s[l];f===!0&&i.suppressBooleanAttributes?h+=` ${l.substr(i.attributeNamePrefix.length)}`:h+=` ${l.substr(i.attributeNamePrefix.length)}="${f}"`}return h}function Ls(s){let i=Object.keys(s);for(let h=0;h<i.length;h++){let l=i[h];if(Object.prototype.hasOwnProperty.call(s,l)&&l!==":@")return l}}function Rs(s,i,h){let l="";if(s&&!i.ignoreAttributes)for(let f in s){if(!Object.prototype.hasOwnProperty.call(s,f))continue;let u;h?u=s[f]:(u=i.attributeValueProcessor(f,s[f]),u=Nt(u,i)),u===!0&&i.suppressBooleanAttributes?l+=` ${f.substr(i.attributeNamePrefix.length)}`:l+=` ${f.substr(i.attributeNamePrefix.length)}="${u}"`}return l}function co(s,i){if(!i||i.length===0)return!1;for(let h=0;h<i.length;h++)if(s.matches(i[h]))return!0;return!1}function Nt(s,i){if(s&&s.length>0&&i.processEntities)for(let h=0;h<i.entities.length;h++){let l=i.entities[h];s=s.replace(l.regex,l.val)}return s}let lo={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(s,i){return i},attributeValueProcessor:function(s,i){return i},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function J(s){if(this.options=Object.assign({},lo,s),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map((h)=>typeof h=="string"&&h.startsWith("*.")?".."+h.substring(2):h)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let h=0;h<this.options.stopNodes.length;h++){let l=this.options.stopNodes[h];typeof l=="string"?this.stopNodeExpressions.push(new we(l)):l instanceof we&&this.stopNodeExpressions.push(l)}var i;this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=typeof(i=this.options.ignoreAttributes)=="function"?i:Array.isArray(i)?(h)=>{for(let l of i){if(typeof l=="string"&&h===l)return!0;if(l instanceof RegExp&&l.test(h))return!0}}:()=>!1,this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=po),this.processTextOrObjNode=uo,this.options.format?(this.indentate=fo,this.tagEndChar=`>
19
+ `,this.newLine=`
20
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function uo(s,i,h,l){let f=this.extractAttributes(s);if(l.push(i,f),this.checkStopNode(l)){let N=this.buildRawContent(s),g=this.buildAttributesForStopNode(s);return l.pop(),this.buildObjectNode(N,i,g,h)}let u=this.j2x(s,h+1,l);return l.pop(),s[this.options.textNodeName]!==void 0&&Object.keys(s).length===1?this.buildTextValNode(s[this.options.textNodeName],i,u.attrStr,h,l):this.buildObjectNode(u.val,i,u.attrStr,h)}function fo(s){return this.options.indentBy.repeat(s)}function po(s){return!(!s.startsWith(this.options.attributeNamePrefix)||s===this.options.textNodeName)&&s.substr(this.attrPrefixLen)}J.prototype.build=function(s){if(this.options.preserveOrder)return oo(s,this.options);{Array.isArray(s)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(s={[this.options.arrayNodeName]:s});let i=new Qe;return this.j2x(s,0,i).val}},J.prototype.j2x=function(s,i,h){let l="",f="";if(this.options.maxNestedTags&&h.getDepth()>=this.options.maxNestedTags)throw Error("Maximum nested tags exceeded");let u=this.options.jPath?h.toString():h,N=this.checkStopNode(h);for(let g in s)if(Object.prototype.hasOwnProperty.call(s,g))if(s[g]===void 0)this.isAttribute(g)&&(f+="");else if(s[g]===null)this.isAttribute(g)||g===this.options.cdataPropName?f+="":g[0]==="?"?f+=this.indentate(i)+"<"+g+"?"+this.tagEndChar:f+=this.indentate(i)+"<"+g+"/"+this.tagEndChar;else if(s[g]instanceof Date)f+=this.buildTextValNode(s[g],g,"",i,h);else if(typeof s[g]!="object"){let w=this.isAttribute(g);if(w&&!this.ignoreAttributesFn(w,u))l+=this.buildAttrPairStr(w,""+s[g],N);else if(!w)if(g===this.options.textNodeName){let x=this.options.tagValueProcessor(g,""+s[g]);f+=this.replaceEntitiesValue(x)}else{h.push(g);let x=this.checkStopNode(h);if(h.pop(),x){let A=""+s[g];f+=A===""?this.indentate(i)+"<"+g+this.closeTag(g)+this.tagEndChar:this.indentate(i)+"<"+g+">"+A+"</"+g+this.tagEndChar}else f+=this.buildTextValNode(s[g],g,"",i,h)}}else if(Array.isArray(s[g])){let w=s[g].length,x="",A="";for(let T=0;T<w;T++){let z=s[g][T];if(z===void 0);else if(z===null)g[0]==="?"?f+=this.indentate(i)+"<"+g+"?"+this.tagEndChar:f+=this.indentate(i)+"<"+g+"/"+this.tagEndChar;else if(typeof z=="object")if(this.options.oneListGroup){h.push(g);let $=this.j2x(z,i+1,h);h.pop(),x+=$.val,this.options.attributesGroupName&&z.hasOwnProperty(this.options.attributesGroupName)&&(A+=$.attrStr)}else x+=this.processTextOrObjNode(z,g,i,h);else if(this.options.oneListGroup){let $=this.options.tagValueProcessor(g,z);$=this.replaceEntitiesValue($),x+=$}else{h.push(g);let $=this.checkStopNode(h);if(h.pop(),$){let O=""+z;x+=O===""?this.indentate(i)+"<"+g+this.closeTag(g)+this.tagEndChar:this.indentate(i)+"<"+g+">"+O+"</"+g+this.tagEndChar}else x+=this.buildTextValNode(z,g,"",i,h)}}this.options.oneListGroup&&(x=this.buildObjectNode(x,g,A,i)),f+=x}else if(this.options.attributesGroupName&&g===this.options.attributesGroupName){let w=Object.keys(s[g]),x=w.length;for(let A=0;A<x;A++)l+=this.buildAttrPairStr(w[A],""+s[g][w[A]],N)}else f+=this.processTextOrObjNode(s[g],g,i,h);return{attrStr:l,val:f}},J.prototype.buildAttrPairStr=function(s,i,h){return h||(i=this.options.attributeValueProcessor(s,""+i),i=this.replaceEntitiesValue(i)),this.options.suppressBooleanAttributes&&i==="true"?" "+s:" "+s+'="'+i+'"'},J.prototype.extractAttributes=function(s){if(!s||typeof s!="object")return null;let i={},h=!1;if(this.options.attributesGroupName&&s[this.options.attributesGroupName]){let l=s[this.options.attributesGroupName];for(let f in l)Object.prototype.hasOwnProperty.call(l,f)&&(i[f.startsWith(this.options.attributeNamePrefix)?f.substring(this.options.attributeNamePrefix.length):f]=l[f],h=!0)}else for(let l in s){if(!Object.prototype.hasOwnProperty.call(s,l))continue;let f=this.isAttribute(l);f&&(i[f]=s[l],h=!0)}return h?i:null},J.prototype.buildRawContent=function(s){if(typeof s=="string")return s;if(typeof s!="object"||s===null)return String(s);if(s[this.options.textNodeName]!==void 0)return s[this.options.textNodeName];let i="";for(let h in s){if(!Object.prototype.hasOwnProperty.call(s,h))continue;if(this.isAttribute(h))continue;if(this.options.attributesGroupName&&h===this.options.attributesGroupName)continue;let l=s[h];if(h===this.options.textNodeName)i+=l;else if(Array.isArray(l)){for(let f of l)if(typeof f=="string"||typeof f=="number")i+=`<${h}>${f}</${h}>`;else if(typeof f=="object"&&f!==null){let u=this.buildRawContent(f),N=this.buildAttributesForStopNode(f);i+=u===""?`<${h}${N}/>`:`<${h}${N}>${u}</${h}>`}}else if(typeof l=="object"&&l!==null){let f=this.buildRawContent(l),u=this.buildAttributesForStopNode(l);i+=f===""?`<${h}${u}/>`:`<${h}${u}>${f}</${h}>`}else i+=`<${h}>${l}</${h}>`}return i},J.prototype.buildAttributesForStopNode=function(s){if(!s||typeof s!="object")return"";let i="";if(this.options.attributesGroupName&&s[this.options.attributesGroupName]){let h=s[this.options.attributesGroupName];for(let l in h){if(!Object.prototype.hasOwnProperty.call(h,l))continue;let f=l.startsWith(this.options.attributeNamePrefix)?l.substring(this.options.attributeNamePrefix.length):l,u=h[l];u===!0&&this.options.suppressBooleanAttributes?i+=" "+f:i+=" "+f+'="'+u+'"'}}else for(let h in s){if(!Object.prototype.hasOwnProperty.call(s,h))continue;let l=this.isAttribute(h);if(l){let f=s[h];f===!0&&this.options.suppressBooleanAttributes?i+=" "+l:i+=" "+l+'="'+f+'"'}}return i},J.prototype.buildObjectNode=function(s,i,h,l){if(s==="")return i[0]==="?"?this.indentate(l)+"<"+i+h+"?"+this.tagEndChar:this.indentate(l)+"<"+i+h+this.closeTag(i)+this.tagEndChar;{let f="</"+i+this.tagEndChar,u="";return i[0]==="?"&&(u="?",f=""),!h&&h!==""||s.indexOf("<")!==-1?this.options.commentPropName!==!1&&i===this.options.commentPropName&&u.length===0?this.indentate(l)+`<!--${s}-->`+this.newLine:this.indentate(l)+"<"+i+h+u+this.tagEndChar+s+this.indentate(l)+f:this.indentate(l)+"<"+i+h+u+">"+s+f}},J.prototype.closeTag=function(s){let i="";return this.options.unpairedTags.indexOf(s)!==-1?this.options.suppressUnpairedNode||(i="/"):i=this.options.suppressEmptyNode?"/":`></${s}`,i},J.prototype.checkStopNode=function(s){if(!this.stopNodeExpressions||this.stopNodeExpressions.length===0)return!1;for(let i=0;i<this.stopNodeExpressions.length;i++)if(s.matches(this.stopNodeExpressions[i]))return!0;return!1},J.prototype.buildTextValNode=function(s,i,h,l,f){if(this.options.cdataPropName!==!1&&i===this.options.cdataPropName)return this.indentate(l)+`<![CDATA[${s}]]>`+this.newLine;if(this.options.commentPropName!==!1&&i===this.options.commentPropName)return this.indentate(l)+`<!--${s}-->`+this.newLine;if(i[0]==="?")return this.indentate(l)+"<"+i+h+"?"+this.tagEndChar;{let u=this.options.tagValueProcessor(i,s);return u=this.replaceEntitiesValue(u),u===""?this.indentate(l)+"<"+i+h+this.closeTag(i)+this.tagEndChar:this.indentate(l)+"<"+i+h+">"+u+"</"+i+this.tagEndChar}},J.prototype.replaceEntitiesValue=function(s){if(s&&s.length>0&&this.options.processEntities)for(let i=0;i<this.options.entities.length;i++){let h=this.options.entities[i];s=s.replace(h.regex,h.val)}return s};let go=J,mo={validate:m};mn.exports=t})()});var Nn=L((En)=>{Object.defineProperty(En,"__esModule",{value:!0});En.parseXML=Rf;var Lf=wn(),ps=new Lf.XMLParser({attributeNamePrefix:"",processEntities:{enabled:!0,maxTotalExpansions:1/0},htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(e,t)=>t.trim()===""&&t.includes(`
21
+ `)?"":void 0,maxNestedTags:1/0});ps.addEntity("#xD","\r");ps.addEntity("#10",`
22
+ `);function Rf(e){return ps.parse(e,!0)}});var xn=L((Ff)=>{var qf=Nn(),Hf=/[&<>"]/g,kf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Xf(e){return e.replace(Hf,(t)=>kf[t])}var Gf=/[&"'<>\r\n\u0085\u2028]/g,Vf={"&":"&amp;",'"':"&quot;","'":"&apos;","<":"&lt;",">":"&gt;","\r":"&#x0D;","\n":"&#x0A;","\x85":"&#x85;","\u2028":"&#x2028;"};function Qf(e){return e.replace(Gf,(t)=>Vf[t])}class gs{value;constructor(e){this.value=e}toString(){return Qf(""+this.value)}}class Ve{name;children;attributes={};static of(e,t,r){let n=new Ve(e);if(t!==void 0)n.addChildNode(new gs(t));if(r!==void 0)n.withName(r);return n}constructor(e,t=[]){this.name=e,this.children=t}withName(e){return this.name=e,this}addAttribute(e,t){return this.attributes[e]=t,this}addChildNode(e){return this.children.push(e),this}removeAttribute(e){return delete this.attributes[e],this}n(e){return this.name=e,this}c(e){return this.children.push(e),this}a(e,t){if(t!=null)this.attributes[e]=t;return this}cc(e,t,r=t){if(e[t]!=null){let n=Ve.of(t,e[t]).withName(r);this.c(n)}}l(e,t,r,n){if(e[t]!=null)n().map((o)=>{o.withName(r),this.c(o)})}lc(e,t,r,n){if(e[t]!=null){let a=n(),o=new Ve(r);a.map((c)=>{o.c(c)}),this.c(o)}}toString(){let e=Boolean(this.children.length),t=`<${this.name}`,r=this.attributes;for(let n of Object.keys(r)){let a=r[n];if(a!=null)t+=` ${n}="${Xf(""+a)}"`}return t+=!e?"/>":`>${this.children.map((n)=>n.toString()).join("")}</${this.name}>`}}Ff.parseXML=qf.parseXML;Ff.XmlNode=Ve;Ff.XmlText=gs});var Md=L((rd)=>{var yn=gn(),B=sn(),he=jr(),Q=rn(),H=qt(),Ie=tn(),Sn=ve(),W=xn();class Pe{queryCompat;errorRegistry;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,t){let r=t.getMemberSchemas(),n=Object.values(r).find((a)=>{return!!a.getMergedTraits().httpPayload});if(n){let a=n.getMergedTraits().mediaType;if(a)return a;else if(n.isStringSchema())return"text/plain";else if(n.isBlobSchema())return"application/octet-stream";else return e}else if(!t.isUnitSchema()){if(Object.values(r).find((o)=>{let{httpQuery:c,httpQueryParams:d,httpHeader:p,httpLabel:m,httpPrefixHeaders:E}=o.getMergedTraits();return!c&&!d&&!p&&!m&&E===void 0}))return e}}async getErrorSchemaOrThrowBaseException(e,t,r,n,a,o){let c=e;if(e.includes("#"))[,c]=e.split("#");let d={$metadata:a,$fault:r.statusCode<500?"client":"server"};if(!this.errorRegistry)throw Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:o?.(this.errorRegistry,c)??this.errorRegistry.getSchema(e),errorMetadata:d}}catch(p){n.message=n.message??n.Message??"UnknownError";let m=this.errorRegistry,E=m.getBaseException();if(E){let S=m.getErrorCtor(E)??Error;throw this.decorateServiceException(Object.assign(new S({name:c}),d),n)}let y=n,b=y?.message??y?.Message??y?.Error?.Message??y?.Error?.message;throw this.decorateServiceException(Object.assign(Error(b),{name:c},d),n)}}compose(e,t,r){let n=r;if(t.includes("#"))[n]=t.split("#");let a=B.TypeRegistry.for(n),o=B.TypeRegistry.for("smithy.ts.sdk.synthetic."+r);e.copyFrom(a),e.copyFrom(o),this.errorRegistry=e}decorateServiceException(e,t={}){if(this.queryCompat){let r=e.Message??t.Message,n=he.decorateServiceException(e,t);if(r)n.message=r;n.Error={...n.Error,Type:n.Error?.Type,Code:n.Error?.Code,Message:n.Error?.message??n.Error?.Message??r};let a=n.$metadata.requestId;if(a)n.RequestId=a;return n}return he.decorateServiceException(e,t)}setQueryCompatError(e,t){let r=t.headers?.["x-amzn-query-error"];if(e!==void 0&&r!=null){let[n,a]=r.split(";"),o=Object.entries(e),c={Code:n,Type:a};Object.assign(e,c);for(let[d,p]of o)c[d==="message"?"Message":d]=p;delete c.__type,e.Error=c}}queryCompatOutput(e,t){if(e.Error)t.Error=e.Error;if(e.Type)t.Type=e.Type;if(e.Code)t.Code=e.Code}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch(r){return e.find((n)=>B.NormalizedSchema.of(n).getMergedTraits().awsQueryError?.[0]===t)}}}class Tn extends yn.SmithyRpcV2CborProtocol{awsQueryCompatible;mixin;constructor({defaultNamespace:e,errorTypeRegistries:t,awsQueryCompatible:r}){super({defaultNamespace:e,errorTypeRegistries:t});this.awsQueryCompatible=!!r,this.mixin=new Pe(this.awsQueryCompatible)}async serializeRequest(e,t,r){let n=await super.serializeRequest(e,t,r);if(this.awsQueryCompatible)n.headers["x-amzn-query-mode"]="true";return n}async handleError(e,t,r,n,a){if(this.awsQueryCompatible)this.mixin.setQueryCompatError(n,r);let o=(()=>{let S=r.headers["x-amzn-query-error"];if(S&&this.awsQueryCompatible)return S.split(";")[0];return yn.loadSmithyRpcV2CborErrorCode(r,n)??"Unknown"})();this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);let{errorSchema:c,errorMetadata:d}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,n,a,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),p=B.NormalizedSchema.of(c),m=n.message??n.Message??"UnknownError",y=new(this.compositeErrorRegistry.getErrorCtor(c)??Error)(m),b={};for(let[S,I]of p.structIterator())if(n[S]!=null)b[S]=this.deserializer.readValue(I,n[S]);if(this.awsQueryCompatible)this.mixin.queryCompatOutput(n,b);throw this.mixin.decorateServiceException(Object.assign(y,d,{$fault:p.getMergedTraits().error,message:m},b),n)}}var Jf=(e)=>{if(e==null)return e;if(typeof e==="number"||typeof e==="bigint"){let t=Error(`Received number ${e} where a string was expected.`);return t.name="Warning",console.warn(t),String(e)}if(typeof e==="boolean"){let t=Error(`Received boolean ${e} where a string was expected.`);return t.name="Warning",console.warn(t),String(e)}return e},Zf=(e)=>{if(e==null)return e;if(typeof e==="string"){let t=e.toLowerCase();if(e!==""&&t!=="false"&&t!=="true"){let r=Error(`Received string "${e}" where a boolean was expected.`);r.name="Warning",console.warn(r)}return e!==""&&t!=="false"}return e},Yf=(e)=>{if(e==null)return e;if(typeof e==="string"){let t=Number(e);if(t.toString()!==e){let r=Error(`Received string "${e}" where a number was expected.`);return r.name="Warning",console.warn(r),e}return t}return e};class pe{serdeContext;setSerdeContext(e){this.serdeContext=e}}class ms{from;to;keys;constructor(e,t){this.from=e,this.to=t,this.keys=new Set(Object.keys(this.from).filter((r)=>r!=="__type"))}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){let e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t]}}}function vf(e,t,r){if(r?.source){let n=r.source;if(typeof t==="number"){if(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||n!==String(t))if(n.includes("."))return new H.NumericValue(n,"bigDecimal");else return BigInt(n)}}return t}var An=(e,t)=>he.collectBody(e,t).then((r)=>(t?.utf8Encoder??Sn.toUtf8)(r)),ws=(e,t)=>An(e,t).then((r)=>{if(r.length)try{return JSON.parse(r)}catch(n){if(n?.name==="SyntaxError")Object.defineProperty(n,"$responseBodyText",{value:r});throw n}return{}}),ed=async(e,t)=>{let r=await ws(e,t);return r.message=r.message??r.Message,r},Es=(e,t)=>{let r=(o,c)=>Object.keys(o).find((d)=>d.toLowerCase()===c.toLowerCase()),n=(o)=>{let c=o;if(typeof c==="number")c=c.toString();if(c.indexOf(",")>=0)c=c.split(",")[0];if(c.indexOf(":")>=0)c=c.split(":")[0];if(c.indexOf("#")>=0)c=c.split("#")[1];return c},a=r(e.headers,"x-amzn-errortype");if(a!==void 0)return n(e.headers[a]);if(t&&typeof t==="object"){let o=r(t,"code");if(o&&t[o]!==void 0)return n(t[o]);if(t.__type!==void 0)return n(t.__type)}};class Ns extends pe{settings;constructor(e){super();this.settings=e}async read(e,t){return this._read(e,typeof t==="string"?JSON.parse(t,vf):await ws(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){let r=t!==null&&typeof t==="object",n=B.NormalizedSchema.of(e);if(r){if(n.isStructSchema()){let o=t,c=n.isUnionSchema(),d={},p=void 0,{jsonName:m}=this.settings;if(m)p={};let E;if(c)E=new ms(o,d);for(let[y,b]of n.structIterator()){let S=y;if(m)S=b.getMergedTraits().jsonName??S,p[S]=y;if(c)E.mark(S);if(o[S]!=null)d[y]=this._read(b,o[S])}if(c)E.writeUnknown();else if(typeof o.__type==="string")for(let[y,b]of Object.entries(o)){let S=m?p[y]??y:y;if(!(S in d))d[S]=b}return d}if(Array.isArray(t)&&n.isListSchema()){let o=n.getValueSchema(),c=[];for(let d of t)c.push(this._read(o,d));return c}if(n.isMapSchema()){let o=n.getValueSchema(),c={};for(let[d,p]of Object.entries(t))c[d]=this._read(o,p);return c}}if(n.isBlobSchema()&&typeof t==="string")return Ie.fromBase64(t);let a=n.getMergedTraits().mediaType;if(n.isStringSchema()&&typeof t==="string"&&a){if(a==="application/json"||a.endsWith("+json"))return H.LazyJsonString.from(t);return t}if(n.isTimestampSchema()&&t!=null)switch(Q.determineTimestampFormat(n,this.settings)){case 5:return H.parseRfc3339DateTimeWithOffset(t);case 6:return H.parseRfc7231DateTime(t);case 7:return H.parseEpochTimestamp(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(n.isBigIntegerSchema()&&(typeof t==="number"||typeof t==="string"))return BigInt(t);if(n.isBigDecimalSchema()&&t!=null){if(t instanceof H.NumericValue)return t;let o=t;if(o.type==="bigDecimal"&&"string"in o)return new H.NumericValue(o.string,o.type);return new H.NumericValue(String(t),"bigDecimal")}if(n.isNumericSchema()&&typeof t==="string"){switch(t){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return t}if(n.isDocumentSchema())if(r){let o=Array.isArray(t)?[]:{};for(let[c,d]of Object.entries(t))if(d instanceof H.NumericValue)o[c]=d;else o[c]=this._read(n,d);return o}else return structuredClone(t);return t}}var bn=String.fromCharCode(925);class _n{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,t)=>{if(t instanceof H.NumericValue){let r=`${bn+"nv"+this.counter++}_`+t.string;return this.values.set(`"${r}"`,t.string),r}if(typeof t==="bigint"){let r=t.toString(),n=`${bn+"b"+this.counter++}_`+r;return this.values.set(`"${n}"`,r),n}return t}}replaceInJson(e){if(this.stage===0)throw Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return e;for(let[t,r]of this.values)e=e.replace(t,r);return e}}class xs extends pe{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super();this.settings=e}write(e,t){this.rootSchema=B.NormalizedSchema.of(e),this.buffer=this._write(this.rootSchema,t)}writeDiscriminatedDocument(e,t){if(this.write(e,t),typeof this.buffer==="object")this.buffer.__type=B.NormalizedSchema.of(e).getName(!0)}flush(){let{rootSchema:e,useReplacer:t}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!t)return JSON.stringify(this.buffer);let r=new _n;return r.replaceInJson(JSON.stringify(this.buffer,r.createReplacer(),0))}return this.buffer}_write(e,t,r){let n=t!==null&&typeof t==="object",a=B.NormalizedSchema.of(e);if(n){if(a.isStructSchema()){let o=t,c={},{jsonName:d}=this.settings,p=void 0;if(d)p={};for(let[m,E]of a.structIterator()){let y=this._write(E,o[m],a);if(y!==void 0){let b=m;if(d)b=E.getMergedTraits().jsonName??m,p[m]=b;c[b]=y}}if(a.isUnionSchema()&&Object.keys(c).length===0){let{$unknown:m}=o;if(Array.isArray(m)){let[E,y]=m;c[E]=this._write(15,y)}}else if(typeof o.__type==="string")for(let[m,E]of Object.entries(o)){let y=d?p[m]??m:m;if(!(y in c))c[y]=this._write(15,E)}return c}if(Array.isArray(t)&&a.isListSchema()){let o=a.getValueSchema(),c=[],d=!!a.getMergedTraits().sparse;for(let p of t)if(d||p!=null)c.push(this._write(o,p));return c}if(a.isMapSchema()){let o=a.getValueSchema(),c={},d=!!a.getMergedTraits().sparse;for(let[p,m]of Object.entries(t))if(d||m!=null)c[p]=this._write(o,m);return c}if(t instanceof Uint8Array&&(a.isBlobSchema()||a.isDocumentSchema())){if(a===this.rootSchema)return t;return(this.serdeContext?.base64Encoder??Ie.toBase64)(t)}if(t instanceof Date&&(a.isTimestampSchema()||a.isDocumentSchema()))switch(Q.determineTimestampFormat(a,this.settings)){case 5:return t.toISOString().replace(".000Z","Z");case 6:return H.dateToUtcString(t);case 7:return t.getTime()/1000;default:return console.warn("Missing timestamp format, using epoch seconds",t),t.getTime()/1000}if(t instanceof H.NumericValue)this.useReplacer=!0}if(t===null&&r?.isStructSchema())return;if(a.isStringSchema()){if(typeof t>"u"&&a.isIdempotencyToken())return H.generateIdempotencyToken();let o=a.getMergedTraits().mediaType;if(t!=null&&o){if(o==="application/json"||o.endsWith("+json"))return H.LazyJsonString.from(t)}return t}if(typeof t==="number"&&a.isNumericSchema()){if(Math.abs(t)===1/0||isNaN(t))return String(t);return t}if(typeof t==="string"&&a.isBlobSchema()){if(a===this.rootSchema)return t;return(this.serdeContext?.base64Encoder??Ie.toBase64)(t)}if(typeof t==="bigint")this.useReplacer=!0;if(a.isDocumentSchema())if(n){let o=Array.isArray(t)?[]:{};for(let[c,d]of Object.entries(t))if(d instanceof H.NumericValue)this.useReplacer=!0,o[c]=d;else o[c]=this._write(a,d);return o}else return structuredClone(t);return t}}class ut extends pe{settings;constructor(e){super();this.settings=e}createSerializer(){let e=new xs(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new Ns(this.settings);return e.setSerdeContext(this.serdeContext),e}}class ft extends Q.RpcProtocol{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:r,awsQueryCompatible:n,jsonCodec:a}){super({defaultNamespace:e,errorTypeRegistries:t});this.serviceTarget=r,this.codec=a??new ut({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!n,this.mixin=new Pe(this.awsQueryCompatible)}async serializeRequest(e,t,r){let n=await super.serializeRequest(e,t,r);if(!n.path.endsWith("/"))n.path+="/";if(Object.assign(n.headers,{"content-type":`application/x-amz-json-${this.getJsonRpcVersion()}`,"x-amz-target":`${this.serviceTarget}.${e.name}`}),this.awsQueryCompatible)n.headers["x-amzn-query-mode"]="true";if(B.deref(e.input)==="unit"||!n.body)n.body="{}";return n}getPayloadCodec(){return this.codec}async handleError(e,t,r,n,a){if(this.awsQueryCompatible)this.mixin.setQueryCompatError(n,r);let o=Es(r,n)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);let{errorSchema:c,errorMetadata:d}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,n,a,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),p=B.NormalizedSchema.of(c),m=n.message??n.Message??"UnknownError",y=new(this.compositeErrorRegistry.getErrorCtor(c)??Error)(m),b={};for(let[S,I]of p.structIterator())if(n[S]!=null)b[S]=this.codec.createDeserializer().readObject(I,n[S]);if(this.awsQueryCompatible)this.mixin.queryCompatOutput(n,b);throw this.mixin.decorateServiceException(Object.assign(y,d,{$fault:p.getMergedTraits().error,message:m},b),n)}}class Cn extends ft{constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:r,awsQueryCompatible:n,jsonCodec:a}){super({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:r,awsQueryCompatible:n,jsonCodec:a})}getShapeId(){return"aws.protocols#awsJson1_0"}getJsonRpcVersion(){return"1.0"}getDefaultContentType(){return"application/x-amz-json-1.0"}}class $n extends ft{constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:r,awsQueryCompatible:n,jsonCodec:a}){super({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:r,awsQueryCompatible:n,jsonCodec:a})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}class Mn extends Q.HttpBindingProtocol{serializer;deserializer;codec;mixin=new Pe;constructor({defaultNamespace:e,errorTypeRegistries:t}){super({defaultNamespace:e,errorTypeRegistries:t});let r={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new ut(r),this.serializer=new Q.HttpInterceptingShapeSerializer(this.codec.createSerializer(),r),this.deserializer=new Q.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(),r)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e)}async serializeRequest(e,t,r){let n=await super.serializeRequest(e,t,r),a=B.NormalizedSchema.of(e.input);if(!n.headers["content-type"]){let o=this.mixin.resolveRestContentType(this.getDefaultContentType(),a);if(o)n.headers["content-type"]=o}if(n.body==null&&n.headers["content-type"]===this.getDefaultContentType())n.body="{}";return n}async deserializeResponse(e,t,r){let n=await super.deserializeResponse(e,t,r),a=B.NormalizedSchema.of(e.output);for(let[o,c]of a.structIterator())if(c.getMemberTraits().httpPayload&&!(o in n))n[o]=null;return n}async handleError(e,t,r,n,a){let o=Es(r,n)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);let{errorSchema:c,errorMetadata:d}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,n,a),p=B.NormalizedSchema.of(c),m=n.message??n.Message??"UnknownError",y=new(this.compositeErrorRegistry.getErrorCtor(c)??Error)(m);await this.deserializeHttpMessage(c,t,r,n);let b={};for(let[S,I]of p.structIterator()){let P=I.getMergedTraits().jsonName??S;b[S]=this.codec.createDeserializer().readObject(I,n[P])}throw this.mixin.decorateServiceException(Object.assign(y,d,{$fault:p.getMergedTraits().error,message:m},b),n)}getDefaultContentType(){return"application/json"}}var td=(e)=>{if(e==null)return;if(typeof e==="object"&&"__type"in e)delete e.__type;return he.expectUnion(e)};class dt extends pe{settings;stringDeserializer;constructor(e){super();this.settings=e,this.stringDeserializer=new Q.FromStringShapeDeserializer(e)}setSerdeContext(e){this.serdeContext=e,this.stringDeserializer.setSerdeContext(e)}read(e,t,r){let n=B.NormalizedSchema.of(e),a=n.getMemberSchemas();if(n.isStructSchema()&&n.isMemberSchema()&&!!Object.values(a).find((p)=>{return!!p.getMemberTraits().eventPayload})){let p={},m=Object.keys(a)[0];if(a[m].isBlobSchema())p[m]=t;else p[m]=this.read(a[m],t);return p}let c=(this.serdeContext?.utf8Encoder??Sn.toUtf8)(t),d=this.parseXml(c);return this.readSchema(e,r?d[r]:d)}readSchema(e,t){let r=B.NormalizedSchema.of(e);if(r.isUnitSchema())return;let n=r.getMergedTraits();if(r.isListSchema()&&!Array.isArray(t))return this.readSchema(r,[t]);if(t==null)return t;if(typeof t==="object"){let a=!!n.xmlFlattened;if(r.isListSchema()){let c=r.getValueSchema(),d=[],p=c.getMergedTraits().xmlName??"member",m=a?t:(t[0]??t)[p];if(m==null)return d;let E=Array.isArray(m)?m:[m];for(let y of E)d.push(this.readSchema(c,y));return d}let o={};if(r.isMapSchema()){let c=r.getKeySchema(),d=r.getValueSchema(),p;if(a)p=Array.isArray(t)?t:[t];else p=Array.isArray(t.entry)?t.entry:[t.entry];let m=c.getMergedTraits().xmlName??"key",E=d.getMergedTraits().xmlName??"value";for(let y of p){let b=y[m],S=y[E];o[b]=this.readSchema(d,S)}return o}if(r.isStructSchema()){let c=r.isUnionSchema(),d;if(c)d=new ms(t,o);for(let[p,m]of r.structIterator()){let E=m.getMergedTraits(),y=!E.httpPayload?m.getMemberTraits().xmlName??p:E.xmlName??m.getName();if(c)d.mark(y);if(t[y]!=null)o[p]=this.readSchema(m,t[y])}if(c)d.writeUnknown();return o}if(r.isDocumentSchema())return t;throw Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${r.getName(!0)}`)}if(r.isListSchema())return[];if(r.isMapSchema()||r.isStructSchema())return{};return this.stringDeserializer.read(r,t)}parseXml(e){if(e.length){let t;try{t=W.parseXML(e)}catch(o){if(o&&typeof o==="object")Object.defineProperty(o,"$responseBodyText",{value:e});throw o}let r="#text",n=Object.keys(t)[0],a=t[n];if(a[r])a[n]=a[r],delete a[r];return he.getValueFromTextNode(a)}return{}}}class ys extends pe{settings;buffer;constructor(e){super();this.settings=e}write(e,t,r=""){if(this.buffer===void 0)this.buffer="";let n=B.NormalizedSchema.of(e);if(r&&!r.endsWith("."))r+=".";if(n.isBlobSchema()){if(typeof t==="string"||t instanceof Uint8Array)this.writeKey(r),this.writeValue((this.serdeContext?.base64Encoder??Ie.toBase64)(t))}else if(n.isBooleanSchema()||n.isNumericSchema()||n.isStringSchema()){if(t!=null)this.writeKey(r),this.writeValue(String(t));else if(n.isIdempotencyToken())this.writeKey(r),this.writeValue(H.generateIdempotencyToken())}else if(n.isBigIntegerSchema()){if(t!=null)this.writeKey(r),this.writeValue(String(t))}else if(n.isBigDecimalSchema()){if(t!=null)this.writeKey(r),this.writeValue(t instanceof H.NumericValue?t.string:String(t))}else if(n.isTimestampSchema()){if(t instanceof Date)switch(this.writeKey(r),Q.determineTimestampFormat(n,this.settings)){case 5:this.writeValue(t.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(he.dateToUtcString(t));break;case 7:this.writeValue(String(t.getTime()/1000));break}}else if(n.isDocumentSchema())if(Array.isArray(t))this.write(79,t,r);else if(t instanceof Date)this.write(4,t,r);else if(t instanceof Uint8Array)this.write(21,t,r);else if(t&&typeof t==="object")this.write(143,t,r);else this.writeKey(r),this.writeValue(String(t));else if(n.isListSchema()){if(Array.isArray(t))if(t.length===0){if(this.settings.serializeEmptyLists)this.writeKey(r),this.writeValue("")}else{let a=n.getValueSchema(),o=this.settings.flattenLists||n.getMergedTraits().xmlFlattened,c=1;for(let d of t){if(d==null)continue;let p=a.getMergedTraits(),m=this.getKey("member",p.xmlName,p.ec2QueryName),E=o?`${r}${c}`:`${r}${m}.${c}`;this.write(a,d,E),++c}}}else if(n.isMapSchema()){if(t&&typeof t==="object"){let a=n.getKeySchema(),o=n.getValueSchema(),c=n.getMergedTraits().xmlFlattened,d=1;for(let[p,m]of Object.entries(t)){if(m==null)continue;let E=a.getMergedTraits(),y=this.getKey("key",E.xmlName,E.ec2QueryName),b=c?`${r}${d}.${y}`:`${r}entry.${d}.${y}`,S=o.getMergedTraits(),I=this.getKey("value",S.xmlName,S.ec2QueryName),P=c?`${r}${d}.${I}`:`${r}entry.${d}.${I}`;this.write(a,p,b),this.write(o,m,P),++d}}}else if(n.isStructSchema()){if(t&&typeof t==="object"){let a=!1;for(let[o,c]of n.structIterator()){if(t[o]==null&&!c.isIdempotencyToken())continue;let d=c.getMergedTraits(),p=this.getKey(o,d.xmlName,d.ec2QueryName,"struct"),m=`${r}${p}`;this.write(c,t[o],m),a=!0}if(!a&&n.isUnionSchema()){let{$unknown:o}=t;if(Array.isArray(o)){let[c,d]=o,p=`${r}${c}`;this.write(15,d,p)}}}}else if(n.isUnitSchema());else throw Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${n.getName(!0)}`)}flush(){if(this.buffer===void 0)throw Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");let e=this.buffer;return delete this.buffer,e}getKey(e,t,r,n){let{ec2:a,capitalizeKeys:o}=this.settings;if(a&&r)return r;let c=t??e;if(o&&n==="struct")return c[0].toUpperCase()+c.slice(1);return c}writeKey(e){if(e.endsWith("."))e=e.slice(0,e.length-1);this.buffer+=`&${Q.extendedEncodeURIComponent(e)}=`}writeValue(e){this.buffer+=Q.extendedEncodeURIComponent(e)}}class bs extends Q.RpcProtocol{options;serializer;deserializer;mixin=new Pe;constructor(e){super({defaultNamespace:e.defaultNamespace,errorTypeRegistries:e.errorTypeRegistries});this.options=e;let t={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace,serializeEmptyLists:!0};this.serializer=new ys(t),this.deserializer=new dt(t)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(e){this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e)}getPayloadCodec(){throw Error("AWSQuery protocol has no payload codec.")}async serializeRequest(e,t,r){let n=await super.serializeRequest(e,t,r);if(!n.path.endsWith("/"))n.path+="/";if(Object.assign(n.headers,{"content-type":"application/x-www-form-urlencoded"}),B.deref(e.input)==="unit"||!n.body)n.body="";let a=e.name.split("#")[1]??e.name;if(n.body=`Action=${a}&Version=${this.options.version}`+n.body,n.body.endsWith("&"))n.body=n.body.slice(-1);return n}async deserializeResponse(e,t,r){let n=this.deserializer,a=B.NormalizedSchema.of(e.output),o={};if(r.statusCode>=300){let E=await Q.collectBody(r.body,t);if(E.byteLength>0)Object.assign(o,await n.read(15,E));await this.handleError(e,t,r,o,this.deserializeMetadata(r))}for(let E in r.headers){let y=r.headers[E];delete r.headers[E],r.headers[E.toLowerCase()]=y}let c=e.name.split("#")[1]??e.name,d=a.isStructSchema()&&this.useNestedResult()?c+"Result":void 0,p=await Q.collectBody(r.body,t);if(p.byteLength>0)Object.assign(o,await n.read(a,p,d));return{$metadata:this.deserializeMetadata(r),...o}}useNestedResult(){return!0}async handleError(e,t,r,n,a){let o=this.loadQueryErrorCode(r,n)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);let c=this.loadQueryError(n)??{},d=this.loadQueryErrorMessage(n);c.message=d,c.Error={Type:c.Type,Code:c.Code,Message:d};let{errorSchema:p,errorMetadata:m}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,c,a,this.mixin.findQueryCompatibleError),E=B.NormalizedSchema.of(p),b=new(this.compositeErrorRegistry.getErrorCtor(p)??Error)(d),S={Type:c.Error.Type,Code:c.Error.Code,Error:c.Error};for(let[I,P]of E.structIterator()){let F=P.getMergedTraits().xmlName??I,k=c[F]??n[F];S[I]=this.deserializer.readSchema(P,k)}throw this.mixin.decorateServiceException(Object.assign(b,m,{$fault:E.getMergedTraits().error,message:d},S),n)}loadQueryErrorCode(e,t){let r=(t.Errors?.[0]?.Error??t.Errors?.Error??t.Error)?.Code;if(r!==void 0)return r;if(e.statusCode==404)return"NotFound"}loadQueryError(e){return e.Errors?.[0]?.Error??e.Errors?.Error??e.Error}loadQueryErrorMessage(e){let t=this.loadQueryError(e);return t?.message??t?.Message??e.message??e.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}class On extends bs{options;constructor(e){super(e);this.options=e;let t={capitalizeKeys:!0,flattenLists:!0,serializeEmptyLists:!1,ec2:!0};Object.assign(this.serializer.settings,t)}getShapeId(){return"aws.protocols#ec2Query"}useNestedResult(){return!1}}var In=(e,t)=>An(e,t).then((r)=>{if(r.length){let n;try{n=W.parseXML(r)}catch(d){if(d&&typeof d==="object")Object.defineProperty(d,"$responseBodyText",{value:r});throw d}let a="#text",o=Object.keys(n)[0],c=n[o];if(c[a])c[o]=c[a],delete c[a];return he.getValueFromTextNode(c)}return{}}),sd=async(e,t)=>{let r=await In(e,t);if(r.Error)r.Error.message=r.Error.message??r.Error.Message;return r},Pn=(e,t)=>{if(t?.Error?.Code!==void 0)return t.Error.Code;if(t?.Code!==void 0)return t.Code;if(e.statusCode==404)return"NotFound"};class Ss extends pe{settings;stringBuffer;byteBuffer;buffer;constructor(e){super();this.settings=e}write(e,t){let r=B.NormalizedSchema.of(e);if(r.isStringSchema()&&typeof t==="string")this.stringBuffer=t;else if(r.isBlobSchema())this.byteBuffer="byteLength"in t?t:(this.serdeContext?.base64Decoder??Ie.fromBase64)(t);else{this.buffer=this.writeStruct(r,t,void 0);let n=r.getMergedTraits();if(n.httpPayload&&!n.xmlName)this.buffer.withName(r.getName())}}flush(){if(this.byteBuffer!==void 0){let t=this.byteBuffer;return delete this.byteBuffer,t}if(this.stringBuffer!==void 0){let t=this.stringBuffer;return delete this.stringBuffer,t}let e=this.buffer;if(this.settings.xmlNamespace){if(!e?.attributes?.xmlns)e.addAttribute("xmlns",this.settings.xmlNamespace)}return delete this.buffer,e.toString()}writeStruct(e,t,r){let n=e.getMergedTraits(),a=e.isMemberSchema()&&!n.httpPayload?e.getMemberTraits().xmlName??e.getMemberName():n.xmlName??e.getName();if(!a||!e.isStructSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${e.getName(!0)}.`);let o=W.XmlNode.of(a),[c,d]=this.getXmlnsAttribute(e,r);for(let[m,E]of e.structIterator()){let y=t[m];if(y!=null||E.isIdempotencyToken()){if(E.getMergedTraits().xmlAttribute){o.addAttribute(E.getMergedTraits().xmlName??m,this.writeSimple(E,y));continue}if(E.isListSchema())this.writeList(E,y,o,d);else if(E.isMapSchema())this.writeMap(E,y,o,d);else if(E.isStructSchema())o.addChildNode(this.writeStruct(E,y,d));else{let b=W.XmlNode.of(E.getMergedTraits().xmlName??E.getMemberName());this.writeSimpleInto(E,y,b,d),o.addChildNode(b)}}}let{$unknown:p}=t;if(p&&e.isUnionSchema()&&Array.isArray(p)&&Object.keys(t).length===1){let[m,E]=p,y=W.XmlNode.of(m);if(typeof E!=="string")if(t instanceof W.XmlNode||t instanceof W.XmlText)o.addChildNode(t);else throw Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");this.writeSimpleInto(0,E,y,d),o.addChildNode(y)}if(d)o.addAttribute(c,d);return o}writeList(e,t,r,n){if(!e.isMemberSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${e.getName(!0)}`);let a=e.getMergedTraits(),o=e.getValueSchema(),c=o.getMergedTraits(),d=!!c.sparse,p=!!a.xmlFlattened,[m,E]=this.getXmlnsAttribute(e,n),y=(b,S)=>{if(o.isListSchema())this.writeList(o,Array.isArray(S)?S:[S],b,E);else if(o.isMapSchema())this.writeMap(o,S,b,E);else if(o.isStructSchema()){let I=this.writeStruct(o,S,E);b.addChildNode(I.withName(p?a.xmlName??e.getMemberName():c.xmlName??"member"))}else{let I=W.XmlNode.of(p?a.xmlName??e.getMemberName():c.xmlName??"member");this.writeSimpleInto(o,S,I,E),b.addChildNode(I)}};if(p){for(let b of t)if(d||b!=null)y(r,b)}else{let b=W.XmlNode.of(a.xmlName??e.getMemberName());if(E)b.addAttribute(m,E);for(let S of t)if(d||S!=null)y(b,S);r.addChildNode(b)}}writeMap(e,t,r,n,a=!1){if(!e.isMemberSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${e.getName(!0)}`);let o=e.getMergedTraits(),c=e.getKeySchema(),p=c.getMergedTraits().xmlName??"key",m=e.getValueSchema(),E=m.getMergedTraits(),y=E.xmlName??"value",b=!!E.sparse,S=!!o.xmlFlattened,[I,P]=this.getXmlnsAttribute(e,n),F=(k,Z,D)=>{let ge=W.XmlNode.of(p,Z),[pt,X]=this.getXmlnsAttribute(c,P);if(X)ge.addAttribute(pt,X);k.addChildNode(ge);let Y=W.XmlNode.of(y);if(m.isListSchema())this.writeList(m,D,Y,P);else if(m.isMapSchema())this.writeMap(m,D,Y,P,!0);else if(m.isStructSchema())Y=this.writeStruct(m,D,P);else this.writeSimpleInto(m,D,Y,P);k.addChildNode(Y)};if(S){for(let[k,Z]of Object.entries(t))if(b||Z!=null){let D=W.XmlNode.of(o.xmlName??e.getMemberName());F(D,k,Z),r.addChildNode(D)}}else{let k;if(!a){if(k=W.XmlNode.of(o.xmlName??e.getMemberName()),P)k.addAttribute(I,P);r.addChildNode(k)}for(let[Z,D]of Object.entries(t))if(b||D!=null){let ge=W.XmlNode.of("entry");F(ge,Z,D),(a?r:k).addChildNode(ge)}}}writeSimple(e,t){if(t===null)throw Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");let r=B.NormalizedSchema.of(e),n=null;if(t&&typeof t==="object")if(r.isBlobSchema())n=(this.serdeContext?.base64Encoder??Ie.toBase64)(t);else if(r.isTimestampSchema()&&t instanceof Date)switch(Q.determineTimestampFormat(r,this.settings)){case 5:n=t.toISOString().replace(".000Z","Z");break;case 6:n=he.dateToUtcString(t);break;case 7:n=String(t.getTime()/1000);break;default:console.warn("Missing timestamp format, using http date",t),n=he.dateToUtcString(t);break}else if(r.isBigDecimalSchema()&&t){if(t instanceof H.NumericValue)return t.string;return String(t)}else if(r.isMapSchema()||r.isListSchema())throw Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead.");else throw Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${r.getName(!0)}`);if(r.isBooleanSchema()||r.isNumericSchema()||r.isBigIntegerSchema()||r.isBigDecimalSchema())n=String(t);if(r.isStringSchema())if(t===void 0&&r.isIdempotencyToken())n=H.generateIdempotencyToken();else n=String(t);if(n===null)throw Error(`Unhandled schema-value pair ${r.getName(!0)}=${t}`);return n}writeSimpleInto(e,t,r,n){let a=this.writeSimple(e,t),o=B.NormalizedSchema.of(e),c=new W.XmlText(a),[d,p]=this.getXmlnsAttribute(o,n);if(p)r.addAttribute(d,p);r.addChildNode(c)}getXmlnsAttribute(e,t){let r=e.getMergedTraits(),[n,a]=r.xmlNamespace??[];if(a&&a!==t)return[n?`xmlns:${n}`:"xmlns",a];return[void 0,void 0]}}class Ts extends pe{settings;constructor(e){super();this.settings=e}createSerializer(){let e=new Ss(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new dt(this.settings);return e.setSerdeContext(this.serdeContext),e}}class Dn extends Q.HttpBindingProtocol{codec;serializer;deserializer;mixin=new Pe;constructor(e){super(e);let t={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace};this.codec=new Ts(t),this.serializer=new Q.HttpInterceptingShapeSerializer(this.codec.createSerializer(),t),this.deserializer=new Q.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(),t),this.compositeErrorRegistry}getPayloadCodec(){return this.codec}getShapeId(){return"aws.protocols#restXml"}async serializeRequest(e,t,r){let n=await super.serializeRequest(e,t,r),a=B.NormalizedSchema.of(e.input);if(!n.headers["content-type"]){let o=this.mixin.resolveRestContentType(this.getDefaultContentType(),a);if(o)n.headers["content-type"]=o}if(typeof n.body==="string"&&n.headers["content-type"]===this.getDefaultContentType()&&!n.body.startsWith("<?xml ")&&!this.hasUnstructuredPayloadBinding(a))n.body='<?xml version="1.0" encoding="UTF-8"?>'+n.body;return n}async deserializeResponse(e,t,r){return super.deserializeResponse(e,t,r)}async handleError(e,t,r,n,a){let o=Pn(r,n)??"Unknown";if(this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace),n.Error&&typeof n.Error==="object"){for(let S of Object.keys(n.Error))if(n[S]=n.Error[S],S.toLowerCase()==="message")n.message=n.Error[S]}if(n.RequestId&&!a.requestId)a.requestId=n.RequestId;let{errorSchema:c,errorMetadata:d}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,n,a),p=B.NormalizedSchema.of(c),m=n.Error?.message??n.Error?.Message??n.message??n.Message??"UnknownError",y=new(this.compositeErrorRegistry.getErrorCtor(c)??Error)(m);await this.deserializeHttpMessage(c,t,r,n);let b={};for(let[S,I]of p.structIterator()){let P=I.getMergedTraits().xmlName??S,F=n.Error?.[P]??n[P];b[S]=this.codec.createDeserializer().readSchema(I,F)}throw this.mixin.decorateServiceException(Object.assign(y,d,{$fault:p.getMergedTraits().error,message:m},b),n)}getDefaultContentType(){return"application/xml"}hasUnstructuredPayloadBinding(e){for(let[,t]of e.structIterator())if(t.getMergedTraits().httpPayload)return!(t.isStructSchema()||t.isMapSchema()||t.isListSchema());return!1}}rd.AwsEc2QueryProtocol=On;rd.AwsJson1_0Protocol=Cn;rd.AwsJson1_1Protocol=$n;rd.AwsJsonRpcProtocol=ft;rd.AwsQueryProtocol=bs;rd.AwsRestJsonProtocol=Mn;rd.AwsRestXmlProtocol=Dn;rd.AwsSmithyRpcV2CborProtocol=Tn;rd.JsonCodec=ut;rd.JsonShapeDeserializer=Ns;rd.JsonShapeSerializer=xs;rd.QueryShapeSerializer=ys;rd.XmlCodec=Ts;rd.XmlShapeDeserializer=dt;rd.XmlShapeSerializer=Ss;rd._toBool=Zf;rd._toNum=Yf;rd._toStr=Jf;rd.awsExpectUnion=td;rd.loadRestJsonErrorCode=Es;rd.loadRestXmlErrorCode=Pn;rd.parseJsonBody=ws;rd.parseJsonErrorBody=ed;rd.parseXmlBody=In;rd.parseXmlErrorBody=sd});
23
+ export{Ao as hg,Io as ig,Xo as jg,rr as kg,It as lg,Nr as mg,bh as ng,nc as og,Xc as pg,Ku as qg,Sl as rg,Ml as sg,Dl as tg,Kl as ug,gn as vg,xn as wg,Md as xg,tl as yg};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{BF as S,CF as O,DF as b,GA as a,HF as L,Nz as g,QA as d,Qv as A,Qz as Z,Rv as h,Uy as r,Wx as l,Wz as o,Xx as c,Zx as p,Zy as s,_y as i,iB as n,iw as k,nx as y,qw as f,rw as m,rx as Y,tA as G,uw as T,xw as u,xx as U}from"./chunk-1mqsg5s7.js";import{MF as Jq}from"./chunk-z3mx7n44.js";import{NF as v}from"./chunk-0qqpjj2h.js";import{PF as Kq}from"./chunk-9g64kggy.js";import{QF as w}from"./chunk-8j3aw4qg.js";var M=w(Jq(),1),K=w(v(),1);class $ extends Y()("@effect/opentelemetry/Resource"){}var Nq=(q)=>{let z={...q.attributes??void 0,[K.ATTR_SERVICE_NAME]:q.serviceName,[K.ATTR_TELEMETRY_SDK_NAME]:"@effect/opentelemetry",[K.ATTR_TELEMETRY_SDK_LANGUAGE]:typeof globalThis.document>"u"?K.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:K.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS};if(q.serviceVersion)z[K.ATTR_SERVICE_VERSION]=q.serviceVersion;return z},Vq=(q)=>Z($,G(function*(){let z=yield*b(L("OTEL_SERVICE_NAME")),B=yield*L("OTEL_RESOURCE_ATTRIBUTES").pipe(O(""),S((D)=>{let Q=D.split(",");return y(Q,{},(X,W)=>{let H=W.split("=");if(H.length!==2)return X;return X[H[0].trim()]=H[1].trim(),X})}));if(z._tag==="Some")B[K.ATTR_SERVICE_NAME]=z.value;if(q)Object.assign(B,q);return M.resourceFromAttributes(B)}).pipe(d)),hq=g($,M.emptyResource());var J=w(Kq(),1),j=w(v(),1);var x=BigInt(1e9),N=(q)=>{return[Number(q/x),Number(q%x)]},V=(q)=>{let z={};for(let[B,D]of Object.entries(q))z[B]=_(D);return z},_=(q)=>{if(typeof q==="string"||typeof q==="number"||typeof q==="boolean")return q;else if(typeof q==="bigint")return q.toString();return k(q)};class C extends Y()("@effect/opentelemetry/Tracer"){}class e extends Y()("@effect/opentelemetry/Tracer/OtelTracerProvider"){}class R extends Y()("@effect/opentelemetry/Tracer/OtelTraceFlags"){}class I extends Y()("@effect/opentelemetry/Tracer/OtelTraceState"){}var Qq=a(n(C),(q)=>l({span(z){return new F(J.context,J.trace,q,z)},context(z,B){let D=B.currentSpan;if(D===void 0)return z["~effect/Effect/evaluate"](B);return J.context.with(qq(J.context.active(),D),()=>z["~effect/Effect/evaluate"](B))}}));var Xq=Z(C,G(function*(){let q=yield*$;return(yield*e).getTracer(q.attributes[j.ATTR_SERVICE_NAME],q.attributes[j.ATTR_SERVICE_VERSION])}));var Yq=Z(p,Qq),xq=Yq.pipe(o(Xq));var E="~@effect/opentelemetry/Tracer/OtelSpan",Zq={internal:J.SpanKind.INTERNAL,client:J.SpanKind.CLIENT,server:J.SpanKind.SERVER,producer:J.SpanKind.PRODUCER,consumer:J.SpanKind.CONSUMER};class F{[E];_tag="Span";name;kind;annotations;links;span;spanId;traceId;attributes=new Map;sampled;parent;status;constructor(q,z,B,D){this[E]=E,this.name=D.name,this.annotations=D.annotations,this.links=D.links,this.kind=D.kind;let Q=q.active();this.parent=D.root!==!0?u(D.parent,()=>Uq(z,Q,D.annotations)):D.parent,this.span=B.startSpan(D.name,{startTime:N(D.startTime),links:D.links.length>0?D.links.map((W)=>({context:P(W.span),attributes:V(W.attributes)})):void 0,kind:Zq[this.kind]},T(this.parent)?qq(Q,this.parent.value,D.annotations):J.trace.deleteSpan(Q));let X=this.span.spanContext();this.spanId=X.spanId,this.traceId=X.traceId,this.status={_tag:"Started",startTime:D.startTime},this.sampled=$q(X.traceFlags)}attribute(q,z){this.span.setAttribute(q,_(z)),this.attributes.set(q,z)}addLinks(q){this.links.push(...q),this.span.addLinks(q.map((z)=>({context:P(z.span),attributes:V(z.attributes)})))}end(q,z){let B=N(q);if(this.status={_tag:"Ended",endTime:q,exit:z,startTime:this.status.startTime},z._tag==="Success")this.span.setStatus({code:J.SpanStatusCode.OK});else if(r(z.cause))this.span.setStatus({code:J.SpanStatusCode.OK,message:i(z.cause)}),this.span.setAttribute("span.label","\u26A0\uFE0E Interrupted"),this.span.setAttribute("status.interrupted",!0);else{let D=s(z.cause);if(D.length>0){for(let Q of D)this.span.recordException(Q,B);this.span.setStatus({code:J.SpanStatusCode.ERROR,message:D[0].message})}else this.span.setStatus({code:J.SpanStatusCode.OK})}this.span.end(B)}event(q,z,B){this.span.addEvent(q,B?V(B):void 0,N(z))}}var $q=(q)=>(q&J.TraceFlags.SAMPLED)===J.TraceFlags.SAMPLED,Uq=(q,z,B)=>{let D=q.getSpan(z)?.spanContext();if(!D)return f();return m(c({spanId:D.spanId,traceId:D.traceId,sampled:(D.traceFlags&1)===1,annotations:B}))},P=(q,z)=>{let B=Wq(q,z),D=wq(q,z);return{spanId:q.spanId,traceId:q.traceId,isRemote:q._tag==="ExternalSpan",traceFlags:B,traceState:D}},Wq=(q,z)=>{let B;if(h(z)){if(B=t(q,z,R),A(B))B=U(q.annotations,R)}return B??J.TraceFlags.SAMPLED},wq=(q,z)=>{let B;if(h(z)){if(B=t(q,z,I),A(B))B=U(q.annotations,I)}return B},t=(q,z,B)=>{let D=U(z,B);if(h(D))return D;return U(q.annotations,B)},qq=(q,z,B)=>z instanceof F?J.trace.setSpan(q,z.span):J.trace.setSpanContext(q,P(z,B));
3
+ export{N as qv,_ as rv,$ as sv,Nq as tv,Vq as uv,hq as vv,C as wv,e as xv,xq as yv};